issrg.pba
Class PERMISResponse

java.lang.Object
  extended by issrg.pba.PERMISResponse
All Implemented Interfaces:
Response

public class PERMISResponse
extends java.lang.Object
implements Response

This class implements the Response interface, providing a way to create objects that provide the Response interface. 3 different constructors and one manipulation function are provided to manipulate/create the objects.

Author:
gansen

Constructor Summary
PERMISResponse()
          Creates a new default instance of PERMISResponse.
PERMISResponse(boolean decision)
          Create a new instance of PERMISResponse.
PERMISResponse(boolean decision, Obligations obligations)
          Create a new instance of PERMISResponse according the parameters
 
Method Summary
 Obligations getObligations()
          Retrieve the OBLIGATIONS object that is contained in the instance.
 boolean isAuthorised()
          Retrieve the authorisation decision value.
 void setDecision(boolean bDecision)
          Set the authorisation decision to the specified value.
 void setObligations(Obligations obligations)
          Set the associated OBLIGATION object to the specified object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PERMISResponse

public PERMISResponse()
Creates a new default instance of PERMISResponse. The default instance contains a negative authorisation decision, and an empty set of obligations.


PERMISResponse

public PERMISResponse(boolean decision)
Create a new instance of PERMISResponse. The instance contains a positive authorisation decision, and an empty set of obligations.


PERMISResponse

public PERMISResponse(boolean decision,
                      Obligations obligations)
Create a new instance of PERMISResponse according the parameters

Parameters:
decision - specifies what authorisation decision is in the response; true refers to a positive authorisation decision. otherwise a negative authorisation decision.
obligations - is the associated set of Obligations that must be enforced along with the decision; can be null, if no Obligations should be enforced.
Method Detail

isAuthorised

public boolean isAuthorised()
Retrieve the authorisation decision value.

Specified by:
isAuthorised in interface Response
Returns:
true, if access should be granted (subject to enforcing the associated set of Obligations); false otherwise

setDecision

public void setDecision(boolean bDecision)
Set the authorisation decision to the specified value.

Parameters:
bDecision - is the value that the authorisation decision to be set to. A true value refers to a positive authorisation decision. otherwise a negative authorisation decision.

getObligations

public Obligations getObligations()
Retrieve the OBLIGATIONS object that is contained in the instance.

Specified by:
getObligations in interface Response
Returns:
an instance to the OBLIGATIONS object. This instance can be null when there is no OBLIGATIONS object associated with the authorisation decision.

setObligations

public void setObligations(Obligations obligations)
Set the associated OBLIGATION object to the specified object.

Parameters:
obligations - This is the object that is to be associated with the authorisation decision, which contains the information about the obligations to be fulfilled with the enforcement of the authorisation decision.