org.openpermis.builder
Class AuthorizationServiceBuilder

java.lang.Object
  extended by org.openpermis.builder.AuthorizationServiceBuilder

public class AuthorizationServiceBuilder
extends Object

Builds an authorization service.

The builder chooses sensible defaults for parts that an application does not explicitly configure.

Since:
0.1.0

Field Summary
private  Clock clock
           
private  List<VetoableAccessDecisionListener> listeners
           
private  PartFactory partFactory
           
private  PolicyDecisionPoint policyDecisionPoint
           
private  SubjectRepository subjectRepository
           
 
Constructor Summary
AuthorizationServiceBuilder()
          Creates a new authorization service builder.
 
Method Summary
 AuthorizationService build()
          Returns an authorization service that matches the builder's configuration.
 AuthorizationServiceBuilder forPolicyDecisionPoint(PolicyDecisionPoint accessPolicyDecisionPoint)
          Configures the policy that the created PDP will use for access decisions.
private  Clock getClock()
           
private  PartFactory getPartFactory()
           
private  PolicyDecisionPoint getPolicyDecisionPoint()
           
private  SubjectRepository getSubjectRepository()
           
 AuthorizationServiceBuilder withClock(Clock clockService)
          Configures the clock service that the created PDP will use to get time values.
 AuthorizationServiceBuilder withListener(VetoableAccessDecisionListener listener)
          Adds a vetoable access decision listener that will be used by the created PDP.
 AuthorizationServiceBuilder withSubjectsFrom(SubjectRepository repository)
          Configures the subject repository from which the created PDP will retrieve subjects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

partFactory

private PartFactory partFactory
Since:
0.1.0

policyDecisionPoint

private PolicyDecisionPoint policyDecisionPoint
Since:
0.1.0

subjectRepository

private SubjectRepository subjectRepository
Since:
0.1.0

clock

private Clock clock
Since:
0.1.0

listeners

private final List<VetoableAccessDecisionListener> listeners
Since:
0.3.0
Constructor Detail

AuthorizationServiceBuilder

public AuthorizationServiceBuilder()
Creates a new authorization service builder.

Since:
0.3.0
Method Detail

withListener

public AuthorizationServiceBuilder withListener(VetoableAccessDecisionListener listener)
Adds a vetoable access decision listener that will be used by the created PDP.

Parameters:
listener - the listener to add.
Returns:
this builder.
Since:
0.3.0

withSubjectsFrom

public AuthorizationServiceBuilder withSubjectsFrom(SubjectRepository repository)
Configures the subject repository from which the created PDP will retrieve subjects.

Parameters:
repository - a SubjectRepository.
Returns:
this builder.
Since:
0.1.0

withClock

public AuthorizationServiceBuilder withClock(Clock clockService)
Configures the clock service that the created PDP will use to get time values.

Parameters:
clockService - a Clock service.
Since:
0.1.0

forPolicyDecisionPoint

public AuthorizationServiceBuilder forPolicyDecisionPoint(PolicyDecisionPoint accessPolicyDecisionPoint)
Configures the policy that the created PDP will use for access decisions.

Parameters:
accessPolicyDecisionPoint - the PolicyDecisionPoint to use for access decisions.
Returns:
this builder.
Since:
0.3.0

build

public AuthorizationService build()
Returns an authorization service that matches the builder's configuration.

Returns:
a new AuthorizationService.
Since:
0.1.0

getPolicyDecisionPoint

private PolicyDecisionPoint getPolicyDecisionPoint()
Since:
0.1.0
0.3.0 Added support for VetoableAccessDecisionListener.

getPartFactory

private PartFactory getPartFactory()
Since:
0.1.0

getSubjectRepository

private SubjectRepository getSubjectRepository()
Since:
0.1.0

getClock

private Clock getClock()
Since:
0.1.0


PERMIS Role Based Access Control 0.3.0 (Build 14)
2009/05/08 09:06:22
Copyright (c) 2002-2007 Ergon Informatik AG