Oracle Entitlements Server for Java API Reference

com.bea.security
Class NamingAuthorityManager

java.lang.Object
  |
  +--com.bea.security.NamingAuthorityManager

public class NamingAuthorityManager
extends java.lang.Object

The NameAuthorityManager class is a central registrar for all naming authorities that the security runtime recognizes. Within a runtime if the name is not registered with it's naming authority's manager, then the name effectively does not exist.

This class is also responsible for managing the dependencies of the naming authorities. If a naming authority's dependencies are not met, then it will not be available to the security runtime. The naming authority will remain associated with the Naming Authority Manager, and every time a new authority is added, it's dependencies will be re-evaluated and it will be enabled once they are all met.

The format of the XML file used for creating new naming authorities is as follows:

 <?xml version="1.0"?>
 <AuthorityConfig>
    <AuthorityDefinition name="AUTHORITYNAME" delimiters=","
        <Attribute name="ATTRIBUTENAME" type="ATTRIBUTETYPE" authority="AUTHORITYNAME"/>
        ... (As many attributes as are necessary)
           <AuthorityDefinition name="SUBAUTHORITY" delimiters=":"
           ... (Nested definitions allow subauthorities to be associated with other authorities. By registering
                the main authority, all subauthorities are also registered)
           </AuthorityDefinition>
        <Dependency>
           <Authority name="DEPENDANTAUTHORITY"/>
           ... (List this authority's dependencies here)
        </Dependency>
    </AuthorityDefinition>
    <!-- Or you can load in a class extending the NamingAuthority base class by... -->
    <AuthorityDefinition class="my.package.name.Classname"/>
 </AuthorityConfig>
 
Valid attribute types are SINGLE_VALUE_PREFIX, MULTI_VALUE_PREFIX, SINGLE_VALUE, MULTI_TOKEN, MULTI_VALUE_TERMINAL, and SINGLE_VALUE_TERMINAL. See NameAttributeType for the definitions of these attribute types.

Author:
Copyright © 2004-2008, Oracle and/or its affiliates. All rights reserved.
See Also:
NameAttributeType, NamingAuthority

Method Summary
 NamingAuthority getNamingAuthority(java.lang.String namingauthorityname)
          Gets a reference to a known authority by name.
 SecurityRuntime getRuntime()
          Gets the reference to the runtime this naming authority manager services.
 void loadDefaultAuthorityDefinitions()
          Loads factory default naming authority definitions.
 void loadXMLAuthorityDefinition(java.io.InputStream in)
          Loads authority definitions from an input stream.
 void loadXMLAuthorityDefinition(java.lang.String filespec)
          Loads authority definitions from an XML file given a path to that file.
 void registerAuthority(NamingAuthority authority)
          Registers a new naming authority.
 void shutdown()
          Returns this naming authority manager to its pre-initialized state.
 boolean validateAuthority(NamingAuthority authority)
          Validate an authority to ensure that its attribute configuration is proper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getRuntime

public SecurityRuntime getRuntime()
Gets the reference to the runtime this naming authority manager services.

Returns:
the SecurityRuntime that this manager services.

loadXMLAuthorityDefinition

public void loadXMLAuthorityDefinition(java.lang.String filespec)
                                throws ServiceNotAvailableException,
                                       java.io.FileNotFoundException,
                                       java.io.IOException
Loads authority definitions from an XML file given a path to that file.

Parameters:
filespec - a path name to an XML file defining naming authorities.
Throws:
ServiceNotAvailableException - This exception is thrown if this Naming Authority Manager is not yet initialized.
java.io.FileNotFoundException - This exception is thrown if the file provided does not exist.
java.io.IOException - This exception is thrown if there is an error loading the file provided.

loadDefaultAuthorityDefinitions

public void loadDefaultAuthorityDefinitions()
                                     throws ServiceNotAvailableException
Loads factory default naming authority definitions. If any custom definition names registered to the Naming Authority Manager match the factory default names, calling this method from a security runtime application will overwrite the matching custom names with the default authorities shipped with this product. If the custom names do not match the default names, they will not be modified.

Throws:
ServiceNotAvialableException - This exception is thrown if the naming authority manager is not yet initialized.

loadXMLAuthorityDefinition

public void loadXMLAuthorityDefinition(java.io.InputStream in)
                                throws ServiceNotAvailableException,
                                       java.io.IOException
Loads authority definitions from an input stream.

Parameters:
in - an InputStream where authority definition XML can be read.
Throws:
ServiceNotAvailableException - This exception is thrown if the naming authority manager is not yet initialized.
java.io.IOException - This exception is thrown if there is an error reading the input stream provided.

shutdown

public void shutdown()
Returns this naming authority manager to its pre-initialized state.

registerAuthority

public void registerAuthority(NamingAuthority authority)
Registers a new naming authority. This naming authority becomes available only when all dependencies it has, and its subauthorities have are met.

Parameters:
authority - the NamingAuthority to register.

getNamingAuthority

public NamingAuthority getNamingAuthority(java.lang.String namingauthorityname)
Gets a reference to a known authority by name. Returns null if the authority does not exist or is not currently available.

Parameters:
namingauthorityname - The name of the authority whose reference you are asking for.
Returns:
a reference to the named authority, or null if the authority is not available.

validateAuthority

public boolean validateAuthority(NamingAuthority authority)
Validate an authority to ensure that its attribute configuration is proper.

Returns:
true if this authority is valid; otherwise, returns false.