Class ResourceRequest

java.lang.Object
oracle.security.am.asdk.ResourceRequest
All Implemented Interfaces:
Cloneable

public final class ResourceRequest extends Object implements Cloneable

Represents a resource request for which access operations are to be performed. ResourceRequest objects are used by the AuthenticationScheme constructors to retrieve information about the resource's authentication scheme and by the isAuthorized() method of the UserSession class to determine if a user is authorized to access the resource.

  • Constructor Details

    • ResourceRequest

      public ResourceRequest<wbr>(String resType, String resource, String operation) throws AccessException
      Constructs a ResourceRequest object with specified resource type, name and operation.
      Parameters:
      resType - Resource type, for example http, ejb etc. If null, defaults to http
      resource - Resource name
      operation - operation for the resource object, for example GET, POST , PUT, HEAD, DELETE, TRACE, OPTIONS, CONNECT, OTHER.
      Throws:
      AccessException - In case of errors during object creation or if resource or operation string is null
    • ResourceRequest

      public ResourceRequest<wbr>(AccessClient aClient, String resType, String resource, String operation) throws AccessException
      Constructs a ResourceRequest object with specified AccessClient object, resource type, name and operation.
      Parameters:
      aClient - AccessClient object to be used for perfoming operations.
      resType - Resource type, for example http, ejb etc. If null, defaults to http
      resource - Resource name
      operation - operation for the resource object, for example GET, POST , PUT, HEAD, DELETE, TRACE, OPTIONS, CONNECT, OTHER.
      Throws:
      AccessException - In case of errors during object creation or if resource or operation string is null
    • ResourceRequest

      public ResourceRequest<wbr>(String resType, String resource, String operation, Hashtable parameters) throws AccessException
      Constructs a ResourceRequest object with specified resource type, name, operation and parameters name/value pair hashtable.
      Parameters:
      resType - Resource type, for example http, ejb etc., If null defaults to http
      resource - Resource name
      operation - Operation for the resource object. For example GET, POST , PUT, HEAD, DELETE, TRACE, OPTIONS, CONNECT, OTHER.
      parameters - (Optional) Hashtable of query string parameters in the form of name/value pairs of String type. These parameters will be used by the OAM server in order to determine the policy that protects this resource. This argument is optional if the policies configured does not rely on the query string parameters.
      Throws:
      AccessException - In case of errors during object creation or if resource or operation string is null
    • ResourceRequest

      public ResourceRequest<wbr>(AccessClient aClient, String resType, String resource, String operation, Hashtable parameters) throws AccessException
      Constructs a ResourceRequest object with specified AccessClient object, resource type, name, operation and parameters name/value pair hashtable.
      Parameters:
      aClient - AccessClient object to be used for perfoming operations.
      resType - Resource type, for example http, ejb etc., If null defaults to http
      resource - Resource name
      operation - Operation for the resource object. For example GET, POST , PUT, HEAD, DELETE, TRACE, OPTIONS, CONNECT, OTHER.
      parameters - (Optional) Hashtable of query string parameters in the form of name/value pairs of String type. These parameters will be used by the OAM server in order to determine the policy that protects this resource. This argument is optional if the policies configured does not rely on the query string parameters.
      Throws:
      AccessException - In case of errors during object creation or if resource or operation string is null
    • ResourceRequest

      public ResourceRequest<wbr>(oracle.security.am.asdk.LocalAccessClient aClient, String resType, String resource, String operation, Hashtable parameters) throws AccessException
      Constructs a ResourceRequest object with specified LocalAccessClient object, resource type, name, operation and parameters name/value pair hashtable.
      Parameters:
      aClient - LocalAccessClient object to be used for perfoming operations.
      resType - Resource type, for example http, ejb etc., If null defaults to http
      resource - Resource name
      operation - Operation for the resource object. For example GET, POST , PUT, HEAD, DELETE, TRACE, OPTIONS, CONNECT, OTHER.
      parameters - (Optional) Hashtable of query string parameters in the form of name/value pairs of String type. These parameters will be used by the OAM server in order to determine the policy that protects this resource. This argument is optional if the policies configured does not rely on the query string parameters.
      Throws:
      AccessException - In case of errors during object creation or if resource or operation string is null
  • Method Details

    • isProtected

      public boolean isProtected() throws AccessException
      Checks whether resource is protected.
      Returns:
      Boolean true if resource is protected.
      Throws:
      AccessException - In case server could not determine the protected status of the resource or some other error
    • getSchemeId

      public String getSchemeId() throws AccessException
      Returns authentication scheme id used to protect the resource
      Returns:
      Authentication scheme id used to protect the resource
      Throws:
      AccessException - In case if resource request object is not initialized.
    • getResourceType

      public String getResourceType()
      Returns resource type
      Returns:
      String representing resource type
    • getResource

      public String getResource()
      Returns resource
      Returns:
      String representing the resource
    • getOperation

      public String getOperation()
      Returns method configured for resource request object for example HTTP methods like GET, POST.
      Returns:
      Method configured for resource request object
    • getParameters

      public Hashtable getParameters()
      Returns query parameters in the form of name/value pairs of String type.
      Returns:
      Hashtable of query string parameters in the form of name/value pairs of String type. It returns null value if query parameters were not passed while constructing ResourceRequest object.
    • getAuthorizationParameters

      public Hashtable getAuthorizationParameters() throws AccessException
      Returns parameters required for authorization of the resource. Parameters will be returned only if a authorization request fails with ERR_NEED_MORE_DATA error. This error indicates that additional information is required for authorization.
      Returns:
      Hashtable containing parameters of String type required for authorization of the resource. It returns null if called before performing any authorization or if authorization for this resource has never failed with ERR_NEED_MORE_DATA error.
      Throws:
      AccessException - In case if it resource request object is not initialized.
    • getNumberOfAuthorizationParameters

      public int getNumberOfAuthorizationParameters() throws AccessException
      Returns count of parameters required for authorization of the resource request object.
      Returns:
      Count of parameters required for authorization of the resource. It returns 0 if there are no authorization parameters.
      Throws:
      AccessException - In case if resource request object is not initialized.
    • clone

      public Object clone() throws CloneNotSupportedException
      Used to clone ResourceRequest Objects.
      Throws:
      CloneNotSupportedException