Class UnknownApplicationException

All Implemented Interfaces:
Serializable

public class UnknownApplicationException extends IOException
The refusal of an external page asked for an application this server does not have: the "app" of the query names no registered application (CC-FIX-SERVER-THEME-WALK, AW-5 of CC-ANDROID-APPS-WALK). CustomDefaultServlet answers it with status 404 and, for a .json target, a small JSON body that names the program, so that an iiziRun tells its user that the application is not on this server instead of "Remote party is not an iiziServer instance", and logs ONE WARNING line without a stack trace: a launcher asking for an application that is not here is not a failure of the server, which answered status 500 "Server error" and logged SEVERE with a full stack trace until then.

The exception carries the application ID for the log line, the program's name for the body and, for the port gate, the reason the log line adds (an application not served on the port is answered as an unknown one, CC-FIX-APP-DEFINITIONS D-9); the body never carries the ID or the reason (the launcher names the application it asked for itself, and nothing of a request reaches a client in a failure reply, CC-FIX-APPJSON-EMPTY-200).

Author:
Christopher Mindus
See Also:
  • Constructor Details

    • UnknownApplicationException

      public UnknownApplicationException(String appID, String program)
      Constructor for an application that is not registered.
      Parameters:
      appID - The application ID asked for, null for none.
      program - The program answering, e.g. "iiziServer", the "program" member of the JSON body.
    • UnknownApplicationException

      public UnknownApplicationException(String appID, String program, String reason)
      Constructor with the reason the log line carries.
      Parameters:
      appID - The application ID asked for, null for none.
      program - The program answering, e.g. "iiziServer", the "program" member of the JSON body.
      reason - The reason for the log, null for none: the client is never told it.
  • Method Details

    • getReason

      public String getReason()
      Gets the reason for the log line.
      Returns:
      The reason, null for none.
    • getAppID

      public String getAppID()
      Gets the application ID asked for.
      Returns:
      The ID, empty for none.
    • getProgram

      public String getProgram()
      Gets the program answering.
      Returns:
      The program name, e.g. "iiziServer".
    • getLoggableAppID

      public String getLoggableAppID()
      Gets the application ID as ONE log line can carry it: every control character (a line break among them) replaced by '?', and at most 200 characters.
      Returns:
      The ID for the log.