org.openpermis.examples.simple
Class AuthorizedLetterboxService

java.lang.Object
  extended by org.openpermis.examples.simple.AuthorizedLetterboxService
All Implemented Interfaces:
LetterboxService

public class AuthorizedLetterboxService
extends Object
implements LetterboxService

An implementation of the letterbox service that controls access with the help of a PERMIS authorization service. It serves as a policy enforcement point for the HelloWorld application.

Since:
0.1.0

Field Summary
private  org.openpermis.AuthorizationService authorizationService
          The injected authorization service.
private  LetterboxService delegate
          The actual service implementation to which we forward authorized requests.
protected static URI LETTERBOX_URI
           
 
Constructor Summary
AuthorizedLetterboxService(org.openpermis.AuthorizationService authorizationService, LetterboxService delegate)
          Creates an authorized letterbox service that uses the specified authorization service for making access decisions.
 
Method Summary
 List<String> collectLetters(String principal)
          Collect and discharge all letters contained in this letterbox.
 void insertLetter(String principal, String letter)
          Inserts a letter into this letterbox.
private  void isAuthorized(String principal, String action)
          Checks if principal is allowed to execute action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LETTERBOX_URI

protected static final URI LETTERBOX_URI
Since:
0.1.0

authorizationService

private final org.openpermis.AuthorizationService authorizationService
The injected authorization service.


delegate

private final LetterboxService delegate
The actual service implementation to which we forward authorized requests.

Constructor Detail

AuthorizedLetterboxService

public AuthorizedLetterboxService(org.openpermis.AuthorizationService authorizationService,
                                  LetterboxService delegate)
Creates an authorized letterbox service that uses the specified authorization service for making access decisions.

Parameters:
authorizationService - a AuthorizationService.
delegate - the real service implementation to which authorized requests are forwarded.
Since:
0.1.0
Method Detail

isAuthorized

private void isAuthorized(String principal,
                          String action)
                   throws LetterboxException
Checks if principal is allowed to execute action.

Parameters:
principal - the principal which want to execute the action.
action - the action to execute.
Throws:
LetterboxException - indicates a negative authorization decision.
Since:
0.4.0

collectLetters

public List<String> collectLetters(String principal)
                            throws LetterboxException
Description copied from interface: LetterboxService
Collect and discharge all letters contained in this letterbox.

Specified by:
collectLetters in interface LetterboxService
Parameters:
principal - the principal executing this method.
Throws:
LetterboxException
Since:
0.4.0

insertLetter

public void insertLetter(String principal,
                         String letter)
                  throws LetterboxException
Description copied from interface: LetterboxService
Inserts a letter into this letterbox.

Specified by:
insertLetter in interface LetterboxService
Parameters:
principal - the principal executing this method.
letter - a letter to insert.
Throws:
LetterboxException
Since:
0.4.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:48
Copyright (c) 2002-2007 Ergon Informatik AG