public class ConfigPartitionReader
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
ADS_PREFIX
The prefix for all the configuration ObjectClass names
|
private static java.lang.String |
ADS_SUFFIX
The suffix for the bean
|
private AbstractBTreePartition |
configPartition
the partition which holds the configuration data
|
private static org.slf4j.Logger |
LOG
The logger for this class
|
private org.apache.directory.api.ldap.model.schema.SchemaManager |
schemaManager
the schema manager set in the config partition
|
private SearchEngine |
se
the search engine of the partition
|
| Constructor and Description |
|---|
ConfigPartitionReader(AbstractBTreePartition configPartition)
Creates a new instance of ConfigPartitionReader.
|
| Modifier and Type | Method and Description |
|---|---|
private AdsBaseBean |
createBean(org.apache.directory.api.ldap.model.schema.ObjectClass objectClass)
Create the base Bean from the ObjectClass name.
|
private org.apache.directory.api.ldap.model.schema.ObjectClass |
findObjectClass(org.apache.directory.api.ldap.model.entry.Attribute objectClass)
Find the upper objectclass in a hierarchy.
|
private boolean |
isMultiple(java.lang.Class<?> clazz)
Indicates the given type is multiple.
|
java.util.List<AdsBaseBean> |
read(org.apache.directory.api.ldap.model.name.Dn baseDn,
java.lang.String name,
org.apache.directory.api.ldap.model.message.SearchScope scope,
boolean mandatory)
Read some configuration element from the DIT using its name
|
ConfigBean |
readConfig()
Read the configuration from the DIT, returning a bean containing all of it.
|
ConfigBean |
readConfig(org.apache.directory.api.ldap.model.name.Dn baseDn)
Read the configuration from the DIT, returning a bean containing all of it.
|
ConfigBean |
readConfig(org.apache.directory.api.ldap.model.name.Dn baseDn,
java.lang.String objectClass)
Read the configuration from the DIT, returning a bean containing all of it.
|
AdsBaseBean |
readConfig(org.apache.directory.api.ldap.model.entry.Entry entry)
Creates a configuration bean from the given entry.
|
ConfigBean |
readConfig(java.lang.String baseDn)
Read the configuration from the DIT, returning a bean containing all of it.
|
ConfigBean |
readConfig(java.lang.String baseDn,
java.lang.String objectClass)
Read the configuration from the DIT, returning a bean containing all of it.
|
private void |
readFieldValue(AdsBaseBean bean,
java.lang.reflect.Field field,
org.apache.directory.api.ldap.model.entry.Entry entry,
java.lang.String attributeTypeName,
boolean mandatory) |
private void |
readMultiValuedField(AdsBaseBean bean,
java.lang.reflect.Field field,
org.apache.directory.api.ldap.model.entry.Attribute attribute)
Read the multiple entry value for an AttributeType, and feed the Bean field with this value
|
private void |
readSingleValueField(AdsBaseBean bean,
java.lang.reflect.Field beanField,
org.apache.directory.api.ldap.model.entry.Attribute fieldAttr)
Read the single entry value for an AttributeType, and feed the Bean field with this value
|
private static final org.slf4j.Logger LOG
private AbstractBTreePartition configPartition
private SearchEngine se
private org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager
private static final java.lang.String ADS_PREFIX
private static final java.lang.String ADS_SUFFIX
public ConfigPartitionReader(AbstractBTreePartition configPartition)
configPartition - the non null config partitionprivate org.apache.directory.api.ldap.model.schema.ObjectClass findObjectClass(org.apache.directory.api.ldap.model.entry.Attribute objectClass)
throws java.lang.Exception
java.lang.Exceptionprivate AdsBaseBean createBean(org.apache.directory.api.ldap.model.schema.ObjectClass objectClass) throws ConfigurationException
ConfigurationExceptionprivate void readSingleValueField(AdsBaseBean bean, java.lang.reflect.Field beanField, org.apache.directory.api.ldap.model.entry.Attribute fieldAttr) throws ConfigurationException
ConfigurationExceptionprivate void readMultiValuedField(AdsBaseBean bean, java.lang.reflect.Field field, org.apache.directory.api.ldap.model.entry.Attribute attribute) throws ConfigurationException
ConfigurationExceptionprivate void readFieldValue(AdsBaseBean bean, java.lang.reflect.Field field, org.apache.directory.api.ldap.model.entry.Entry entry, java.lang.String attributeTypeName, boolean mandatory) throws ConfigurationException
ConfigurationExceptionpublic java.util.List<AdsBaseBean> read(org.apache.directory.api.ldap.model.name.Dn baseDn, java.lang.String name, org.apache.directory.api.ldap.model.message.SearchScope scope, boolean mandatory) throws ConfigurationException
ConfigurationExceptionpublic AdsBaseBean readConfig(org.apache.directory.api.ldap.model.entry.Entry entry) throws java.lang.Exception
entry - any configuration entry of thetype "ads-base"java.lang.Exceptionprivate boolean isMultiple(java.lang.Class<?> clazz)
clazz - the classtrue if the given is multiple,
false if not.public ConfigBean readConfig() throws org.apache.directory.api.ldap.model.exception.LdapException
This method implicitly uses "ou=config" as base Dn
ConfigurationException - If we had some issue reading the configurationorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic ConfigBean readConfig(java.lang.String baseDn) throws org.apache.directory.api.ldap.model.exception.LdapException
base - The base Dn in the DIT where the configuration is storedConfigurationException - If we had some issue reading the configurationorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic ConfigBean readConfig(org.apache.directory.api.ldap.model.name.Dn baseDn) throws ConfigurationException
base - The base Dn in the DIT where the configuration is storedConfigurationException - If we had some issue reading the configurationpublic ConfigBean readConfig(java.lang.String baseDn, java.lang.String objectClass) throws org.apache.directory.api.ldap.model.exception.LdapException
baseDn - The base Dn in the DIT where the configuration is storedobjectClass - The element to read from the DITConfigurationExceptionorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic ConfigBean readConfig(org.apache.directory.api.ldap.model.name.Dn baseDn, java.lang.String objectClass) throws ConfigurationException
baseDn - The base Dn in the DIT where the configuration is storedobjectClass - The element to read from the DITConfigurationException