public class DefaultPolicyEnforcementPoint extends Object implements de.fraunhofer.iese.ind2uce.api.component.interfaces.IPolicyEnforcementPoint
| Modifier and Type | Field and Description |
|---|---|
protected de.fraunhofer.iese.ind2uce.connectors.OAuthCredentials |
oauthClientCredentials |
protected URI |
pmpUrl |
| Constructor and Description |
|---|
DefaultPolicyEnforcementPoint(URI pmpUrl,
DecisionEnforcer decisionEnforcer,
de.fraunhofer.iese.ind2uce.connectors.OAuthCredentials oauthClientCredentials)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
assurePDP()
Make sure the PDP is available
|
void |
enforce(de.fraunhofer.iese.ind2uce.api.policy.Event event)
Publish the event and enforce the
AuthorizationDecision to
Event |
void |
enforceDecision(de.fraunhofer.iese.ind2uce.api.policy.Event event,
de.fraunhofer.iese.ind2uce.api.policy.AuthorizationDecision authorizationDecision)
Impose the
AuthorizationDecision authorizationDecision on
Event event. |
de.fraunhofer.iese.ind2uce.api.policy.AuthorizationDecision |
getDecision(de.fraunhofer.iese.ind2uce.api.policy.Event event)
Fetch the
AuthorizationDecision from PDP against the Event. |
String |
getHealth() |
de.fraunhofer.iese.ind2uce.api.component.identifier.ComponentId |
getId() |
boolean |
initialize(String... strings)
Default initializer that establishes the connection to PDP.
|
de.fraunhofer.iese.ind2uce.api.component.interfaces.IPolicyDecisionPoint |
initPpdConnection()
Initialize the PDP connection
|
boolean |
reset()
Reset the PDP connection.
|
protected final de.fraunhofer.iese.ind2uce.connectors.OAuthCredentials oauthClientCredentials
protected URI pmpUrl
public DefaultPolicyEnforcementPoint(URI pmpUrl, DecisionEnforcer decisionEnforcer, de.fraunhofer.iese.ind2uce.connectors.OAuthCredentials oauthClientCredentials)
pmpUrl - pmp urldecisionEnforcer - concrete implementation of decisionEnforceroauthClientCredentials - OAuth Credentialspublic boolean assurePDP()
throws IOException
IOException - If connection could not be established.public void enforce(de.fraunhofer.iese.ind2uce.api.policy.Event event)
throws de.fraunhofer.iese.ind2uce.api.component.exception.EvaluationUndecidableException,
de.fraunhofer.iese.ind2uce.api.component.exception.InhibitException,
IOException
AuthorizationDecision to
Eventenforce in interface de.fraunhofer.iese.ind2uce.api.component.interfaces.IPolicyEnforcementPointevent - The event to publish.de.fraunhofer.iese.ind2uce.api.component.exception.EvaluationUndecidableException - if PDP can't decide.de.fraunhofer.iese.ind2uce.api.component.exception.InhibitException - if event is not allowedIOException - if connection to PDP is not establishedpublic void enforceDecision(de.fraunhofer.iese.ind2uce.api.policy.Event event,
de.fraunhofer.iese.ind2uce.api.policy.AuthorizationDecision authorizationDecision)
throws de.fraunhofer.iese.ind2uce.api.component.exception.InhibitException
AuthorizationDecision authorizationDecision on
Event event.enforceDecision in interface de.fraunhofer.iese.ind2uce.api.component.interfaces.IPolicyEnforcementPointevent - on which authorizationDecision to be imposeauthorizationDecision - the decision to enforce on eventde.fraunhofer.iese.ind2uce.api.component.exception.InhibitException - if event is not allowedpublic de.fraunhofer.iese.ind2uce.api.policy.AuthorizationDecision getDecision(de.fraunhofer.iese.ind2uce.api.policy.Event event)
throws de.fraunhofer.iese.ind2uce.api.component.exception.EvaluationUndecidableException,
IOException
AuthorizationDecision from PDP against the Event.getDecision in interface de.fraunhofer.iese.ind2uce.api.component.interfaces.IPolicyEnforcementPointevent - Event to send.de.fraunhofer.iese.ind2uce.api.component.exception.EvaluationUndecidableException - if Event is not allowed.IOException - if connection to pdp could not be established.public de.fraunhofer.iese.ind2uce.api.component.identifier.ComponentId getId()
throws IOException
getId in interface de.fraunhofer.iese.ind2uce.api.component.interfaces.IComponentIOException - not used herepublic boolean initialize(String... strings) throws IOException
initialize in interface de.fraunhofer.iese.ind2uce.api.component.interfaces.IComponentstrings - not needed here.IOException - If no connection could be established.public de.fraunhofer.iese.ind2uce.api.component.interfaces.IPolicyDecisionPoint initPpdConnection()
throws IOException
IOException - If connection could not be established.public boolean reset()
throws IOException
reset in interface de.fraunhofer.iese.ind2uce.api.component.interfaces.IComponentIOException - if connection could not be reset.public String getHealth() throws IOException
getHealth in interface de.fraunhofer.iese.ind2uce.api.component.interfaces.IComponentIOExceptionCopyright © 2018. All rights reserved.