org.openliberty.openaz.pep
Class PepResponse

java.lang.Object
  extended by org.openliberty.openaz.pep.PepResponse

public class PepResponse
extends java.lang.Object

PepResponse is the main entry point for processing the results of a PepRequest.decide() call.
It enables processing one result at a time for an AzResponseContext, which may contain multiple decisions from one of the

or a It also provides a wrapper around the AzResponseContext which enables access to the underlying low level AzApi funtions.

Please refer to PepRequestFactory for code example containing processing of a PepResponse.


Method Summary
 boolean allowed()
          Returns the decision associated with the current result.
 java.lang.Object getAction()
          Return the action object associated with the current result.
 AzResponseContext getAzResponseContext()
          The handle to the actual AzResponseContext.
 java.util.Map<java.lang.String,Obligation> getObligations()
          Return the set of Obligations associated with the current result indexed by ObligationId.
 PepRequest getPepRequest()
          Return the PepRequest object associated with this PepResponse.
 java.lang.Object getResource()
          Return the resource object associated with the current result.
 boolean next()
          For bulk requests and query requests, move the iterator to the next result.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

next

public boolean next()
For bulk requests and query requests, move the iterator to the next result. For bulk requests and query requests, the iterator initially points prior to the first result. For single newPepRequest, the iterator always points to the first and only result and next() always returns false.

Returns:
true if there is another result for bulk requests and query requests, false otherwise.

allowed

public boolean allowed()
                throws PepException
Returns the decision associated with the current result.

Returns:
true if the user was granted access to the resource, otherwise false
Throws:
PepException - if the Behavior configured in the PepResponseFactory indicates that for the response should be thrown

getAction

public java.lang.Object getAction()
                           throws PepException
Return the action object associated with the current result. The action object is the same object that was used to create the PepRequest and may be used to correlate the PepResponse results with the action-resource pairs that were used to create the PepRequest.

Returns:
an object that was used as an action in the PepRequest
Throws:
PepException

getResource

public java.lang.Object getResource()
                             throws PepException
Return the resource object associated with the current result. The resource object is the same object that was used to create the PepRequest and may be used to correlate the PepResponse results with the action-resource pairs that were used to create the PepRequest.

Returns:
an object that was used as a resource in the PepRequest
Throws:
PepException

getObligations

public java.util.Map<java.lang.String,Obligation> getObligations()
                                                          throws PepException
Return the set of Obligations associated with the current result indexed by ObligationId.

Returns:
Throws:
PepException

getAzResponseContext

public AzResponseContext getAzResponseContext()
The handle to the actual AzResponseContext.

Returns:

getPepRequest

public PepRequest getPepRequest()
Return the PepRequest object associated with this PepResponse.

Returns:
the PepRequest object that was issued in association with this PepResponse.