com.atlassian.security.auth.trustedapps
Class TransportErrorMessage

java.lang.Object
  extended by com.atlassian.security.auth.trustedapps.TransportErrorMessage
Direct Known Subclasses:
TransportErrorMessage.ApplicationIdNotFoundInRequest, TransportErrorMessage.ApplicationUnknown, TransportErrorMessage.BadProtocolVersion, TransportErrorMessage.MagicNumberNotFoundInRequest, TransportErrorMessage.PermissionDenied, TransportErrorMessage.SecretKeyNotFoundInRequest, TransportErrorMessage.UserUnknown

public class TransportErrorMessage
extends java.lang.Object

TransportErrorMessages are reported when a client makes a TrustedApplication request.

The String format of these is important. They basically consist of three elements:

  1. Error Code (one of the TransportErrorMessage.Code constants)
  2. Message (a MessageFormat formatted message)
  3. Parameters (encoded as a JSON array)
These are separated by a semi-colon tab.

To parse a String into a TransportErrorMessage use a Parser. If the String is not in the correct format, exceptions will be thrown. The format to the toString() method and the format the Parser accepts must be symmetric and constant.


Nested Class Summary
static class TransportErrorMessage.ApplicationIdNotFoundInRequest
          AppId not found in request
static class TransportErrorMessage.ApplicationUnknown
           
static class TransportErrorMessage.BadProtocolVersion
           
static class TransportErrorMessage.Code
          Typesafe enum that contains all known error codes.
static class TransportErrorMessage.MagicNumberNotFoundInRequest
           
static class TransportErrorMessage.PermissionDenied
           
static class TransportErrorMessage.SecretKeyNotFoundInRequest
           
static class TransportErrorMessage.UserUnknown
           
 
Method Summary
 TransportErrorMessage.Code getCode()
           
 java.lang.String getFormattedMessage()
           
 java.lang.String[] getParameters()
           
 java.lang.String toString()
          String representation of a TransportErrorMessage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getCode

public TransportErrorMessage.Code getCode()

getParameters

public java.lang.String[] getParameters()

getFormattedMessage

public java.lang.String getFormattedMessage()

toString

public java.lang.String toString()
String representation of a TransportErrorMessage. Of the form:
 code Parser#SEPARATOR message Parser#SEPARATOR params
 
where the params are encoded as a JSON array.

Note: The String representation of a TransportErrorMessage is sent across the wire as an error to the client. Therefore this format is static and must not change.

Overrides:
toString in class java.lang.Object
See Also:
Parser#parse(String)


Copyright © 2009 Atlassian Software Systems Pty Ltd. All Rights Reserved.