You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by go...@apache.org on 2011/12/01 16:01:14 UTC
svn commit: r1209113 - in
/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component:
./ hub/ hub/client/ instance/ schema/ utilities/
Author: gokturk
Date: Thu Dec 1 15:01:13 2011
New Revision: 1209113
URL: http://svn.apache.org/viewvc?rev=1209113&view=rev
Log:
Package changes for component-hub.
* hub.clients are no longer needed in config partition based design. Their contents are merged with hub.instance and hub.schema packages.
* Helpers and constants are moved into hub.utilities package.
Added:
directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/instance/DefaultComponentInstanceGenerator.java
directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/schema/DefaultComponentSchemaGenerator.java
directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/
directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSComponentHelper.java
directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSConstants.java
Removed:
directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/ADSComponentHelper.java
directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/ADSConstants.java
directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/client/
Modified:
directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/ADSComponent.java
directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentCacheManager.java
directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentHub.java
Modified: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/ADSComponent.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/ADSComponent.java?rev=1209113&r1=1209112&r2=1209113&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/ADSComponent.java (original)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/ADSComponent.java Thu Dec 1 15:01:13 2011
@@ -60,9 +60,14 @@ public class ADSComponent
private String componentVersion;
/*
- * List holding all the created instances of that component
+ * List holding all the created instances.
*/
- private List<ADSComponentInstance> instances;
+ private List<ADSComponentInstance> activeInstances;
+
+ /*
+ * List holding all the cached instances.
+ */
+ private List<ADSComponentInstance> cachedInstances;
/*
* cache handle for pointing places in the cache for that component.
@@ -89,7 +94,7 @@ public class ADSComponent
{
this.componentManager = componentManager;
- instances = new ArrayList<ADSComponentInstance>();
+ activeInstances = new ArrayList<ADSComponentInstance>();
}
@@ -100,7 +105,7 @@ public class ADSComponent
*/
public void addInstance( ADSComponentInstance instance )
{
- instances.add( instance );
+ activeInstances.add( instance );
}
@@ -111,7 +116,7 @@ public class ADSComponent
*/
public void removeInstance( ADSComponentInstance instance )
{
- instances.remove( instance );
+ activeInstances.remove( instance );
}
@@ -122,7 +127,7 @@ public class ADSComponent
*/
public List<ADSComponentInstance> getInstances()
{
- return new ArrayList<ADSComponentInstance>( instances );
+ return new ArrayList<ADSComponentInstance>( activeInstances );
}
Modified: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentCacheManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentCacheManager.java?rev=1209113&r1=1209112&r2=1209113&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentCacheManager.java (original)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentCacheManager.java Thu Dec 1 15:01:13 2011
@@ -39,8 +39,8 @@ import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.directory.server.component.ADSComponent;
import org.apache.directory.server.component.ADSComponentCacheHandle;
-import org.apache.directory.server.component.ADSConstants;
import org.apache.directory.server.component.instance.ADSComponentInstance;
+import org.apache.directory.server.component.utilities.ADSConstants;
import org.apache.directory.shared.ldap.model.exception.LdapException;
import org.apache.directory.shared.ldap.model.ldif.LdapLdifException;
import org.apache.directory.shared.ldap.model.ldif.LdifEntry;
Modified: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentHub.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentHub.java?rev=1209113&r1=1209112&r2=1209113&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentHub.java (original)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/hub/ComponentHub.java Thu Dec 1 15:01:13 2011
@@ -27,14 +27,14 @@ import java.util.Hashtable;
import java.util.List;
import org.apache.directory.server.component.ADSComponent;
-import org.apache.directory.server.component.ADSComponentHelper;
-import org.apache.directory.server.component.ADSConstants;
-import org.apache.directory.server.component.hub.client.user.UserComponentInstanceGenerator;
-import org.apache.directory.server.component.hub.client.user.UserComponentSchemaGenerator;
import org.apache.directory.server.component.hub.listener.HubListener;
import org.apache.directory.server.component.instance.ADSComponentInstanceGenerator;
+import org.apache.directory.server.component.instance.DefaultComponentInstanceGenerator;
import org.apache.directory.server.component.schema.ADSComponentSchema;
import org.apache.directory.server.component.schema.ComponentSchemaGenerator;
+import org.apache.directory.server.component.schema.DefaultComponentSchemaGenerator;
+import org.apache.directory.server.component.utilities.ADSComponentHelper;
+import org.apache.directory.server.component.utilities.ADSConstants;
import org.apache.directory.server.core.api.interceptor.Interceptor;
import org.apache.felix.ipojo.Factory;
import org.apache.felix.ipojo.annotations.Component;
Added: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/instance/DefaultComponentInstanceGenerator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/instance/DefaultComponentInstanceGenerator.java?rev=1209113&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/instance/DefaultComponentInstanceGenerator.java (added)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/instance/DefaultComponentInstanceGenerator.java Thu Dec 1 15:01:13 2011
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.server.component.instance;
+
+
+import java.util.Properties;
+
+import org.apache.directory.server.component.ADSComponent;
+import org.apache.directory.server.component.schema.DefaultComponentSchemaGenerator;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.architecture.PropertyDescription;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Class that generates an instances of "user" typed components.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class DefaultComponentInstanceGenerator implements ADSComponentInstanceGenerator
+{
+
+ private final Logger LOG = LoggerFactory.getLogger( DefaultComponentSchemaGenerator.class );
+
+
+ /*
+ * (non-Javadoc)
+ * @see org.apache.directory.server.component.instance.ADSComponentInstanceGenerator#createInstance(org.apache.directory.server.component.ADSComponent)
+ */
+ @Override
+ public ADSComponentInstance createInstance( ADSComponent component, Properties properties )
+ {
+ if ( properties == null && component.getDefaultConfiguration() == null )
+ {
+ component.setDefaultConfiguration( extractDefaultConfiguration( component ) );
+ properties = component.getDefaultConfiguration();
+ }
+
+ // TODO Auto-generated method stub
+
+ //Remember to set configuration of the instance here...
+ return null;
+ }
+
+
+ @Override
+ public Properties extractDefaultConfiguration( ADSComponent component )
+ {
+ Properties defaultConf = new Properties();
+
+ for ( PropertyDescription prop : component.getFactory().getComponentDescription().getProperties() )
+ {
+
+ //Must be lower case, alphanumeric+'-' only
+ String propname = prop.getName();
+
+ String propvalue = prop.getValue();
+ String proptype = prop.getType();
+
+ if ( !( proptype.equals( "int" ) || proptype.equals( "java.lang.String" ) || proptype
+ .equals( "boolean" ) ) )
+ {
+ LOG.info( "Property found with an incompatible type: "
+ + propname + ":" + proptype );
+ continue;
+ }
+
+ if ( propvalue != null )
+ {
+ defaultConf.put( propname, propvalue );
+ }
+
+ }
+
+ return defaultConf;
+
+ }
+
+}
Added: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/schema/DefaultComponentSchemaGenerator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/schema/DefaultComponentSchemaGenerator.java?rev=1209113&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/schema/DefaultComponentSchemaGenerator.java (added)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/schema/DefaultComponentSchemaGenerator.java Thu Dec 1 15:01:13 2011
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.server.component.schema;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.directory.server.component.utilities.ADSComponentHelper;
+import org.apache.directory.server.component.utilities.ADSConstants;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidAttributeValueException;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.model.ldif.LdapLdifException;
+import org.apache.directory.shared.ldap.model.ldif.LdifEntry;
+import org.apache.felix.ipojo.Factory;
+import org.apache.felix.ipojo.architecture.PropertyDescription;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class DefaultComponentSchemaGenerator implements ComponentSchemaGenerator
+{
+ private final Logger LOG = LoggerFactory.getLogger( DefaultComponentSchemaGenerator.class );
+
+ private final String ADS_USER_COMPONENTS_SCHEMA_DN = "cn=usercomponents,ou=schema";
+ private final String ADS_USER_COMPONENTS_SCHEMA_NAME = "usercomponents";
+
+
+ @Override
+ public ADSComponentSchema generateADSComponentSchema( Factory componentFactory )
+ {
+ List<LdifEntry> schemaElements = new ArrayList<LdifEntry>();
+
+ String componentName = ADSComponentHelper.getComponentName( componentFactory );
+
+ String attribsDn = "ou=attributeTypes," + ADS_USER_COMPONENTS_SCHEMA_DN;
+ String ocsDn = "ou=objectClasses," + ADS_USER_COMPONENTS_SCHEMA_DN;
+
+ //Will hold the m-must attributes while iterating over properties of the component
+ List<String> ocAttribs = new ArrayList<String>();
+
+ // Creating schema elements with proper order and pushing them into the list
+ try
+ {
+
+ String componentBaseOID = ComponentOIDGenerator.generateComponentOID();
+
+ for ( PropertyDescription prop : componentFactory.getComponentDescription().getProperties() )
+ {
+
+ //Must be lower case, alphanumeric+'-' only
+ String propname = prop.getName();
+
+ String proptype = prop.getType();
+ String propoid = ComponentOIDGenerator.generateAttribOID( componentBaseOID );
+ String propdn = "m-oid=" + propoid + "," + attribsDn;
+
+ if ( !( proptype.equals( "int" ) || proptype.equals( "java.lang.String" ) || proptype
+ .equals( "boolean" ) ) )
+ {
+ LOG.info( "Property found with an incompatible type: "
+ + propname + ":" + proptype );
+ continue;
+ }
+
+ String syntax = ADSConstants.syntaxMappings.get( proptype );
+ String equality = ADSConstants.equalityMappings.get( proptype );
+ String ordering = ADSConstants.orderingMappings.get( proptype );
+ String substr = ADSConstants.substringMappings.get( proptype );
+
+ schemaElements.add( new LdifEntry( propdn,
+ "objectclass:metaAttributeType",
+ "objectclass:metaTop",
+ "objectclass:top",
+ "m-oid:" + propoid,
+ "m-name:" + propname,
+ "m-description:Property of component type " + componentName,
+ "m-equality:" + equality,
+ "m-ordering:" + ordering,
+ "m-substr:" + substr,
+ "m-syntax:" + syntax,
+ "m-length:0",
+ "m-singleValue:TRUE" ) );
+
+ if ( prop.isMandatory() )
+ {
+ ocAttribs.add( "m-must:" + propname );
+ }
+ else
+ {
+ ocAttribs.add( "m-may:" + propname );
+ }
+
+ }
+
+ schemaElements.add( new LdifEntry( ocsDn,
+ "objectclass:organizationalUnit",
+ "objectClass:top",
+ "ou:objectClasses" ) );
+
+ String ocoid = ComponentOIDGenerator.generateOCOID( componentBaseOID );
+ String ocDn = "m-oid=" + ocoid + "," + ocsDn;
+
+ ocAttribs.add( 0, "m-may:cached" );
+ ocAttribs.add( 0, "m-must:ins" );
+ ocAttribs.add( 0, "m-must:active" );
+ ocAttribs.add( 0, "m-supObjectClass: top" );
+ ocAttribs.add( 0, "m-description:Object Class for generating instances of:" + componentName );
+ ocAttribs.add( 0, "m-name:" + componentName );
+ ocAttribs.add( 0, "m-oid:" + ocoid );
+ ocAttribs.add( 0, "objectclass: top" );
+ ocAttribs.add( 0, "objectclass: metaTop" );
+ ocAttribs.add( 0, "objectclass: metaObjectClass" );
+
+ schemaElements.add( new LdifEntry( ocDn, ocAttribs.toArray() ) );
+
+ }
+ catch ( LdapInvalidAttributeValueException e )
+ {
+ LOG.info( "ADSSchemaManager#generateSchema: Error(LdapInvalidAttributeValueException) while creating LdifEntry for: "
+ + componentFactory );
+ }
+ catch ( LdapInvalidDnException e )
+ {
+ LOG.info( "ADSSchemaManager#generateSchema: Error(LdapInvalidDnException) while creating LdifEntry for: "
+ + componentFactory );
+ }
+ catch ( LdapLdifException e )
+ {
+ LOG.info( "ADSSchemaManager#generateSchema: Error(LdapLdifException) while creating LdifEntry for: "
+ + componentFactory );
+ }
+
+ ADSComponentSchema compSchema = new ADSComponentSchema( ADS_USER_COMPONENTS_SCHEMA_NAME,
+ schemaElements, componentName );
+
+ return compSchema;
+ }
+
+}
Added: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSComponentHelper.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSComponentHelper.java?rev=1209113&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSComponentHelper.java (added)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSComponentHelper.java Thu Dec 1 15:01:13 2011
@@ -0,0 +1,54 @@
+package org.apache.directory.server.component.utilities;
+
+
+import org.apache.commons.io.IOUtils;
+import org.apache.felix.ipojo.Factory;
+
+
+/**
+ * This class has static helper methods that will be used by the other parts of the program.
+ * These methods mainly affects the layout of the program. So by using these methods, program parts
+ * can be work in uniform design.
+ *
+ *
+ * @author gokturk
+ */
+public class ADSComponentHelper
+{
+ /**
+ * Gets the component name of an IPojo Component. If IPojo Component does not define its factory name
+ * its default factory name is the class name that implements that component. In this case this method leaves out
+ * the package name and only takes the class name.
+ *
+ * @param componentFactory An IPojo Component Factory reference
+ * @return component name of an IPojo Component
+ */
+ public static String getComponentName( Factory componentFactory )
+ {
+ String factoryName = componentFactory.getName();
+ if ( factoryName.contains( "." ) )
+ {
+ return factoryName.substring( factoryName.lastIndexOf( '.' ) + 1 );
+ }
+ else
+ {
+ return factoryName;
+ }
+ }
+
+
+ /**
+ * Gets the version of the component. This version is the bundle version of the bundle that
+ * contains specified component.
+ *
+ * @param componentFactory An IPojo Component Factory reference
+ * @return version of an IPojo Component
+ */
+ public static String getComponentVersion( Factory componentFactory )
+ {
+ return ( String ) componentFactory.getBundleContext().getBundle().getHeaders().get( "Bundle-Version" );
+
+ }
+
+
+}
Added: directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSConstants.java?rev=1209113&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSConstants.java (added)
+++ directory/apacheds/branches/apacheds-osgi/component-hub/src/main/java/org/apache/directory/server/component/utilities/ADSConstants.java Thu Dec 1 15:01:13 2011
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.server.component.utilities;
+
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+
+/**
+ * Class to hold constants for ApacheDS component management.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class ADSConstants
+{
+
+ /*
+ * base directory path for component cache
+ */
+ public static final String ADS_CACHE_BASE_DIR = "adscache";
+
+ /*
+ * default file name for caching schemas inside for components
+ */
+ public static final String ADS_CACHE_SCHEMA_FILE = "schema-elements.ldif";
+
+ /*
+ * default file name for caching instance entries inside for components
+ */
+ public static final String ADS_CACHE_INSTANCES_DIR = "instance-configs";
+
+ /*
+ * default file name for caching version information for components
+ */
+ public static final String ADS_CACHE_VERSION_FILE = "version";
+
+ /*
+ * IPojo Handler name for ADSComponent annotation.
+ */
+ public static final String ADS_COMPONENT_HANDLER_NS = "org.apache.directory.server.component.handler";
+
+ /*
+ * IPojo Handler name for ADSComponent annotation.
+ */
+ public static final String ADS_COMPONENT_HANDLER_NAME = "ADSComponentHandler";
+
+ /*
+ * IPojo Handler name for ADSComponent annotation.
+ */
+ public static final String ADS_COMPONENT_HANDLER_FULLNAME = "org.apache.directory.server.component.handler:ADSComponentHandler";
+
+ /*
+ * iPOJO Component Type and Instance declaration header.
+ */
+ public static final String IPOJO_HEADER = "iPOJO-Components";
+
+ /*
+ * Base OID value for ApacheDS component schemas.
+ */
+ public static final String ADS_COMPONENT_BASE_OID = "1.3.6.1.4.1.18060.0.4.4";
+
+ /*
+ * Component type name of user defined components.
+ */
+ public static final String ADS_COMPONENT_TYPE_USER = "user";
+
+ /*
+ * Hash table for mapping property type name to its syntax in ApacheDS
+ */
+ public static Dictionary<String, String> syntaxMappings;
+
+ /*
+ * Hash table for mapping property type name to its equality matching rule in ApacheDS
+ */
+ public static Dictionary<String, String> equalityMappings;
+
+ /*
+ * Hash table for mapping property type name to its ordering rule in ApacheDS
+ */
+ public static Dictionary<String, String> orderingMappings;
+
+ /*
+ * Hash table for mapping property type name to its substring matching in ApacheDS
+ */
+ public static Dictionary<String, String> substringMappings;
+
+ /**
+ * Static constructor that initializes the values of the type mapping Hash tables.
+ */
+ static
+ {
+ syntaxMappings = new Hashtable<String, String>();
+ syntaxMappings.put( "int", "1.3.6.1.4.1.1466.115.121.1.27" );
+ syntaxMappings.put( "java.lang.String", "1.3.6.1.4.1.1466.115.121.1.15" );
+ syntaxMappings.put( "boolean", "1.3.6.1.4.1.1466.115.121.1.7" );
+
+ equalityMappings = new Hashtable<String, String>();
+ equalityMappings.put( "int", "integerMatch" );
+ equalityMappings.put( "java.lang.String", "caseExactMatch" );
+ equalityMappings.put( "boolean", "booleanMatch" );
+
+ orderingMappings = new Hashtable<String, String>();
+ orderingMappings.put( "int", "integerOrderingMatch" );
+ orderingMappings.put( "java.lang.String", "caseExactOrderingMatch" );
+ orderingMappings.put( "boolean", "caseIgnoreOrderingMatch" );
+
+ substringMappings = new Hashtable<String, String>();
+ substringMappings.put( "int", "numericStringSubstringsMatch" );
+ substringMappings.put( "java.lang.String", "caseExactSubstringsMatch" );
+ substringMappings.put( "boolean", "caseIgnoreSubstringsMatch" );
+ }
+
+}