com.ibm.itim.remoteservices.provider
Class RequestStatus

java.lang.Object
  |
  +--com.ibm.itim.remoteservices.provider.RequestStatus
All Implemented Interfaces:
java.io.Serializable

public class RequestStatus
extends java.lang.Object
implements java.io.Serializable

Class encapsulates a response from a remote resource, including the status and any message.

See Also:
Serialized Form

Field Summary
static int AUTHENTICATION_ERROR
          Reason: Authentication error type for an unsuccessful request
static int COMMUNICATION_ERROR
          Reason: Communications error type for an unsuccessful request
static int CONFIGURATION_ERROR
          Reason: Communications error type for an unsuccessful request
static int INVALID_SEARCH_CONTROLS_ERROR
          Reason: Error type for an unsuccessful request indicating that the search controls specified in the request was invalid.
static int INVALID_SEARCH_FILTER_ERROR
          Reason: Error type for an unsuccessful request indicating that the search filter specified in the request was invalid.
static int NAME_ALREADY_BOUND_ERROR
          Reason: Error type for an unsuccessful request indicating that the name requested was already in use.
static int NAME_INVALID_ERROR
          Reason: Error type for an unsuccessful request indicating that the format of the name of the entity was invalid.
static int NAME_NOT_FOUND_ERROR
          Reason: Error type for an unsuccessful request indicating that the name requested was not found.
static int NO_SUCH_ATTRIBUTE_ERROR
          Reason: Error type for an unsuccessful request indicating that there was no such attribute matching an attribute specified in the request.
static int OPERATION_NOT_SUPPORTED_ERROR
          Reason: Error type for an unsuccessful request indicating that the operation requested was not implemented.
static int PENDING
          Status: The request has been made but a response is pending.
static int PENDING_ASYNCHRONOUS
          Reason: Request Pending because resource is Asynchronous
static int PENDING_RECON_IN_PROGRESS
          Reason: Request Pending because resource has exclusive recon in progress
static int PENDING_RESOURCE_FAILED
          Reason: Request Pending because resource has failed
static int PROCESSING_ERROR
          Reason: Processing error type for an unsuccessful request
static int SIZE_LIMIT_EXCEEDED_ERROR
          Reason: Error type for an unsuccessful request indicating that the search matched more results than could be returned.
static int SUCCESSFUL
          Status: The request was successful.
static int SUCCESSFUL_WARNING
          Status: The request was partially successful.
static int TIME_LIMIT_EXCEEDED_ERROR
          Reason: Error type for an unsuccessful request indicating that the time limited was exceeded for the resource to respond.
static int UNSUCCESSFUL
          Status: The request failed.
static int USER_ABORTED
          Reason: Error type for an unsuccessful request indicating that the search controls specified in the request was invalid.
 
Constructor Summary
RequestStatus(int status)
          Construct with a status code.
RequestStatus(int status, int reason, java.lang.String reasonMessage)
          Construct with a status code and a text message.
RequestStatus(int status, int reason, java.lang.String reasonMessageId, java.lang.Object[] tokens)
          Construct with a status code, message key & tokens.
RequestStatus(int status, java.lang.String reasonMessage)
          Construct with a status code and a text message.
RequestStatus(RequestStatus requestStatus)
          Construct a RequestStatus from another, making an exact copy.
 
Method Summary
 void addNotChangedAttributes(AttributeValue unchangedAttribute)
          Adds an attribute that was not able to be added / updated on the remote resouce.
 void addReasonMessageArg(java.lang.String arg)
          Adds a reason message token for internationalization
 boolean failed()
          Accessor method for whether the status is unsuccessful
 AttributeValues getNotChangedAttributes()
          Gets a map of attributes that were not able to be added / updated on the remote resouce.
 int getReason()
          Gets the reason for an unsuccessful response from the remote resource.
 java.lang.String getReasonAsString()
          Return reason code as a String, for log messages
 java.lang.String getReasonMessage()
          Gets a possible warning or error message from the remote resource
 java.util.Collection getReasonMessageArgs()
          The arguments for the reason message are used for internationalization
 AttributeValues getReturnAttributes()
          Gets a list of the return (output) attributes from the remote request.
 int getStatus()
          Gets the status of the response from the remote resource
 java.lang.String getStatusAsString()
          Return status code as a String, for log messages
 java.lang.String getXMLFormattedMessage()
          Gets error message, xml formatted.
 boolean pending()
          Accessor method for whether the status is pending
 void setReason(int reason)
          Sets the reason for an unsuccessful response from the remote resource.
 void setReasonMessage(java.lang.String reasonMessage)
          Sets a possible warning or error message from the remote resource
 void setReasonMessageArgs(java.util.Collection args)
          The arguments for the reason message are used for internationalization
 void setReasonMessageArgs(java.lang.Object[] args)
          The arguments for the reason message are used for internationalization
 void setReturnAttributes(AttributeValues returnAttributes)
          Sets a list of the output attributes from the remote request.
 void setStatus(int status)
          Sets the status of the response from the remote resource
 boolean succeeded()
          Accessor method for whether the status is successful or pending
 java.lang.String toString()
          Override method from java.lang.Object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PENDING

public static final int PENDING
Status: The request has been made but a response is pending. This indicates the request is asynchronous

See Also:
Constant Field Values

SUCCESSFUL

public static final int SUCCESSFUL
Status: The request was successful.

See Also:
Constant Field Values

UNSUCCESSFUL

public static final int UNSUCCESSFUL
Status: The request failed. In this case the method getReason() will return the reason for the failure.

See Also:
Constant Field Values

SUCCESSFUL_WARNING

public static final int SUCCESSFUL_WARNING
Status: The request was partially successful.

See Also:
Constant Field Values

PENDING_ASYNCHRONOUS

public static final int PENDING_ASYNCHRONOUS
Reason: Request Pending because resource is Asynchronous

See Also:
Constant Field Values

PENDING_RECON_IN_PROGRESS

public static final int PENDING_RECON_IN_PROGRESS
Reason: Request Pending because resource has exclusive recon in progress

See Also:
Constant Field Values

PENDING_RESOURCE_FAILED

public static final int PENDING_RESOURCE_FAILED
Reason: Request Pending because resource has failed

See Also:
Constant Field Values

PROCESSING_ERROR

public static final int PROCESSING_ERROR
Reason: Processing error type for an unsuccessful request

See Also:
Constant Field Values

COMMUNICATION_ERROR

public static final int COMMUNICATION_ERROR
Reason: Communications error type for an unsuccessful request

See Also:
Constant Field Values

CONFIGURATION_ERROR

public static final int CONFIGURATION_ERROR
Reason: Communications error type for an unsuccessful request

See Also:
Constant Field Values

AUTHENTICATION_ERROR

public static final int AUTHENTICATION_ERROR
Reason: Authentication error type for an unsuccessful request

See Also:
Constant Field Values

NAME_INVALID_ERROR

public static final int NAME_INVALID_ERROR
Reason: Error type for an unsuccessful request indicating that the format of the name of the entity was invalid.

See Also:
Constant Field Values

OPERATION_NOT_SUPPORTED_ERROR

public static final int OPERATION_NOT_SUPPORTED_ERROR
Reason: Error type for an unsuccessful request indicating that the operation requested was not implemented.

See Also:
Constant Field Values

NO_SUCH_ATTRIBUTE_ERROR

public static final int NO_SUCH_ATTRIBUTE_ERROR
Reason: Error type for an unsuccessful request indicating that there was no such attribute matching an attribute specified in the request.

See Also:
Constant Field Values

NAME_NOT_FOUND_ERROR

public static final int NAME_NOT_FOUND_ERROR
Reason: Error type for an unsuccessful request indicating that the name requested was not found.

See Also:
Constant Field Values

INVALID_SEARCH_FILTER_ERROR

public static final int INVALID_SEARCH_FILTER_ERROR
Reason: Error type for an unsuccessful request indicating that the search filter specified in the request was invalid.

See Also:
Constant Field Values

SIZE_LIMIT_EXCEEDED_ERROR

public static final int SIZE_LIMIT_EXCEEDED_ERROR
Reason: Error type for an unsuccessful request indicating that the search matched more results than could be returned.

See Also:
Constant Field Values

TIME_LIMIT_EXCEEDED_ERROR

public static final int TIME_LIMIT_EXCEEDED_ERROR
Reason: Error type for an unsuccessful request indicating that the time limited was exceeded for the resource to respond.

See Also:
Constant Field Values

NAME_ALREADY_BOUND_ERROR

public static final int NAME_ALREADY_BOUND_ERROR
Reason: Error type for an unsuccessful request indicating that the name requested was already in use.

See Also:
Constant Field Values

INVALID_SEARCH_CONTROLS_ERROR

public static final int INVALID_SEARCH_CONTROLS_ERROR
Reason: Error type for an unsuccessful request indicating that the search controls specified in the request was invalid.

See Also:
Constant Field Values

USER_ABORTED

public static final int USER_ABORTED
Reason: Error type for an unsuccessful request indicating that the search controls specified in the request was invalid.

See Also:
Constant Field Values
Constructor Detail

RequestStatus

public RequestStatus(int status)
Construct with a status code.

Parameters:
status - Possible values are PENDING, SUCCESSFUL, UNSUCCESSFUL, SUCCESSFUL_WARNING

RequestStatus

public RequestStatus(int status,
                     java.lang.String reasonMessage)
Construct with a status code and a text message.

Parameters:
status - Possible values are PENDING, SUCCESSFUL, UNSUCCESSFUL, SUCCESSFUL_WARNING
reasonMessage - A message accompanying an unsuccessful or conditionally successful response.

RequestStatus

public RequestStatus(int status,
                     int reason,
                     java.lang.String reasonMessage)
Construct with a status code and a text message.

Parameters:
status - Possible values are PENDING, SUCCESSFUL, UNSUCCESSFUL, SUCCESSFUL_WARNING
reason - the reason for an unsuccessful response Possible values are PROCESSING_ERROR, COMMUNICATION_ERROR, AUTHENTICATION_ERROR, NAME_INVALID_ERROR, NAME_INVALID_ERROR, OPERATION_NOT_SUPPORTED_ERROR, NO_SUCH_ATTRIBUTE_ERROR, NAME_NOT_FOUND_ERROR, INVALID_SEARCH_FILTER_ERROR, SIZE_LIMIT_EXCEEDED_ERROR, TIME_LIMIT_EXCEEDED_ERROR.
reasonMessage - A message accompanying an unsuccessful or conditionally successful response.

RequestStatus

public RequestStatus(int status,
                     int reason,
                     java.lang.String reasonMessageId,
                     java.lang.Object[] tokens)
Construct with a status code, message key & tokens.

Parameters:
status - Possible values are PENDING, SUCCESSFUL, UNSUCCESSFUL, SUCCESSFUL_WARNING
reason - the reason for an unsuccessful response Possible values are PROCESSING_ERROR, COMMUNICATION_ERROR, AUTHENTICATION_ERROR, NAME_INVALID_ERROR, NAME_INVALID_ERROR, OPERATION_NOT_SUPPORTED_ERROR, NO_SUCH_ATTRIBUTE_ERROR, NAME_NOT_FOUND_ERROR, INVALID_SEARCH_FILTER_ERROR, SIZE_LIMIT_EXCEEDED_ERROR, TIME_LIMIT_EXCEEDED_ERROR.
reasonMessageId - A message Id
tokens - token list for reasonMessageId/null (stored as ReasonMessageArg's)

RequestStatus

public RequestStatus(RequestStatus requestStatus)
Construct a RequestStatus from another, making an exact copy.

Parameters:
requestStatus - Copies the status and message from this RequestStatus object
Method Detail

getStatus

public int getStatus()
Gets the status of the response from the remote resource

Returns:
One of PENDING, SUCCESSFUL, UNSUCCESSFUL, SUCCESSFUL_WARNING

getStatusAsString

public java.lang.String getStatusAsString()
Return status code as a String, for log messages

Returns:
string describing status code.

setStatus

public void setStatus(int status)
Sets the status of the response from the remote resource

Parameters:
status - One of PENDING, SUCCESSFUL, UNSUCCESSFUL, SUCCESSFUL_WARNING

getReason

public int getReason()
Gets the reason for an unsuccessful response from the remote resource. Possible values are PROCESSING_ERROR, COMMUNICATION_ERROR, AUTHENTICATION_ERROR, NAME_INVALID_ERROR, NAME_INVALID_ERROR, OPERATION_NOT_SUPPORTED_ERROR, NO_SUCH_ATTRIBUTE_ERROR, NAME_NOT_FOUND_ERROR, INVALID_SEARCH_FILTER_ERROR, SIZE_LIMIT_EXCEEDED_ERROR, TIME_LIMIT_EXCEEDED_ERROR.

Returns:
the reason for an unsuccessful response

getReasonAsString

public java.lang.String getReasonAsString()
Return reason code as a String, for log messages

Returns:
string describing reason code.

setReason

public void setReason(int reason)
Sets the reason for an unsuccessful response from the remote resource. Possible values are PROCESSING_ERROR, COMMUNICATION_ERROR, AUTHENTICATION_ERROR, NAME_INVALID_ERROR, NAME_INVALID_ERROR, OPERATION_NOT_SUPPORTED_ERROR, NO_SUCH_ATTRIBUTE_ERROR, NAME_NOT_FOUND_ERROR, INVALID_SEARCH_FILTER_ERROR, SIZE_LIMIT_EXCEEDED_ERROR, TIME_LIMIT_EXCEEDED_ERROR.

Parameters:
reason - the reason for an unsuccessful response

getReasonMessage

public java.lang.String getReasonMessage()
Gets a possible warning or error message from the remote resource

Returns:
The error / warning message or an empty string if there was none

setReasonMessage

public void setReasonMessage(java.lang.String reasonMessage)
Sets a possible warning or error message from the remote resource

Parameters:
reasonMessage - The error / warning message or an empty string if there was none

setReasonMessageArgs

public void setReasonMessageArgs(java.util.Collection args)
The arguments for the reason message are used for internationalization

Parameters:
args - A collection of Strings

setReasonMessageArgs

public void setReasonMessageArgs(java.lang.Object[] args)
The arguments for the reason message are used for internationalization

Parameters:
args - An array of Strings

addReasonMessageArg

public void addReasonMessageArg(java.lang.String arg)
Adds a reason message token for internationalization

Parameters:
arg - A message token to be substituted into an internationalized message

getReasonMessageArgs

public java.util.Collection getReasonMessageArgs()
The arguments for the reason message are used for internationalization

Returns:
args A collection of Strings

pending

public boolean pending()
Accessor method for whether the status is pending

Returns:
True if the status is pending

failed

public boolean failed()
Accessor method for whether the status is unsuccessful

Returns:
True if the status was unsuccessful

succeeded

public boolean succeeded()
Accessor method for whether the status is successful or pending

Returns:
True if the status was successful or pending

getNotChangedAttributes

public AttributeValues getNotChangedAttributes()
Gets a map of attributes that were not able to be added / updated on the remote resouce. Should be used when an operation was conditionally successful with warnings.

Returns:
A map of the attributes not added / updated

addNotChangedAttributes

public void addNotChangedAttributes(AttributeValue unchangedAttribute)
Adds an attribute that was not able to be added / updated on the remote resouce. Should be used when an operation was conditionally successful with warnings.

Parameters:
unchangedAttribute - The attribute that did not change

getReturnAttributes

public AttributeValues getReturnAttributes()
Gets a list of the return (output) attributes from the remote request. This will usually be empty but for an add request may contain extra attributes generated by the remote resource. This method will be called by the provider framework to process those additional attributes.

Returns:
An Attributes set of output attributes.

setReturnAttributes

public void setReturnAttributes(AttributeValues returnAttributes)
Sets a list of the output attributes from the remote request. This will usually be empty but for an add request may contain extra attributes generated by the remote resource. This method should be called by the ServiceProvider implementer to set those attributes for the ServiceProvider framework to process later.

Parameters:
returnAttributes - An AttributeValues set of output attributes.

getXMLFormattedMessage

public java.lang.String getXMLFormattedMessage()
Gets error message, xml formatted.

DTD definition of returned format is:

 
 
 
 
 

Returns:
xml formatted error message

toString

public java.lang.String toString()
Override method from java.lang.Object

Overrides:
toString in class java.lang.Object
Returns:
a string including the class, status, reason, and message


IBM Tivoli Identity Manager 4.6
© Copyright International Business Machines Corporation 2005. All rights reserved. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.