org.n52.security.decision
Class PDPResponse

java.lang.Object
  extended by org.n52.security.decision.PDPResponse
All Implemented Interfaces:
java.io.Serializable

public class PDPResponse
extends java.lang.Object
implements java.io.Serializable

This class represents a request from a AuthzInterceptor to a PDPProxy. PDPResponses are collected in a PDPRequestCollection. A Request can hold several target.

Version:
$Revision: 1748 $
Author:
Bastian Schaeffer, Marko Reiprecht
See Also:
Serialized Form

Field Summary
static int DECISION_DENY
          Says that a request is denied.
static int DECISION_PERMIT
          Says that a request is permitted.
static int DECISION_UNDEFINED
          Says that a request is undefined, so no decision is maked.
protected  int m_decision
          Decision state.
protected  java.util.List m_obligations
          List of Obligation instances.
protected  PDPRequest m_request
          Request that belongs to this response.
 
Constructor Summary
PDPResponse(int decision, PDPRequest request)
           
PDPResponse(int decision, PDPRequest request, java.util.Collection obligations)
           
 
Method Summary
protected  void checkDecision(int decision)
          checks decision value range.
 boolean equals(java.lang.Object o)
          Method equals.
 int getDecision()
           
 java.util.Collection getObligations()
          Method getObligations returns the obligations of this PDPResponse object.
 PDPRequest getRequest()
           
 int hashCode()
          Method hashCode.
 boolean hasObligations()
          Says if this response has obligations.
 boolean isDeny()
          A short cut for DECISION_DENY == getDecision().
 boolean isPermit()
          A short cut for DECISION_PERMIT == getDecision().
 boolean isUndefined()
          A short cut for DECISION_UNDEFINED == getDecision().
 java.lang.String toString()
          Method toString.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DECISION_DENY

public static final int DECISION_DENY
Says that a request is denied.

See Also:
Constant Field Values

DECISION_PERMIT

public static final int DECISION_PERMIT
Says that a request is permitted.

See Also:
Constant Field Values

DECISION_UNDEFINED

public static final int DECISION_UNDEFINED
Says that a request is undefined, so no decision is maked.

See Also:
Constant Field Values

m_decision

protected int m_decision
Decision state.


m_request

protected PDPRequest m_request
Request that belongs to this response.


m_obligations

protected java.util.List m_obligations
List of Obligation instances.

Constructor Detail

PDPResponse

public PDPResponse(int decision,
                   PDPRequest request)
            throws java.lang.IllegalArgumentException,
                   java.lang.NullPointerException
Parameters:
decision - the decision of the coresponding request.
request - the request to wich this is a response.
Throws:
java.lang.IllegalArgumentException - if decision is out of bounds
java.lang.NullPointerException - if request is null

PDPResponse

public PDPResponse(int decision,
                   PDPRequest request,
                   java.util.Collection obligations)
            throws java.lang.IllegalArgumentException,
                   java.lang.NullPointerException
Parameters:
decision - by the PEP
request - the original request
obligations - by the PEP
Throws:
java.lang.IllegalArgumentException - if descision out of range
java.lang.NullPointerException - if request or obligation are null
Method Detail

checkDecision

protected void checkDecision(int decision)
                      throws java.lang.IllegalArgumentException
checks decision value range.

Parameters:
decision - a decision
Throws:
java.lang.IllegalArgumentException - if decision out of range
See Also:
DECISION_PERMIT, DECISION_DENY, DECISION_UNDEFINED

getDecision

public int getDecision()
Returns:
Returns the decision.

getRequest

public PDPRequest getRequest()
Returns:
Returns the request.

equals

public boolean equals(java.lang.Object o)
Method equals.

Overrides:
equals in class java.lang.Object
Parameters:
o - the o.
Returns:
boolean.

hashCode

public int hashCode()
Method hashCode.

Overrides:
hashCode in class java.lang.Object
Returns:
int.

toString

public java.lang.String toString()
Method toString.

Overrides:
toString in class java.lang.Object
Returns:
String.

getObligations

public java.util.Collection getObligations()
Method getObligations returns the obligations of this PDPResponse object.

Returns:
the obligations (type Collection) of this PDPResponse object.

hasObligations

public boolean hasObligations()
Says if this response has obligations.

Returns:
boolean

isPermit

public boolean isPermit()
A short cut for DECISION_PERMIT == getDecision(). The method is provided for faster access.

Returns:
true if DECISION_PERMIT == getDecision().

isDeny

public boolean isDeny()
A short cut for DECISION_DENY == getDecision(). The method is provided for faster access.

Returns:
true if DECISION_DENY == getDecision().

isUndefined

public boolean isUndefined()
A short cut for DECISION_UNDEFINED == getDecision(). The method is provided for faster access.

Returns:
true if DECISION_UNDEFINED == getDecision().


Copyright © 2004-2009 52north.org. All Rights Reserved.