public void setHierarchyIndexOn( AttributeType attrType, int cacheSize, int numDupLimit ) throws NamingException { if ( hierarchyIdx != null ) { NamingException e = new NamingException( "Index already set!" ); throw e; } hierarchyIdx = new JdbmIndex( attrType, workingDirectory, cacheSize, numDupLimit ); sysIndices.put( attrType.getOid(), hierarchyIdx ); }
public void setNdnIndexOn( AttributeType attrType, int cacheSize, int numDupLimit ) throws NamingException { if ( ndnIdx != null ) { NamingException e = new NamingException( "Index already set!" ); throw e; } ndnIdx = new JdbmIndex( attrType, workingDirectory, cacheSize, numDupLimit ); sysIndices.put( attrType.getOid(), ndnIdx ); }
public void setExistanceIndexOn( AttributeType attrType, int cacheSize, int numDupLimit ) throws NamingException { if ( existanceIdx != null ) { NamingException e = new NamingException( "Index already set!" ); throw e; } existanceIdx = new JdbmIndex( attrType, workingDirectory, cacheSize, numDupLimit ); sysIndices.put( attrType.getOid(), existanceIdx ); }
public void setSubAliasIndexOn( AttributeType attrType, int cacheSize, int numDupLimit ) throws NamingException { if ( subAliasIdx != null ) { NamingException e = new NamingException( "Index already set!" ); throw e; } subAliasIdx = new JdbmIndex( attrType, workingDirectory, cacheSize, numDupLimit ); sysIndices.put( attrType.getOid(), subAliasIdx ); }
/** * Add a new set of index on the given attributes * * @param partition The partition on which we want to add index * @param attrs The list of attributes to index */ private void addIndex(Partition partition, String... attrs) { HashSet<Index<?, ServerEntry, Long>> indexedAttributes = new HashSet<Index<?, ServerEntry, Long>>(); for (String attribute : attrs) { indexedAttributes.add(new JdbmIndex<String, ServerEntry>(attribute)); } ((JdbmPartition) partition).setIndexedAttributes(indexedAttributes); }//addIndex
public void addIndexOn( AttributeType spec, int cacheSize, int numDupLimit ) throws NamingException { Index idx = new JdbmIndex( spec, workingDirectory, cacheSize, numDupLimit ); indices.put( spec.getOid(), idx ); }
public void setAliasIndexOn( AttributeType attrType, int cacheSize, int numDupLimit ) throws NamingException { if ( aliasIdx != null ) { NamingException e = new NamingException( "Index already set!" ); throw e; } aliasIdx = new JdbmIndex( attrType, workingDirectory, cacheSize, numDupLimit ); sysIndices.put( attrType.getOid(), aliasIdx ); }
public void setOneAliasIndexOn( AttributeType attrType, int cacheSize, int numDupLimit ) throws NamingException { if ( oneAliasIdx != null ) { NamingException e = new NamingException( "Index already set!" ); throw e; } oneAliasIdx = new JdbmIndex( attrType, workingDirectory, cacheSize, numDupLimit ); sysIndices.put( attrType.getOid(), oneAliasIdx ); }
public void setUpdnIndexOn( AttributeType attrType, int cacheSize, int numDupLimit ) throws NamingException { if ( updnIdx != null ) { NamingException e = new NamingException( "Index already set!" ); throw e; } updnIdx = new JdbmIndex( attrType, workingDirectory, cacheSize, numDupLimit ); sysIndices.put( attrType.getOid(), updnIdx ); }
new HashSet<Index<?, ServerEntry, Long>>(); indexedAttrs.add(new JdbmIndex<String, ServerEntry>("1.3.6.1.4.1.18060.0.4.1.2.1")); indexedAttrs.add(new JdbmIndex<String, ServerEntry>("1.3.6.1.4.1.18060.0.4.1.2.2")); indexedAttrs.add(new JdbmIndex<String, ServerEntry>("1.3.6.1.4.1.18060.0.4.1.2.3")); indexedAttrs.add(new JdbmIndex<String, ServerEntry>("1.3.6.1.4.1.18060.0.4.1.2.4")); indexedAttrs.add(new JdbmIndex<String, ServerEntry>("1.3.6.1.4.1.18060.0.4.1.2.5")); indexedAttrs.add(new JdbmIndex<String, ServerEntry>("1.3.6.1.4.1.18060.0.4.1.2.6")); indexedAttrs.add(new JdbmIndex<String, ServerEntry>("1.3.6.1.4.1.18060.0.4.1.2.7")); indexedAttrs.add(new JdbmIndex<String, ServerEntry>("ou")); indexedAttrs.add(new JdbmIndex<String, ServerEntry>("dc")); indexedAttrs.add(new JdbmIndex<String, ServerEntry>("objectClass")); indexedAttrs.add(new JdbmIndex<String, ServerEntry>("cn")); indexedAttrs.add(new JdbmIndex<String, ServerEntry>("uid")); partition.setIndexedAttributes(indexedAttrs);
/** * {@inheritDoc} */ public void addIndex( Partition partition, String attributeId, int cacheSize ) throws Exception { if ( !( partition instanceof JdbmPartition ) ) { throw new IllegalArgumentException( "Partition must be a JdbmPartition" ); } JdbmPartition jdbmPartition = ( JdbmPartition ) partition; Set<Index<?, String>> indexedAttributes = jdbmPartition.getIndexedAttributes(); JdbmIndex<Object> index = new JdbmIndex<Object>( attributeId, false ); index.setCacheSize( cacheSize ); indexedAttributes.add( index ); jdbmPartition.setIndexedAttributes( indexedAttributes ); }
/** * Add a new set of index on the given attributes * * @param partition The partition on which we want to add index * @param attrs The list of attributes to index */ private void addIndex(Partition partition, String... attrs) { // Index some attributes on the apache partition HashSet<Index<?, ServerEntry, Long>> indexedAttributes = new HashSet<Index<?, ServerEntry, Long>>(); for (String attribute : attrs) { indexedAttributes.add(new JdbmIndex<String, ServerEntry>(attribute)); } ((JdbmPartition) partition).setIndexedAttributes(indexedAttributes); }
/** * Add a new set of index on the given attributes * * @param partition The partition on which we want to add index * @param attrs The list of attributes to index */ private void addIndex(Partition partition, String... attrs) { // Index some attributes on the apache partition HashSet<Index<?, ServerEntry, Long>> indexedAttributes = new HashSet<>(); for (String attribute : attrs) { indexedAttributes.add(new JdbmIndex<String, ServerEntry>(attribute)); } ((JdbmPartition) partition).setIndexedAttributes(indexedAttributes); }
/** * {@inheritDoc} */ @Override protected final Index createSystemIndex( String oid, URI path, boolean withReverse ) throws LdapException { LOG.debug( "Supplied index {} is not a JdbmIndex. " + "Will create new JdbmIndex using copied configuration parameters." ); JdbmIndex<?> jdbmIndex; if ( oid.equals( ApacheSchemaConstants.APACHE_RDN_AT_OID ) ) { jdbmIndex = new JdbmRdnIndex(); jdbmIndex.setAttributeId( ApacheSchemaConstants.APACHE_RDN_AT_OID ); jdbmIndex.setNumDupLimit( JdbmIndex.DEFAULT_DUPLICATE_LIMIT ); } else if ( oid.equals( ApacheSchemaConstants.APACHE_ALIAS_AT_OID ) ) { jdbmIndex = new JdbmDnIndex( ApacheSchemaConstants.APACHE_ALIAS_AT_OID ); jdbmIndex.setAttributeId( ApacheSchemaConstants.APACHE_ALIAS_AT_OID ); jdbmIndex.setNumDupLimit( JdbmIndex.DEFAULT_DUPLICATE_LIMIT ); } else { jdbmIndex = new JdbmIndex( oid, withReverse ); jdbmIndex.setNumDupLimit( JdbmIndex.DEFAULT_DUPLICATE_LIMIT ); } jdbmIndex.setWkDirPath( path ); return jdbmIndex; }
jdbmIndex = new JdbmIndex( index.getAttributeId(), true ); jdbmIndex.setCacheSize( index.getCacheSize() ); jdbmIndex.setNumDupLimit( JdbmIndex.DEFAULT_DUPLICATE_LIMIT );
index = new JdbmIndex<>( jdbmIndexBean.getIndexAttributeId(), hasReverse );