com.ca.jcs
Class ImplBundle

java.lang.Object
  extended by com.ca.jcs.ImplBundle

public class ImplBundle
extends Object

Information for each connector implementation bundle, telling the JCS framework everything it needs to know to create a new active connector instance. This information is usually initialized from the conf/connector.xml file contained within each connector's jcs_connector-*.jar file, by the Spring framework XML support, but will eventually be replaced by information in OSGi bundles (at least for custom connectors).


Constructor Summary
ImplBundle()
           
ImplBundle(Collection<ImplBundle> bundles)
          Deprecated. Left for compatibility with connector.xml files for r12 sample and custom connectors.
 
Method Summary
 boolean equals(Object obj)
           
 Boolean getAllowMetadataModify()
          Deprecated. Should use ConnectorConfig.getAllowMetadataModify() instead, as it can be configured in the jcs/conf/override/<connector>/connector.xml file. Left for compatibility with connector.xml files for r12 sample and custom connectors.
 Boolean getCompoundValueCapable()
           
 String getConnectionManagerClass()
          Obtain the name of the custom connection manager (pooling) class for this connector
 String getConnectorClass()
           
 String getConnectorTypeClass()
           
 String getConnectorTypeLdapObjClass()
           
 String getConnectorTypeName()
          Optional field which can be specified for deployments where multiple connector implementations share the same naming attribute for their connector types (as Admin does), in which case this common naming attribute is stored in PartitionLoaderService.dnConnectorTypeKeyAttribute and the value specified for it in a DN is used to look up a matching ImplBundle, if one exists.
 String getConnNamingAttr()
          Naming attribute for connectors implemented by this bundle, used to perform sanity check when resolving DNs.
 String getCustomMetadataFile()
          Deprecated. Since r12.1: Use Connector Xpress templates and manually provide mappings for custom attributes etc instead.
 ConnectorConfig getDefaultConnectorConfig()
           
 String getDynamicSchemaFile()
          This optional field can be used to specify the name of an OpenLDAP formatted .schema file containing attribute types/object classes etc to be loaded when the JCS is started up.
 List<MetaDataDefs.AssocType> getEnforceCompoundAssocs()
           
 String getFatalError()
           
 Boolean getIndirectAssociations()
           
 String getMessageResourceBundle()
          This optional field can be used to specify the base name for a property resource bundle containing connector specific message format strings, for instance a value of "/conf/myconnector" will result in message formats being read from "/conf/myconnector.properties" by default, "/conf/myconnector_fr.properties" if the locale is French etc.
 boolean getModifyNullStringToEmpty()
          If true then null attribute values are converted to empty strings ("") before passing to the connector.
 String getName()
          This name is used to determine whether this bundle is for the variety of connector which knows how to service an LDAP request, by comparing the value of the connector type's (aka Admin Namespace) attribute configured via the implBundleAttr attribute on the connectorFactory instance created from conf/server_jcs.xml.
 String getOpProcessorProxyHandlerClass()
           
 Class<? extends AbstractAttributeStyleOpProcessor> getRealAttributeStyleProcessorClass()
           
 Class<? extends MetaConnector> getRealConnectorClass()
           
 Class<? extends MetaConnectorType> getRealConnectorTypeClass()
           
 Class<? extends ConnectorProcessorProxyHandler> getRealOpProcessorProxyHandlerClass()
           
 String getStaticMetadataFile()
           
 String getStaticMethodScriptStyleMetaDataFile()
           
 int hashCode()
           
 boolean init(Logger log)
          Attempts to resolve the class names provided to real Class instances.
 boolean isDefinedInMetadata()
          Returns true if ImplBundle descriptor was supplied dynamically by embedding in the metadata (connectorXML=...)
 Boolean isOverride()
           
 boolean matches(String implBundleName, String implBundleConnectorTypeName, String implBundleConnectorTypeObjectClass)
          ImplBundle matches if any of the primary attribute values match.
 String readStaticMetadata()
          Reads the static metadata file used by this implBundle and returns its contents
 String readStaticOpbindingsMetadata()
          Reads the static metadata op-bindings file used by this implBundle and returns its contents
 void setAllowMetadataModify(Boolean allowMetadataModify)
          Deprecated. Should use ConnectorConfig#setAllowMetadataModify(boolean) instead, as it can be configured in the jcs/conf/override/<connector>/connector.xml file. Left for compatibility for r12 sample and custom connectors. Left for compatibility with connector.xml files for r12 sample and custom connectors.
 void setCompoundValueCapable(Boolean capable)
          Does the connector support compound values?
 void setConnectionManagerClass(String connectorPoolingClass)
           
 void setConnectorClass(String connectorClass)
          Specifies the name of the connector-specific class to be used to represent connector instances by the bundle.
 void setConnectorTypeClass(String connectorTypeClass)
          Specifies the name of the class to be used to represent connector types in the bundle, usually MetaConnectorType will suffice.
 void setConnectorTypeLdapObjClass(String ldapObjClass)
          Used to set LDAP object class for connector type (aka Admin Namespace) managed by this bundle, which is used as the fall-back means of matching a ImplBundle to an LDAP ADD request (if no exact match is found against any bundle's name property).
 void setConnectorTypeName(String connectorTypeName)
           
 void setConnNamingAttr(String connNamingAttr)
           
 void setCustomMetadataFile(String customMetadataFile)
          Deprecated. Since r12.1: Use Connector Xpress templates and manually provide mappings for custom attributes etc instead.
 void setDefaultConnectorConfig(ConnectorConfig cfg)
          The constructor for the concrete connector instance is passed an instance of class deriving from connectorConfig (created by conf/connector.xml contained in connector's jcs-connector-*.jar file) so that it can be used to initialize the connector.
 void setDefinedInMetadata(boolean isDynamic)
           
 void setDynamicSchemaFile(String dynamicSchemaFile)
           
 void setEnforceCompoundAssocs(List<MetaDataDefs.AssocType> types)
          If the connector supports compound values, then this method allows a restriction on which compound association types are allowed (leave set to null if no restriction should be enforced, empty list signifies assocs are not supported for compound values and otherwise list acceptable style of assocs).
 void setFatalError(String fatalError)
          Can be set if bundle is found to be inoperable, for instance if it's schema contains errors.
 void setIndirectAssociations(Boolean indirectAssociations)
          If associations are supported, should they be restricted to indirect/direct ones?
 void setIsOverride(Boolean isOverride)
           
 void setMessageResourceBundle(String messageResourceBundle)
           
 void setModifyNullStringToEmpty(boolean modifyNullStringToEmpty)
           
 void setName(String name)
           
 void setOpProcessorProxyHandlerClass(String proxyHandlerClass)
          Allows user to specify the name of a proxy class (such as the generic exception mapping to NamingExceptions offered by JDBCExceptionMappingProxy) which the framework will automatically wrap around all the styles of op processor (attribute-style, method-style or script-style) supported by the connector.
 void setStaticMetadataFile(String staticMetadataFile)
          Deprecated. Should use ConnectorConfig#setStaticMetadataFile() instead, as it can be configured in the jcs/conf/override/<connector>/connector.xml file. Left for compatibility for r12 sample and custom connectors. Left for compatibility with connector.xml files for r12 sample and custom connectors.
 void setStaticMethodScriptStyleMetaDataFile(String staticMetadataFile)
          Deprecated. Should use ConnectorConfig#setStaticMethodScriptStyleMetaDataFile() instead, as it can be configured in the jcs/conf/override/<connector>/connector.xml file. Left for compatibility for r12 sample and custom connectors. Left for compatibility with connector.xml files for r12 sample and custom connectors.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImplBundle

@Deprecated
public ImplBundle(Collection<ImplBundle> bundles)
Deprecated. Left for compatibility with connector.xml files for r12 sample and custom connectors.


ImplBundle

public ImplBundle()
Method Detail

getName

public String getName()
This name is used to determine whether this bundle is for the variety of connector which knows how to service an LDAP request, by comparing the value of the connector type's (aka Admin Namespace) attribute configured via the implBundleAttr attribute on the connectorFactory instance created from conf/server_jcs.xml.

Returns:
Name of bundle, e.g. "JDBC", "JNDI" etc.

setName

public void setName(String name)

getFatalError

public String getFatalError()

setFatalError

public void setFatalError(String fatalError)
Can be set if bundle is found to be inoperable, for instance if it's schema contains errors.


getConnectorTypeName

public String getConnectorTypeName()
Optional field which can be specified for deployments where multiple connector implementations share the same naming attribute for their connector types (as Admin does), in which case this common naming attribute is stored in PartitionLoaderService.dnConnectorTypeKeyAttribute and the value specified for it in a DN is used to look up a matching ImplBundle, if one exists. In Admin this property needs to be set on all static namespaces but is not set for dynamic (DYN) namespaces which are instead resolved using ImplBundles' name property.


setConnectorTypeName

public void setConnectorTypeName(String connectorTypeName)

getMessageResourceBundle

public String getMessageResourceBundle()
This optional field can be used to specify the base name for a property resource bundle containing connector specific message format strings, for instance a value of "/conf/myconnector" will result in message formats being read from "/conf/myconnector.properties" by default, "/conf/myconnector_fr.properties" if the locale is French etc. Note that any base names used must be unique across all connectors, until such time as support for deploying connectors as OSGi bundles is added.

Returns:
Base name for configured property resource bundle, or null if no connector-specific messages are required.

setMessageResourceBundle

public void setMessageResourceBundle(String messageResourceBundle)

getDynamicSchemaFile

public String getDynamicSchemaFile()
This optional field can be used to specify the name of an OpenLDAP formatted .schema file containing attribute types/object classes etc to be loaded when the JCS is started up. Basic guarding is done against loading the same .schema file multiple times, so bundles needn't worry about performance impact in this case. Note that .schema files can also be specified in the conf/server_jcs.xml file to make them universally available, as well as schema Java objects being built into the JCS release being included via the bootstrapSchemas field also in conf/server_jcs.xml.

Returns:
The .schema file path associated with this bundle relative to the root of the installation, for instance ./conf/myschema.schema

setDynamicSchemaFile

public void setDynamicSchemaFile(String dynamicSchemaFile)

getIndirectAssociations

public Boolean getIndirectAssociations()

setIndirectAssociations

public void setIndirectAssociations(Boolean indirectAssociations)
If associations are supported, should they be restricted to indirect/direct ones?


getCompoundValueCapable

public Boolean getCompoundValueCapable()

setCompoundValueCapable

public void setCompoundValueCapable(Boolean capable)
Does the connector support compound values? Null means no enforcing, false means reject metadata with compound values and true means allow them.


getEnforceCompoundAssocs

public List<MetaDataDefs.AssocType> getEnforceCompoundAssocs()

setEnforceCompoundAssocs

public void setEnforceCompoundAssocs(List<MetaDataDefs.AssocType> types)
If the connector supports compound values, then this method allows a restriction on which compound association types are allowed (leave set to null if no restriction should be enforced, empty list signifies assocs are not supported for compound values and otherwise list acceptable style of assocs).


getDefaultConnectorConfig

public ConnectorConfig getDefaultConnectorConfig()

setDefaultConnectorConfig

public void setDefaultConnectorConfig(ConnectorConfig cfg)
The constructor for the concrete connector instance is passed an instance of class deriving from connectorConfig (created by conf/connector.xml contained in connector's jcs-connector-*.jar file) so that it can be used to initialize the connector.

Parameters:
cfg - Configuration to be used

getConnectorTypeLdapObjClass

public String getConnectorTypeLdapObjClass()

setConnectorTypeLdapObjClass

public void setConnectorTypeLdapObjClass(String ldapObjClass)
Used to set LDAP object class for connector type (aka Admin Namespace) managed by this bundle, which is used as the fall-back means of matching a ImplBundle to an LDAP ADD request (if no exact match is found against any bundle's name property). For instance the NDS connector specifies this value as eTNDSNamespace.


getConnectorTypeClass

public String getConnectorTypeClass()

setConnectorTypeClass

public void setConnectorTypeClass(String connectorTypeClass)
Specifies the name of the class to be used to represent connector types in the bundle, usually MetaConnectorType will suffice.

Parameters:
connectorTypeClass - Instances of this class will be created to act as the connector type (aka Admin Namespace) parents of connector instances.

getConnectorClass

public String getConnectorClass()

setConnectorClass

public void setConnectorClass(String connectorClass)
Specifies the name of the connector-specific class to be used to represent connector instances by the bundle.

Parameters:
connectorClass - Instances of this class will be created to act as connector (aka Admin Directory) instances, for instance the JDBC connector uses the value JDBCMetaConnector.

getOpProcessorProxyHandlerClass

public String getOpProcessorProxyHandlerClass()

setOpProcessorProxyHandlerClass

public void setOpProcessorProxyHandlerClass(String proxyHandlerClass)
Allows user to specify the name of a proxy class (such as the generic exception mapping to NamingExceptions offered by JDBCExceptionMappingProxy) which the framework will automatically wrap around all the styles of op processor (attribute-style, method-style or script-style) supported by the connector.

Parameters:
proxyHandlerClass - Class extending ConnectorProcessorProxyHandler which implements its wrapping logic in its invoke() method.

getRealConnectorTypeClass

public Class<? extends MetaConnectorType> getRealConnectorTypeClass()

getRealConnectorClass

public Class<? extends MetaConnector> getRealConnectorClass()

getRealAttributeStyleProcessorClass

public Class<? extends AbstractAttributeStyleOpProcessor> getRealAttributeStyleProcessorClass()

getRealOpProcessorProxyHandlerClass

public Class<? extends ConnectorProcessorProxyHandler> getRealOpProcessorProxyHandlerClass()

getConnNamingAttr

public String getConnNamingAttr()
Naming attribute for connectors implemented by this bundle, used to perform sanity check when resolving DNs.

Returns:
Naming attribute for connector level of DIT, eg NDS connector uses the value eTNDSTreeName.

setConnNamingAttr

public void setConnNamingAttr(String connNamingAttr)

getAllowMetadataModify

@Deprecated
public Boolean getAllowMetadataModify()
Deprecated. Should use ConnectorConfig.getAllowMetadataModify() instead, as it can be configured in the jcs/conf/override/<connector>/connector.xml file. Left for compatibility with connector.xml files for r12 sample and custom connectors.


setAllowMetadataModify

@Deprecated
public void setAllowMetadataModify(Boolean allowMetadataModify)
Deprecated. Should use ConnectorConfig#setAllowMetadataModify(boolean) instead, as it can be configured in the jcs/conf/override/<connector>/connector.xml file. Left for compatibility for r12 sample and custom connectors. Left for compatibility with connector.xml files for r12 sample and custom connectors.

When set to true, values provided to setStaticMetadataFile(java.lang.String) and setStaticMethodScriptStyleMetaDataFile(java.lang.String) can be overridden by LDAP modifies operations on the ConnectorType.

Think carefully about implications of leaving this set to true in production.


getStaticMetadataFile

public String getStaticMetadataFile()

setStaticMetadataFile

@Deprecated
public void setStaticMetadataFile(String staticMetadataFile)
Deprecated. Should use ConnectorConfig#setStaticMetadataFile() instead, as it can be configured in the jcs/conf/override/<connector>/connector.xml file. Left for compatibility for r12 sample and custom connectors. Left for compatibility with connector.xml files for r12 sample and custom connectors.

Non-dynamic options may have their datamodel.xsd metadata stored in a local file rather then managed as an attribute.

Parameters:
staticMetadataFile - Name of file on local filesystem (to the machine on which the JCS is installed) containing static metadata for implemented connector type. If null then connector is dynamic and metadata must instead be provided in an attribute when new ConnectorType is created via LDAP add.
See Also:
setAllowMetadataModify(java.lang.Boolean), #isAllowMetadataModify

getCustomMetadataFile

@Deprecated
public String getCustomMetadataFile()
Deprecated. Since r12.1: Use Connector Xpress templates and manually provide mappings for custom attributes etc instead.


setCustomMetadataFile

@Deprecated
public void setCustomMetadataFile(String customMetadataFile)
Deprecated. Since r12.1: Use Connector Xpress templates and manually provide mappings for custom attributes etc instead.

Connectors that wish to allow customers to customize the metadata provided with the connector should ask them to create a sparse metadata file in <jcs-home>/conf/override/<connector>/ and then reference it here, which will then be merged over the top of the static metadata file when the ConnectorType is activated on first reference. A common use-case is to provide customer-defined mappings for custom attributes.

Parameters:
customMetadataFile - Sparse metadata file also adhering to the datamodel.xsd schema which is merged over the top of the static metadata file. It must match the exact namespace and class names in the file it overrides. If a file is named here but doesn't exist a warning will be logged but it is not a serious error.

getStaticMethodScriptStyleMetaDataFile

public String getStaticMethodScriptStyleMetaDataFile()

setStaticMethodScriptStyleMetaDataFile

@Deprecated
public void setStaticMethodScriptStyleMetaDataFile(String staticMetadataFile)
Deprecated. Should use ConnectorConfig#setStaticMethodScriptStyleMetaDataFile() instead, as it can be configured in the jcs/conf/override/<connector>/connector.xml file. Left for compatibility for r12 sample and custom connectors. Left for compatibility with connector.xml files for r12 sample and custom connectors.

Non-dynamic options may have their opbindings.xsd metadata stored in a local file rather then managed as an attribute.

Parameters:
staticMetadataFile - Name of file on local filesystem (to the machine on which the JCS is installed) containing static metadata for implemented connector type. If null then connector is dynamic and metadata must instead be provided in an attribute when new ConnectorType is created via LDAP add.
See Also:
setAllowMetadataModify(java.lang.Boolean), #isAllowMetadataModify

getModifyNullStringToEmpty

public boolean getModifyNullStringToEmpty()
If true then null attribute values are converted to empty strings ("") before passing to the connector.

Returns:
True if null string should be converted to empty strings.

setModifyNullStringToEmpty

public void setModifyNullStringToEmpty(boolean modifyNullStringToEmpty)

getConnectionManagerClass

public String getConnectionManagerClass()
Obtain the name of the custom connection manager (pooling) class for this connector

Returns:

setConnectionManagerClass

public void setConnectionManagerClass(String connectorPoolingClass)

setDefinedInMetadata

public void setDefinedInMetadata(boolean isDynamic)

isDefinedInMetadata

public boolean isDefinedInMetadata()
Returns true if ImplBundle descriptor was supplied dynamically by embedding in the metadata (connectorXML=...)


init

public boolean init(Logger log)
Attempts to resolve the class names provided to real Class instances. We don't use Spring for this as it doesn't deal with cases where a connector references libraries which we aren't able to bundle (eg SAP / PPS), and the customer hasn't made them available.

Parameters:
log - Logger to which error messages should be output.
Returns:
True if all classes were successfully resolved.

readStaticMetadata

public String readStaticMetadata()
Reads the static metadata file used by this implBundle and returns its contents

Returns:

readStaticOpbindingsMetadata

public String readStaticOpbindingsMetadata()
Reads the static metadata op-bindings file used by this implBundle and returns its contents

Returns:

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

matches

public boolean matches(String implBundleName,
                       String implBundleConnectorTypeName,
                       String implBundleConnectorTypeObjectClass)
ImplBundle matches if any of the primary attribute values match.

Parameters:
implBundleName - Either desired implBundle's name, or null to mean "match other fields".
implBundleConnectorTypeName - Either desired connector type name, or null to mean "match other fields".
implBundleConnectorTypeObjectClass - Either desired connector type object class name, or null to mean "match other fields".
Returns:

isOverride

public Boolean isOverride()
Returns:
true if a bundle is an override bundle for one with the same name (e.g. conf/override/myconnector/connector.xml)

setIsOverride

public void setIsOverride(Boolean isOverride)


Created 2011-07-14 13:27 EST