Class GatekeeperMessage
java.lang.Object
org.jets3t.service.utils.gatekeeper.GatekeeperMessage
Represents a set of properties that will be sent to or received from a Gatekeeper service as
a message document. This class includes utility methods to generate and parse plain text
encodings of messages.
For more information about the Gatekeeper message format, please see: Gatekeeper Concepts
- Author:
- James Murty
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The property name for storing error codes a Gatekeeper can return to a client.static final String
All message property names are delimited with a vertical bar (|).static final String
A flag name that indicates the Gatekeeper servlet should perform a bucket listing - for example as used by CockpitLitestatic final String
The property name for storing information about a client application such as its version number.static final String
The property name for storing information about prior failures in the gatekeeper client application.static final String
The property name for message-specific transaction IDs: transactionIdstatic final String
A flag name used to indicate when an S3Object is a summary XML document, as generated by the Uploader application. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addApplicationProperties
(Map propertiesMap) Adds a set of application-specific properties to the message.void
addApplicationProperty
(String propertyName, String propertyValue) Adds an application-specific property to the message.void
addMessageProperties
(Map propertiesMap) Adds a set of message-specific properties to the message.void
addMessageProperty
(String propertyName, String propertyValue) Adds a message-specific property to the message.void
addSignatureRequest
(SignatureRequest signatureRequest) Adds a Signature Request to the message, indicating a request that a particular operation be allowed on a particular object.void
addSignatureRequests
(SignatureRequest[] signatureRequests) Adds multiple signature requests to the message.static GatekeeperMessage
decodeFromProperties
(Map postProperties) Decodes (parses) a Gatekeeper message from the given properties.Encodes a Gatekeeper message as a properties object, with all signature requests identified with a unique zero-based index number.Returns the signature requests in a message.
-
Field Details
-
DELIM
All message property names are delimited with a vertical bar (|).- See Also:
-
PROPERTY_TRANSACTION_ID
The property name for message-specific transaction IDs: transactionId- See Also:
-
PROPERTY_PRIOR_FAILURE_MESSAGE
The property name for storing information about prior failures in the gatekeeper client application.- See Also:
-
PROPERTY_CLIENT_VERSION_ID
The property name for storing information about a client application such as its version number. This information can be useful to server-side components to confirm compatibility with the client.- See Also:
-
APP_PROPERTY_GATEKEEPER_ERROR_CODE
The property name for storing error codes a Gatekeeper can return to a client. The error codes can be any string value.- See Also:
-
SUMMARY_DOCUMENT_METADATA_FLAG
A flag name used to indicate when an S3Object is a summary XML document, as generated by the Uploader application.- See Also:
-
LIST_OBJECTS_IN_BUCKET_FLAG
A flag name that indicates the Gatekeeper servlet should perform a bucket listing - for example as used by CockpitLite- See Also:
-
-
Constructor Details
-
GatekeeperMessage
public GatekeeperMessage()Constructs a message with no properties.
-
-
Method Details
-
addSignatureRequest
Adds a Signature Request to the message, indicating a request that a particular operation be allowed on a particular object.- Parameters:
signatureRequest
-
-
addSignatureRequests
Adds multiple signature requests to the message.- Parameters:
signatureRequests
-
-
getSignatureRequests
Returns the signature requests in a message. When this method is called on a request message, this list will include only the requested operations. When this method is called on a message that is a response from a Gatekeeper service, the resulting list will include the signed URLs or reasons why requests were declined.- Returns:
- the set of signature requests in this message.
-
addApplicationProperty
Adds an application-specific property to the message.- Parameters:
propertyName
-propertyValue
-
-
addApplicationProperties
Adds a set of application-specific properties to the message.- Parameters:
propertiesMap
-
-
getApplicationProperties
- Returns:
- the application-specific properties in this message.
-
addMessageProperty
Adds a message-specific property to the message.- Parameters:
propertyName
-propertyValue
-
-
addMessageProperties
Adds a set of message-specific properties to the message.- Parameters:
propertiesMap
-
-
getMessageProperties
- Returns:
- the message-specific properties in this message.
-
encodeToProperties
Encodes a Gatekeeper message as a properties object, with all signature requests identified with a unique zero-based index number.- Returns:
- all the properties of the message.
-
decodeFromProperties
Decodes (parses) a Gatekeeper message from the given properties. Any properties that are not part of the message format are ignored.- Parameters:
postProperties
-- Returns:
- a Gatekeeper message object representing the contents of the properties.
-