at.ac.tuwien.infosys.sm4all.copal.api.security
Class Authorizations

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.util.BaseObservable<RegistryObservable.RegistrationState,V,RegistryObservable.RegistryObserver<V>>
      extended by at.ac.tuwien.infosys.sm4all.copal.api.util.BaseRegistry<java.lang.String,Authorization>
          extended by at.ac.tuwien.infosys.sm4all.copal.api.security.Authorizations
All Implemented Interfaces:
Observable<RegistryObservable.RegistrationState,Authorization,RegistryObservable.RegistryObserver<Authorization>>, Registry<java.lang.String,Authorization>, RegistryObservable<Authorization>

public class Authorizations
extends BaseRegistry<java.lang.String,Authorization>

Implementation of a Registry for Authorizations.

Author:
sanjin

Nested Class Summary
 
Nested classes/interfaces inherited from interface at.ac.tuwien.infosys.sm4all.copal.api.util.RegistryObservable
RegistryObservable.RegistrationState, RegistryObservable.RegistryObserver<T>
 
Constructor Summary
Authorizations()
          Create instance of empty Authorization Registry.
Authorizations(Authorization... authorizations)
          Create instance of Authorization Registry that has specified Authorizations registered.
 
Method Summary
 Authorization get(java.lang.String method)
          Returns Authorization that has specified name of AuthorizationMethod.
 Authorization[] getAll()
          Returns all currently registered Authorizations.
protected  java.lang.String getKey(Authorization authorization)
          Return the key for specified value.
 boolean isRegistered(java.lang.String method)
          Returns if an Authorization that has specified name of AuthorizationMethod is currently registered.
 void register(Authorization authorization)
          Register specified Authorization.
 void setAll(Authorization... authorizations)
          Register specified Authorizations and remove all previously registered Authorizations.
 void unregister(java.lang.String method)
          Unregister Authorization that has specified name of AuthorizationMethod.
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.util.BaseRegistry
attach, detach, getValues, set, setValues, unregisterAll
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.util.BaseObservable
detachAll, getObservers, notifyAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Authorizations

public Authorizations()
Create instance of empty Authorization Registry.


Authorizations

public Authorizations(Authorization... authorizations)
Create instance of Authorization Registry that has specified Authorizations registered.

Parameters:
authorizations - the Authorizations.
Throws:
java.lang.NullPointerException - if specified array of Authorizations or any Authorization in the array is null.
Method Detail

register

public void register(Authorization authorization)
Register specified Authorization.

Specified by:
register in interface Registry<java.lang.String,Authorization>
Overrides:
register in class BaseRegistry<java.lang.String,Authorization>
Parameters:
authorization - the Authorization.
Throws:
java.lang.NullPointerException - if specified Authorization is null.
See Also:
BaseRegistry.set(Object...)

unregister

public void unregister(java.lang.String method)
Unregister Authorization that has specified name of AuthorizationMethod.

Specified by:
unregister in interface Registry<java.lang.String,Authorization>
Overrides:
unregister in class BaseRegistry<java.lang.String,Authorization>
Parameters:
method - the name of AuthorizationMethod.

isRegistered

public boolean isRegistered(java.lang.String method)
Returns if an Authorization that has specified name of AuthorizationMethod is currently registered.

Specified by:
isRegistered in interface Registry<java.lang.String,Authorization>
Overrides:
isRegistered in class BaseRegistry<java.lang.String,Authorization>
Parameters:
method - the name of AuthorizationMethod.
Returns:
if an Authorization that has specified name of AuthorizationMethod is currently registered.

get

public Authorization get(java.lang.String method)
Returns Authorization that has specified name of AuthorizationMethod.

Specified by:
get in interface Registry<java.lang.String,Authorization>
Overrides:
get in class BaseRegistry<java.lang.String,Authorization>
Parameters:
method - the name of AuthorizationMethod.
Returns:
the Authorization or null if there is no such Authorization registered.

getAll

public Authorization[] getAll()
Returns all currently registered Authorizations.

Returns:
all currently registered Authorizations.

setAll

public void setAll(Authorization... authorizations)
Register specified Authorizations and remove all previously registered Authorizations.

Parameters:
authorizations - the Authorizations.
Throws:
java.lang.NullPointerException - if specified array of Authorizations or any Authorization in the array is null.

getKey

protected java.lang.String getKey(Authorization authorization)
Description copied from class: BaseRegistry
Return the key for specified value.

Specified by:
getKey in class BaseRegistry<java.lang.String,Authorization>
Parameters:
authorization - the value.
Returns:
the key.


Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.