com.ibm.itim.remoteservices.provider
Class RequestStatus

java.lang.Object
  extended by 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

Nested Class Summary
static class RequestStatus.Reason
           
static class RequestStatus.Status
           
 
Field Summary
static RequestStatus.Reason AUTHENTICATION_ERROR
           
static RequestStatus.Reason COMMUNICATION_ERROR
           
static RequestStatus.Reason CONFIGURATION_ERROR
           
static RequestStatus.Reason INSECURE_CONNECTION
           
static RequestStatus.Reason INVALID_SEARCH_CONTROLS_ERROR
           
static RequestStatus.Reason INVALID_SEARCH_FILTER_ERROR
           
static RequestStatus.Reason NAME_ALREADY_BOUND_ERROR
           
static RequestStatus.Reason NAME_INVALID_ERROR
           
static RequestStatus.Reason NAME_NOT_FOUND_ERROR
           
static RequestStatus.Reason NO_REASON_SPECIFIED
           
static RequestStatus.Reason NO_SUCH_ATTRIBUTE_ERROR
           
static RequestStatus.Reason OPERATION_NOT_SUPPORTED_ERROR
           
static RequestStatus.Status PENDING
           
static RequestStatus.Reason PENDING_ASYNCHRONOUS
           
static RequestStatus.Reason PENDING_RECON_IN_PROGRESS
           
static RequestStatus.Reason PENDING_RESOURCE_FAILED
           
static RequestStatus.Reason PROCESSING_ERROR
           
static RequestStatus.Reason RECON_IN_PROGRESS
           
static RequestStatus.Reason SIZE_LIMIT_EXCEEDED_ERROR
           
static RequestStatus.Status SUCCESSFUL
           
static RequestStatus.Status SUCCESSFUL_WARNING
           
static RequestStatus.Reason TIME_LIMIT_EXCEEDED_ERROR
           
static RequestStatus.Status UNSUCCESSFUL
           
static RequestStatus.Reason USER_ABORTED
           
 
Constructor Summary
RequestStatus(RequestStatus.Status status)
          Construct with a status code.
RequestStatus(RequestStatus.Status status, RequestStatus.Reason reason, java.lang.String reasonMessage)
          Construct with a status code and a text message.
RequestStatus(RequestStatus.Status status, RequestStatus.Reason reason, java.lang.String reasonMessageId, java.lang.Object[] tokens)
          Construct with a status code, message key & tokens.
RequestStatus(RequestStatus.Status 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 (shallow) 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 the attributes that were not able to be added / updated on the remote resouce.
 RequestStatus.Reason 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<java.lang.String> 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.
 RequestStatus.Status 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 set(RequestStatus newStatus)
          set this to specified value
 void setReason(RequestStatus.Reason 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<java.lang.String> 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(RequestStatus.Status status)
          Sets the status of the response from the remote resource
 boolean succeeded()
          Accessor method for whether the status is successful, warning or pending
 java.lang.String toString()
          Override method from java.lang.Object
 boolean warning()
          Accessor method for whether the status is warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PENDING

public static final RequestStatus.Status PENDING

SUCCESSFUL

public static final RequestStatus.Status SUCCESSFUL

UNSUCCESSFUL

public static final RequestStatus.Status UNSUCCESSFUL

SUCCESSFUL_WARNING

public static final RequestStatus.Status SUCCESSFUL_WARNING

NO_REASON_SPECIFIED

public static final RequestStatus.Reason NO_REASON_SPECIFIED

PENDING_ASYNCHRONOUS

public static final RequestStatus.Reason PENDING_ASYNCHRONOUS

PENDING_RECON_IN_PROGRESS

public static final RequestStatus.Reason PENDING_RECON_IN_PROGRESS

RECON_IN_PROGRESS

public static final RequestStatus.Reason RECON_IN_PROGRESS

PENDING_RESOURCE_FAILED

public static final RequestStatus.Reason PENDING_RESOURCE_FAILED

INSECURE_CONNECTION

public static final RequestStatus.Reason INSECURE_CONNECTION

PROCESSING_ERROR

public static final RequestStatus.Reason PROCESSING_ERROR

COMMUNICATION_ERROR

public static final RequestStatus.Reason COMMUNICATION_ERROR

CONFIGURATION_ERROR

public static final RequestStatus.Reason CONFIGURATION_ERROR

AUTHENTICATION_ERROR

public static final RequestStatus.Reason AUTHENTICATION_ERROR

NAME_INVALID_ERROR

public static final RequestStatus.Reason NAME_INVALID_ERROR

OPERATION_NOT_SUPPORTED_ERROR

public static final RequestStatus.Reason OPERATION_NOT_SUPPORTED_ERROR

NO_SUCH_ATTRIBUTE_ERROR

public static final RequestStatus.Reason NO_SUCH_ATTRIBUTE_ERROR

NAME_NOT_FOUND_ERROR

public static final RequestStatus.Reason NAME_NOT_FOUND_ERROR

INVALID_SEARCH_FILTER_ERROR

public static final RequestStatus.Reason INVALID_SEARCH_FILTER_ERROR

SIZE_LIMIT_EXCEEDED_ERROR

public static final RequestStatus.Reason SIZE_LIMIT_EXCEEDED_ERROR

TIME_LIMIT_EXCEEDED_ERROR

public static final RequestStatus.Reason TIME_LIMIT_EXCEEDED_ERROR

NAME_ALREADY_BOUND_ERROR

public static final RequestStatus.Reason NAME_ALREADY_BOUND_ERROR

INVALID_SEARCH_CONTROLS_ERROR

public static final RequestStatus.Reason INVALID_SEARCH_CONTROLS_ERROR

USER_ABORTED

public static final RequestStatus.Reason USER_ABORTED
Constructor Detail

RequestStatus

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

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

RequestStatus

public RequestStatus(RequestStatus.Status 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(RequestStatus.Status status,
                     RequestStatus.Reason 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 Some of the 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(RequestStatus.Status status,
                     RequestStatus.Reason 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 Some of the 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 (shallow) copy.

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

getStatus

public RequestStatus.Status 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(RequestStatus.Status status)
Sets the status of the response from the remote resource

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

getReason

public RequestStatus.Reason 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(RequestStatus.Reason reason)
Sets the reason for an unsuccessful response from the remote resource.

Parameters:
reason - the reason for an unsuccessful response
See Also:
RequestStatus.Reason

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<java.lang.String> args)
The arguments for the reason message are used for internationalization

Parameters:
args - A Collection of String's

setReasonMessageArgs

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

Parameters:
args - An array of Objects, which will be converted to Strings by calling the toString method / null to clear args list

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<java.lang.String> getReasonMessageArgs()
The arguments for the reason message are used for internationalization

Returns:
args A collection of Strings (never null)

set

public void set(RequestStatus newStatus)
set this to specified value

Parameters:
newStatus - value to set this to

pending

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

Returns:
True if the status is pending

warning

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

Returns:
True if the status was warning

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, warning or pending

Returns:
True if the status was successful, warning or pending

getNotChangedAttributes

public AttributeValues getNotChangedAttributes()
Gets the 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 non-null list of the attributes not added / updated (may be empty)

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 5.1
© Copyright International Business Machines Corporation 2007, 2009. All rightsreserved. US Government Users Restricited RightsUse, duplication or disclosure restricted by GSA ADP ScheduleContract with IBM Corp.