Package de.fraunhofer.iese.mydata.pep
Class DefaultPolicyEnforcementPoint
- java.lang.Object
-
- de.fraunhofer.iese.mydata.pep.DefaultPolicyEnforcementPoint
-
- All Implemented Interfaces:
IMyDataComponent
,IPolicyEnforcementPoint
- Direct Known Subclasses:
PolicyEnforcementPoint
public class DefaultPolicyEnforcementPoint extends Object implements IPolicyEnforcementPoint
This class should be used with Spring auto registration
-
-
Field Summary
Fields Modifier and Type Field Description protected IMyDataEnvironment
myDataEnvironment
-
Constructor Summary
Constructors Constructor Description DefaultPolicyEnforcementPoint(IMyDataEnvironment myDataEnvironment, DecisionEnforcer decisionEnforcer)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enforce(Event event)
Publish the event and enforce theAuthorizationDecision
toEvent
void
enforceDecision(Event event, AuthorizationDecision authorizationDecision)
Impose theAuthorizationDecision
authorizationDecision onEvent
event.AuthorizationDecision
getDecision(Event event)
HealthStatus
getHealth()
ComponentId
getId()
boolean
initialize()
Default initializer that establishes the connection to PDP.boolean
reset()
Reset the PDP connection.
-
-
-
Field Detail
-
myDataEnvironment
protected final IMyDataEnvironment myDataEnvironment
-
-
Constructor Detail
-
DefaultPolicyEnforcementPoint
public DefaultPolicyEnforcementPoint(IMyDataEnvironment myDataEnvironment, DecisionEnforcer decisionEnforcer)
Constructor- Parameters:
myDataEnvironment
- the IMyDataEnvironment the PEP belongs todecisionEnforcer
- concrete implementation of decisionEnforcer
-
-
Method Detail
-
enforce
public void enforce(Event event) throws EvaluationUndecidableException, InhibitException, IOException
Publish the event and enforce theAuthorizationDecision
toEvent
- Specified by:
enforce
in interfaceIPolicyEnforcementPoint
- Parameters:
event
- The event to publish.- Throws:
EvaluationUndecidableException
- if PDP can't decide.InhibitException
- if event is not allowedIOException
- if connection to PDP is not established
-
enforceDecision
public void enforceDecision(Event event, AuthorizationDecision authorizationDecision) throws InhibitException
Impose theAuthorizationDecision
authorizationDecision onEvent
event.- Specified by:
enforceDecision
in interfaceIPolicyEnforcementPoint
- Parameters:
event
- on which authorizationDecision to be imposeauthorizationDecision
- the decision to enforce on event- Throws:
InhibitException
- if event is not allowed
-
getDecision
public AuthorizationDecision getDecision(Event event) throws EvaluationUndecidableException, IOException
- Specified by:
getDecision
in interfaceIPolicyEnforcementPoint
- Throws:
EvaluationUndecidableException
IOException
-
getId
public ComponentId getId()
- Specified by:
getId
in interfaceIMyDataComponent
- Returns:
- The id of the component.
-
initialize
public boolean initialize() throws IOException, NoSuchEntityException
Default initializer that establishes the connection to PDP.- Specified by:
initialize
in interfaceIPolicyEnforcementPoint
- Throws:
NoSuchEntityException
IOException
-
reset
public boolean reset() throws IOException, NoSuchEntityException
Reset the PDP connection.- Specified by:
reset
in interfaceIMyDataComponent
- Returns:
- true, if successful.
- Throws:
NoSuchEntityException
IOException
-
getHealth
public HealthStatus getHealth()
- Specified by:
getHealth
in interfaceIMyDataComponent
-
-