com.ibm.sec.authz.jaccplus.config.internal
Class ContextManager

java.lang.Object
  extended by com.ibm.sec.authz.jaccplus.config.internal.ContextManager

public class ContextManager
extends java.lang.Object

This class handles the deployed contexts, their states, and the links between them.

The context identifiers stored by this implementation should be UNENCODED, so don't pass in URL encoded values.


Method Summary
 void addLink(java.lang.String sourceContext, java.lang.String targetContext)
          This method is used to add a link between the two contexts.
 void addPolicyContext(java.lang.String context)
          This method is used to add a context so that the manager knows it exists.
static ContextManager getManager(java.util.Properties props)
           
 java.lang.String[] getPolicyContexts()
          This method is used to get a list of all contexts that policy has been deployed under.
 java.lang.String[] getPolicyContexts(java.lang.String roleMappingContext)
          This method is used to return a list of context identifiers linked to the passed role mapping context.
 void removeLinks(java.lang.String policyContext)
          This method is used to remove the passed link configuration from links it may be a participant in.
 void removePolicyContext(java.lang.String context)
          This method is used to remove a context so that the manager knows it no longer exists.
 void save()
          Save our context mappings to disk.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getManager

public static ContextManager getManager(java.util.Properties props)

addPolicyContext

public void addPolicyContext(java.lang.String context)
This method is used to add a context so that the manager knows it exists.

Parameters:
context - The policy context to add to the set of contexts in service.

removePolicyContext

public void removePolicyContext(java.lang.String context)
This method is used to remove a context so that the manager knows it no longer exists.

Parameters:
context - The policy context to remove from the set of contexts in service.

addLink

public void addLink(java.lang.String sourceContext,
                    java.lang.String targetContext)
This method is used to add a link between the two contexts. Remember that linking is transitive, so the reverse link must also be created.

Parameters:
sourceContext -
targetContext -

getPolicyContexts

public java.lang.String[] getPolicyContexts(java.lang.String roleMappingContext)
                                     throws javax.security.jacc.PolicyContextException
This method is used to return a list of context identifiers linked to the passed role mapping context.

The primary point of this method is for WebSphere. It iterates over all the listed policy contexts and returns the ones that are prefixed by the given role-mapping context.

If no prefixed policy contexts are found, then it means we're probably running outside WebSphere. In this case, the value that was passed in is returned.

Parameters:
roleMappingContext - The role mapping context to which to find linked context identifiers.
Returns:
a String array of linked policy contexts.
Throws:
javax.security.jacc.PolicyContextException

getPolicyContexts

public java.lang.String[] getPolicyContexts()
This method is used to get a list of all contexts that policy has been deployed under.

Returns:
a String array of contexts found to have policy deployed under.

removeLinks

public void removeLinks(java.lang.String policyContext)
This method is used to remove the passed link configuration from links it may be a participant in.

Parameters:
policyContext - The context to remove linked configurations from.

save

public void save()
Save our context mappings to disk.



Copyright © 2009 IBM Corp. All Rights Reserved.