Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 2 (11.1.2.0.0)

E17486-01

oracle.adf.share.jndi
Class ReferenceStoreHelper

java.lang.Object
  extended by oracle.adf.share.jndi.ReferenceStoreHelper

public class ReferenceStoreHelper
extends java.lang.Object

ReferenceStoreHelper is a helper class that manages the conversion of JNDI Reference objects to/from their persistent representation. This includes the persistence of SecureRefAddr objects using the Credential Store. All APIs operate on JNDI Reference objects so the client does not need to know anything about the serialized form of the References or how to convert JNDI Reference objects to or from the JAXB/Credential Store representation

Since:
10.1.3

Constructor Summary
ReferenceStoreHelper()
           
 
Method Summary
 void addJarReferences(java.util.List<oracle.adf.share.jndi.xml.v2.ReferenceListType> refList)
           
 void addReference(java.lang.String id, javax.naming.Reference ref)
          Add a new javax.naming.Reference to the reference store.
 void destroy()
          Release any resources being held by the ReferenceStoreHelper instance.
 boolean exists(java.lang.String id)
          Returns true if a Reference with the specified ID exists in the reference store
 javax.naming.Reference findReference(java.lang.String id)
          Return the Reference for the specified ID.
 ADFLogger getLogger()
           
 java.lang.Object getObjectForReference(java.lang.String id)
          Get the Object identified by "id".
 java.lang.Object getObjectForReference(java.lang.String id, javax.naming.Reference reference)
           
 oracle.adf.share.jndi.xml.v2.ReferenceListType getReferences()
          Get the References object that is being maintained by this ReferenceStoreHelper instance.
 java.util.Map getReferencesMap()
          Return a Map containing a javax.naming.Reference object for each corresponding JAXB ReferenceType.
 java.util.Map getReferencesMapEx(boolean includeExceptions)
          Return a Map containing a javax.naming.Reference object for each corresponding JAXB ReferenceType.
 oracle.adf.share.jndi.xml.v2.ReferenceListType getSaveableReferences()
           
 void init(oracle.adf.share.jndi.xml.v2.ReferenceListType refs, javax.naming.Context ctx, java.util.Hashtable env)
          Initialize the ReferenceStoreHelper.
 void removeReference(java.lang.String id)
          Remove a Reference from the reference store.
 void saveCredentials()
          Write the accummulated changes to the Credential Store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferenceStoreHelper

public ReferenceStoreHelper()
Method Detail

init

public void init(oracle.adf.share.jndi.xml.v2.ReferenceListType refs,
                 javax.naming.Context ctx,
                 java.util.Hashtable env)
Initialize the ReferenceStoreHelper.

Parameters:
refs - JAXB ReferenceListType object that will be used to marshal/ unmarshal the References
ctx - Context this ReferenceStoreHelper is associated with.
env - Environment hashtable containing the security credentials that should be used to access the Credential Store

getReferences

public oracle.adf.share.jndi.xml.v2.ReferenceListType getReferences()
Get the References object that is being maintained by this ReferenceStoreHelper instance.

Returns:
the References object that is being maintained by this ReferenceStoreHelper instance.

getSaveableReferences

public oracle.adf.share.jndi.xml.v2.ReferenceListType getSaveableReferences()

getLogger

public ADFLogger getLogger()

addJarReferences

public void addJarReferences(java.util.List<oracle.adf.share.jndi.xml.v2.ReferenceListType> refList)
                      throws java.lang.Exception
Throws:
java.lang.Exception

findReference

public javax.naming.Reference findReference(java.lang.String id)
                                     throws javax.naming.NamingException
Return the Reference for the specified ID.

Parameters:
id - ID of the JNDI Reference to be returned
Returns:
the JNDI Reference identified by id or null one could not be found
Throws:
javax.naming.NamingException - if an exception occurs locating the specified JAXB ReferenceType or converting the JAXB ReferenceType into a JNDI Reference

exists

public boolean exists(java.lang.String id)
               throws javax.naming.NamingException
Returns true if a Reference with the specified ID exists in the reference store

Parameters:
id - ID of the reference
Returns:
true if a Reference with the specified ID exists in the reference store. Otherwise false.
Throws:
javax.naming.NamingException - if an exception occurs determining if the reference exists or not.

getObjectForReference

public java.lang.Object getObjectForReference(java.lang.String id)
                                       throws java.lang.Exception
Get the Object identified by "id". This method finds the Reference for the specified ID and converts it back into its original object form.

Parameters:
id - ID of the object to be returned
Returns:
The Object described by the specified Reference
Throws:
java.lang.Exception - if an exception occurs locating the Reference or re-creating the object described by the Reference

getObjectForReference

public java.lang.Object getObjectForReference(java.lang.String id,
                                              javax.naming.Reference reference)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

getReferencesMapEx

public java.util.Map getReferencesMapEx(boolean includeExceptions)
                                 throws javax.naming.NamingException
Return a Map containing a javax.naming.Reference object for each corresponding JAXB ReferenceType. The map stores the Exception object for those connections for which the an exception is thrown while trying to create a Reference object.

Returns:
a Map containing a JNDI Reference or Exception for each corresponding JAXB ReferenceType
Throws:
javax.naming.NamingException - if an exception occurs populating the Map.

getReferencesMap

public java.util.Map getReferencesMap()
                               throws javax.naming.NamingException
Return a Map containing a javax.naming.Reference object for each corresponding JAXB ReferenceType.

Returns:
a Map containing a JNDI Reference
Throws:
javax.naming.NamingException - if an exception occurs populating the Map.

addReference

public void addReference(java.lang.String id,
                         javax.naming.Reference ref)
                  throws javax.naming.NamingException
Add a new javax.naming.Reference to the reference store.

Parameters:
id - ID of the Reference
ref - the Reference to be added
Throws:
javax.naming.NamingException - if an exception occurs adding the Reference

removeReference

public void removeReference(java.lang.String id)
                     throws javax.naming.NamingException
Remove a Reference from the reference store.

Parameters:
id - ID of the Reference to be removed
Throws:
javax.naming.NamingException - if an exception occurs removing the Reference

saveCredentials

public void saveCredentials()
                     throws java.lang.Exception
Write the accummulated changes to the Credential Store. This method should be called when the ReferenceListType used by this helper is persisted. When called, it writes to the Credential Store any new credentials associated with References that have been added and deletes from the Credential Store any credentials associated with References that have been deleted

Throws:
java.lang.Exception - if an exception occurs writing the accummulated changes to the Credential Store

destroy

public void destroy()
Release any resources being held by the ReferenceStoreHelper instance. All pending changes are discarded when this method is called.


Oracle Fusion Middleware Java API Reference for Oracle ADF Share
11g Release 2 (11.1.2.0.0)

E17486-01

Copyright © 1997, 2011, Oracle. All rights reserved.