eu.emi.dsr.security.util
Class AttributeSourcesChain

java.lang.Object
  extended by eu.emi.dsr.security.util.AttributeSourcesChain
All Implemented Interfaces:
IAttributeSource

public class AttributeSourcesChain
extends Object
implements IAttributeSource

IAttributeSource implementation that combines the results from a chain of attribute sources using a configurable combining policy:

Author:
schuller, golbi

Nested Class Summary
static interface AttributeSourcesChain.CombiningPolicy
          defines how attributes should be combined
static class AttributeSourcesChain.FirstAccessible
          first accessible: the answer from the first accessible attribute source is used.
static class AttributeSourcesChain.FirstApplicable
          first applicable: only the first not empty map of attributes is used
static class AttributeSourcesChain.Merge
          Merge: attributes with the same key are combined (values are added).
static class AttributeSourcesChain.MergeLastOverrides
          merge_last_overrides: new attributes overwrite existing ones
 
Field Summary
 
Fields inherited from interface eu.emi.dsr.security.IAttributeSource
ATTRIBUTE_ADD_DEFAULT_GROUPS, ATTRIBUTE_GROUP, ATTRIBUTE_ROLE, ATTRIBUTE_SUPPLEMENTARY_GROUPS, ATTRIBUTE_VOS, ROLE_ADMIN, ROLE_ANONYMOUS
 
Constructor Summary
AttributeSourcesChain()
           
 
Method Summary
 String[] getAcceptedVOs()
          This method returns the list of VOs that this attribute source supports.
 SubjectAttributesHolder getAttributes(SecurityTokens tokens, SubjectAttributesHolder unused)
          combines results from all configured attribute sources
 List<IAttributeSource> getChain()
           
 AttributeSourcesChain.CombiningPolicy getCombiningPolicy()
           
 String getName()
          This method should return name of this attribute source, which was passed to the init() method.
 String getStatusDescription()
          Get a user-friendly description of the attribute source's status.
This is used for informing the administrator of any problems with configuration, connection problems, etc.
 void init(String name)
          will initialise all the authorisers in the chain by calling their init() method
 void setCombiningPolicy(String name)
           
 void setOrder(String order)
           
 void setProperties(Properties p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeSourcesChain

public AttributeSourcesChain()
Method Detail

init

public void init(String name)
          throws Exception
will initialise all the authorisers in the chain by calling their init() method

Specified by:
init in interface IAttributeSource
Throws:
Exception

getAttributes

public SubjectAttributesHolder getAttributes(SecurityTokens tokens,
                                             SubjectAttributesHolder unused)
                                      throws IOException,
                                             AuthorisationException
combines results from all configured attribute sources

Specified by:
getAttributes in interface IAttributeSource
Parameters:
tokens - - security tokens for this request
unused - - attributes returned by other authorisers, which may be null
Returns:
subject's attributes
Throws:
IOException - in case of technical problems
AuthorisationException

getStatusDescription

public String getStatusDescription()
Description copied from interface: IAttributeSource
Get a user-friendly description of the attribute source's status.
This is used for informing the administrator of any problems with configuration, connection problems, etc. UNICORE/X will print a log entry describing the status immediately after startup.
This method should not block for too long, since the server startup would be stalled in this case. For example, you may use the TimeoutRunner class to avoid blocking.

Specified by:
getStatusDescription in interface IAttributeSource
Returns:
a String describing this attribute source's status.

getChain

public List<IAttributeSource> getChain()

getCombiningPolicy

public AttributeSourcesChain.CombiningPolicy getCombiningPolicy()

setProperties

public void setProperties(Properties p)

setOrder

public void setOrder(String order)

setCombiningPolicy

public void setCombiningPolicy(String name)

getName

public String getName()
Description copied from interface: IAttributeSource
This method should return name of this attribute source, which was passed to the init() method.

Specified by:
getName in interface IAttributeSource
Returns:

getAcceptedVOs

public String[] getAcceptedVOs()
Description copied from interface: IAttributeSource
This method returns the list of VOs that this attribute source supports. If the attribute source is not aware of virtual organisations (like XUUDB) then empty list is returned, meaning that it is possible that VO-less users might be accepted by this attribute source.

Specified by:
getAcceptedVOs in interface IAttributeSource
Returns:


Copyright © 2012. All Rights Reserved.