com.ca.commons.jndi.beans
Class JNDIBeanStoreFactory

java.lang.Object
  extended by com.ca.commons.jndi.beans.JNDIBeanStoreFactory

public final class JNDIBeanStoreFactory
extends Object


Field Summary
static javax.xml.bind.JAXBContext jaxbContext
           
static Logger LOGGER
           
static Schema xmlSchema
           
 
Constructor Summary
JNDIBeanStoreFactory()
           
JNDIBeanStoreFactory(DataModelBuilder dataModelBuilder)
           
JNDIBeanStoreFactory(DataModelBuilder dataModelBuilder, boolean appendBinaryOption)
           
 
Method Summary
 void addMap(InputStream in, ClassLoader classLoader)
           
 void addMap(com.ca.commons.jndi.beans.xmlbind.Jndibeanmap beanMap, ClassLoader classLoader)
           
 com.ca.commons.jndi.beans.xmlbind.BeanType findMatchingBeanClassProperty(String propName, String propValue)
           
 Collection<JNDIBeanPropertyHandler> getAllHandlers()
           
 String getBeanClassProperty(BeanStoreClassSpec<?> cl, String propertyName)
          Retrieves a property value for bean class.
 String getBeanClassProperty(Class<?> cl, String propertyName)
           
 List<com.ca.commons.jndi.beans.xmlbind.BeanType> getBeanTypeHierarchy(BeanStoreClassSpec<?> cl)
          Returns a list of all BeanTypes in the inheritance hierarchy for the given class.
 Set<String> getBinaryAttributes()
           
 String getDN(BeanStoreClassSpec<?> cl, String rdn)
           
 String getDN(BeanStoreClassSpec<?> cl, String rdn, String baseDN)
           
 String getForceRead(BeanStoreClassSpec<?> aClass, String propName)
           
 JNDIBeanPropertyHandler getHandler(String name)
           
 int getLoadLevel(BeanStoreClassSpec<?> aClass, String propName)
           
 int getLoadLevel(Class<?> aClass, String propName)
           
 Collection<List<com.ca.commons.jndi.beans.xmlbind.MappingType>> getMappings(BeanStoreClassSpec<?> cl)
          Returns a Collection of Lists of MappingTypes, grouped by ID for this class.
 List<String> getRequiredProperties(BeanStoreClassSpec<?> cl)
           
 List<String> getSearchableProperties(BeanStoreClassSpec<?> cl)
          Returns a List of all searchable properties names for the given class.
 List<String> getSearchableProperties(Class<?> cl)
           
static com.ca.commons.jndi.beans.xmlbind.Jndibeanmap loadJNDIBeanMap(InputStream in)
           
 JNDIBeanStore newBeanStore(DirContext ctx)
          Creates a new JNDIBeanStore using a FixedDirContextFactory.
 JNDIBeanStore newBeanStore(DirContextFactory ctxFactory)
          Creates a new JNDIBeanStore using the specified DirContextFactory.
 JNDIBeanStore newBeanStore(Properties jndiEnv)
          Creates a new JNDIBeanStore using a StandardDirContextFactory.
 void removeMap(com.ca.commons.jndi.beans.xmlbind.Jndibeanmap beanMap, ClassLoader classLoader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

public static final Logger LOGGER

xmlSchema

public static final Schema xmlSchema

jaxbContext

public static final javax.xml.bind.JAXBContext jaxbContext
Constructor Detail

JNDIBeanStoreFactory

public JNDIBeanStoreFactory(@Nullable
                            DataModelBuilder dataModelBuilder,
                            boolean appendBinaryOption)

JNDIBeanStoreFactory

public JNDIBeanStoreFactory(@Nullable
                            DataModelBuilder dataModelBuilder)

JNDIBeanStoreFactory

public JNDIBeanStoreFactory()
Method Detail

loadJNDIBeanMap

public static com.ca.commons.jndi.beans.xmlbind.Jndibeanmap loadJNDIBeanMap(InputStream in)
                                                                     throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException

getBinaryAttributes

public Set<String> getBinaryAttributes()

addMap

public void addMap(InputStream in,
                   ClassLoader classLoader)
            throws JNDIBeanStoreException,
                   javax.xml.bind.JAXBException
Throws:
JNDIBeanStoreException
javax.xml.bind.JAXBException

addMap

public void addMap(com.ca.commons.jndi.beans.xmlbind.Jndibeanmap beanMap,
                   ClassLoader classLoader)
            throws JNDIBeanStoreException
Throws:
JNDIBeanStoreException

removeMap

public void removeMap(com.ca.commons.jndi.beans.xmlbind.Jndibeanmap beanMap,
                      ClassLoader classLoader)

getAllHandlers

public Collection<JNDIBeanPropertyHandler> getAllHandlers()

getHandler

public JNDIBeanPropertyHandler getHandler(String name)

newBeanStore

public JNDIBeanStore newBeanStore(Properties jndiEnv)
Creates a new JNDIBeanStore using a StandardDirContextFactory.

Parameters:
jndiEnv - The JNDI environment to use to create directory contexts.
See Also:
StandardDirContextFactory

newBeanStore

public JNDIBeanStore newBeanStore(DirContext ctx)
Creates a new JNDIBeanStore using a FixedDirContextFactory.

Parameters:
ctx - The directory context to be used.
See Also:
FixedDirContextFactory

newBeanStore

public JNDIBeanStore newBeanStore(DirContextFactory ctxFactory)
Creates a new JNDIBeanStore using the specified DirContextFactory.

Parameters:
ctxFactory - The directory context factory to be used by the new JNDIBeanStore instance. The factory must be configured before it is passed to this method.
Returns:
The new JNDIBeanStore instance.

getDN

public final String getDN(BeanStoreClassSpec<?> cl,
                          String rdn)
                   throws JNDIBeanStoreException
Throws:
JNDIBeanStoreException

getDN

public final String getDN(BeanStoreClassSpec<?> cl,
                          String rdn,
                          String baseDN)
                   throws JNDIBeanStoreException
Throws:
JNDIBeanStoreException

getBeanClassProperty

@Nullable
public String getBeanClassProperty(Class<?> cl,
                                            String propertyName)

getBeanClassProperty

@Nullable
public String getBeanClassProperty(BeanStoreClassSpec<?> cl,
                                            String propertyName)
Retrieves a property value for bean class. These name-value properties are defined in the XML bean-mapping file.


findMatchingBeanClassProperty

@Nullable
public com.ca.commons.jndi.beans.xmlbind.BeanType findMatchingBeanClassProperty(String propName,
                                                                                         String propValue)

getBeanTypeHierarchy

public List<com.ca.commons.jndi.beans.xmlbind.BeanType> getBeanTypeHierarchy(BeanStoreClassSpec<?> cl)
Returns a list of all BeanTypes in the inheritance hierarchy for the given class. In the list, BeanTypes for parent class will be placed before those of child class.


getMappings

public Collection<List<com.ca.commons.jndi.beans.xmlbind.MappingType>> getMappings(BeanStoreClassSpec<?> cl)
Returns a Collection of Lists of MappingTypes, grouped by ID for this class. In each list, MappingTypes for parent class will be placed AFTER those of child class.


getSearchableProperties

public List<String> getSearchableProperties(Class<?> cl)

getSearchableProperties

public List<String> getSearchableProperties(BeanStoreClassSpec<?> cl)
Returns a List of all searchable properties names for the given class.


getRequiredProperties

public List<String> getRequiredProperties(BeanStoreClassSpec<?> cl)

getLoadLevel

public int getLoadLevel(Class<?> aClass,
                        String propName)

getForceRead

@Nullable
public String getForceRead(BeanStoreClassSpec<?> aClass,
                                    String propName)

getLoadLevel

public int getLoadLevel(BeanStoreClassSpec<?> aClass,
                        String propName)


Created 2011-07-14 13:27 EST