Package de.fraunhofer.iese.mydata.pep
Class DefaultPolicyEnforcementPoint
- java.lang.Object
-
- de.fraunhofer.iese.mydata.pep.DefaultPolicyEnforcementPoint
-
- All Implemented Interfaces:
de.fraunhofer.iese.mydata.component.interfaces.IMyDataComponent
,de.fraunhofer.iese.mydata.component.interfaces.IPolicyEnforcementPoint
- Direct Known Subclasses:
PolicyEnforcementPoint
public class DefaultPolicyEnforcementPoint extends Object implements de.fraunhofer.iese.mydata.component.interfaces.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(de.fraunhofer.iese.mydata.policy.event.Event event)
Publish the event and enforce theAuthorizationDecision
toEvent
void
enforceDecision(de.fraunhofer.iese.mydata.policy.event.Event event, de.fraunhofer.iese.mydata.policy.decision.AuthorizationDecision authorizationDecision)
Impose theAuthorizationDecision
authorizationDecision onEvent
event.de.fraunhofer.iese.mydata.policy.decision.AuthorizationDecision
getDecision(de.fraunhofer.iese.mydata.policy.event.Event event)
de.fraunhofer.iese.mydata.component.health.HealthStatus
getHealth()
de.fraunhofer.iese.mydata.component.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(de.fraunhofer.iese.mydata.policy.event.Event event) throws de.fraunhofer.iese.mydata.policy.exception.EvaluationUndecidableException, de.fraunhofer.iese.mydata.policy.exception.InhibitException, IOException
Publish the event and enforce theAuthorizationDecision
toEvent
- Specified by:
enforce
in interfacede.fraunhofer.iese.mydata.component.interfaces.IPolicyEnforcementPoint
- Parameters:
event
- The event to publish.- Throws:
de.fraunhofer.iese.mydata.policy.exception.EvaluationUndecidableException
- if PDP can't decide.de.fraunhofer.iese.mydata.policy.exception.InhibitException
- if event is not allowedIOException
- if connection to PDP is not established
-
enforceDecision
public void enforceDecision(de.fraunhofer.iese.mydata.policy.event.Event event, de.fraunhofer.iese.mydata.policy.decision.AuthorizationDecision authorizationDecision) throws de.fraunhofer.iese.mydata.policy.exception.InhibitException
Impose theAuthorizationDecision
authorizationDecision onEvent
event.- Specified by:
enforceDecision
in interfacede.fraunhofer.iese.mydata.component.interfaces.IPolicyEnforcementPoint
- Parameters:
event
- on which authorizationDecision to be imposeauthorizationDecision
- the decision to enforce on event- Throws:
de.fraunhofer.iese.mydata.policy.exception.InhibitException
- if event is not allowed
-
getDecision
public de.fraunhofer.iese.mydata.policy.decision.AuthorizationDecision getDecision(de.fraunhofer.iese.mydata.policy.event.Event event) throws de.fraunhofer.iese.mydata.policy.exception.EvaluationUndecidableException, IOException
- Specified by:
getDecision
in interfacede.fraunhofer.iese.mydata.component.interfaces.IPolicyEnforcementPoint
- Throws:
de.fraunhofer.iese.mydata.policy.exception.EvaluationUndecidableException
IOException
-
getId
public de.fraunhofer.iese.mydata.component.ComponentId getId()
- Specified by:
getId
in interfacede.fraunhofer.iese.mydata.component.interfaces.IMyDataComponent
- Returns:
- The id of the component.
-
initialize
public boolean initialize() throws IOException, de.fraunhofer.iese.mydata.exception.NoSuchEntityException
Default initializer that establishes the connection to PDP.- Specified by:
initialize
in interfacede.fraunhofer.iese.mydata.component.interfaces.IPolicyEnforcementPoint
- Throws:
de.fraunhofer.iese.mydata.exception.NoSuchEntityException
IOException
-
reset
public boolean reset() throws IOException, de.fraunhofer.iese.mydata.exception.NoSuchEntityException
Reset the PDP connection.- Specified by:
reset
in interfacede.fraunhofer.iese.mydata.component.interfaces.IMyDataComponent
- Returns:
- true, if successful.
- Throws:
de.fraunhofer.iese.mydata.exception.NoSuchEntityException
IOException
-
getHealth
public de.fraunhofer.iese.mydata.component.health.HealthStatus getHealth()
- Specified by:
getHealth
in interfacede.fraunhofer.iese.mydata.component.interfaces.IMyDataComponent
-
-