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
    • 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