public Partition getPartition( LdapDN dn ) throws NamingException { return getBackend( dn ); }
initializedPartitionCfgs.add( initializeSystemPartition() ); addContextPartition( c ); initializedPartitionCfgs.add( 0, c ); unregister( partition );
public synchronized void shutdown() throws NamingException { if ( !started ) { return; } serviceListener.beforeShutdown( this ); try { this.partitionNexus.sync(); this.partitionNexus.destroy(); this.interceptorChain.destroy(); this.started = false; } finally { serviceListener.afterShutdown( this ); environment = null; interceptorChain = null; startupConfiguration = null; } }
partitionNexus = new DefaultPartitionNexus( new LockableAttributesImpl() ); partitionNexus.init( configuration, null );
SearchResult result = new SearchResult( "", null, ( Attributes ) getRootDSE().clone(), false ); return new SingletonEnumeration( result ); SearchResult result = new SearchResult( "", null, ( Attributes ) getRootDSE().clone(), false ); return new SingletonEnumeration( result ); if ( containsAsterisk ) for ( NamingEnumeration ii = getRootDSE().getAll(); ii.hasMore(); /**/ ) for ( NamingEnumeration ii = getRootDSE().getAll(); ii.hasMore(); /**/ ) for ( NamingEnumeration ii = getRootDSE().getAll(); ii.hasMore(); /**/ ) Partition backend = getBackend( base ); return backend.search( base, env, filter, searchCtls );
if ( !partitionNexus.hasEntry( PartitionNexus.getAdminName() ) ) partitionNexus.add(PartitionNexus.getAdminName(), attributes ); if ( !partitionNexus.hasEntry( userDn ) ) partitionNexus.add( userDn, attributes ); if ( !partitionNexus.hasEntry( groupDn ) ) partitionNexus.add( groupDn, attributes ); if ( !partitionNexus.hasEntry( normName ) ) partitionNexus.add(normName, attributes ); if ( !partitionNexus.hasEntry( configurationDn ) ) partitionNexus.add( configurationDn, attributes ); if ( !partitionNexus.hasEntry( partitionsDn ) ) partitionNexus.add( partitionsDn, attributes ); if ( !partitionNexus.hasEntry( servicesDn ) ) partitionNexus.add( servicesDn, attributes );
/** * Displays security warning messages if any possible secutiry issue is found. */ private void showSecurityWarnings() throws NamingException { // Warn if the default password is not changed. boolean needToChangeAdminPassword = false; LdapDN adminDn = new LdapDN( PartitionNexus.ADMIN_PRINCIPAL ); adminDn.normalize( configuration.getGlobalRegistries().getAttributeTypeRegistry().getNormalizerMapping() ); Attributes adminEntry = partitionNexus.lookup( adminDn ); Object userPassword = adminEntry.get( "userPassword" ).get(); if ( userPassword instanceof byte[] ) { needToChangeAdminPassword = PartitionNexus.ADMIN_PASSWORD.equals( new String( ( byte[] ) userPassword ) ); } else if ( userPassword.toString().equals( PartitionNexus.ADMIN_PASSWORD ) ) { needToChangeAdminPassword = PartitionNexus.ADMIN_PASSWORD.equals( userPassword.toString() ); } if ( needToChangeAdminPassword ) { log.warn( "You didn't change the admin password of directory service " + "instance '" + instanceId + "'. " + "Please update the admin password as soon as possible " + "to prevent a possible security breach." ); } }
/** * @see PartitionNexus#getMatchedName(org.apache.directory.shared.ldap.name.LdapDN) */ public LdapDN getMatchedName ( LdapDN dn ) throws NamingException { dn = ( LdapDN ) dn.clone(); while ( dn.size() > 0 ) { if ( hasEntry( dn ) ) { return dn; } dn.remove( dn.size() - 1 ); } return dn; }
/** * @see PartitionNexus#getSuffix(org.apache.directory.shared.ldap.name.LdapDN) */ public LdapDN getSuffix ( LdapDN dn ) throws NamingException { Partition backend = getBackend( dn ); return backend.getSuffix(); }
/** * @see Partition#delete(org.apache.directory.shared.ldap.name.LdapDN) */ public void delete( LdapDN dn ) throws NamingException { Partition backend = getBackend( dn ); backend.delete( dn ); }
/** * @see Partition#move(org.apache.directory.shared.ldap.name.LdapDN,org.apache.directory.shared.ldap.name.LdapDN,String,boolean) */ public void move( LdapDN oldChildDn, LdapDN newParentDn, String newRdn, boolean deleteOldRdn ) throws NamingException { Partition backend = getBackend( oldChildDn ); backend.move( oldChildDn, newParentDn, newRdn, deleteOldRdn ); }
public void unbind( LdapDN bindDn ) throws NamingException { Partition partition = getBackend( bindDn ); partition.unbind( bindDn ); }
/** * @see Partition#modify(org.apache.directory.shared.ldap.name.LdapDN,int,javax.naming.directory.Attributes) */ public void modify( LdapDN dn, int modOp, Attributes mods ) throws NamingException { Partition backend = getBackend( dn ); backend.modify( dn, modOp, mods ); }
/** * @see Partition#modify(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.ModificationItem[]) */ public void modify( LdapDN dn, ModificationItemImpl[] mods ) throws NamingException { Partition backend = getBackend( dn ); backend.modify( dn, mods ); }
public void bind( LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException { Partition partition = getBackend( bindDn ); partition.bind( bindDn, credentials, mechanisms, saslAuthId ); }
/** * @see Partition#list(org.apache.directory.shared.ldap.name.LdapDN) */ public NamingEnumeration list( LdapDN base ) throws NamingException { Partition backend = getBackend( base ); return backend.list( base ); }
/** * @see Partition#modifyRn(org.apache.directory.shared.ldap.name.LdapDN,String,boolean) */ public void modifyRn( LdapDN dn, String newRdn, boolean deleteOldRdn ) throws NamingException { Partition backend = getBackend( dn ); backend.modifyRn( dn, newRdn, deleteOldRdn ); }
/** * @see Partition#move(org.apache.directory.shared.ldap.name.LdapDN,org.apache.directory.shared.ldap.name.LdapDN) */ public void move( LdapDN oriChildName, LdapDN newParentName ) throws NamingException { Partition backend = getBackend( oriChildName ); backend.move( oriChildName, newParentName ); }
/** * Looks up the backend corresponding to the entry first, then checks to * see if the entry already exists. If so an exception is thrown. If not * the add operation against the backend proceeds. This check is performed * here so backend implementors do not have to worry about performing these * kinds of checks. * * @see Partition#add(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.Attributes) */ public void add( LdapDN dn, Attributes entry ) throws NamingException { Partition backend = getBackend( dn ); backend.add( dn, entry ); }
/** * @see Partition#hasEntry(org.apache.directory.shared.ldap.name.LdapDN) */ public boolean hasEntry( LdapDN dn ) throws NamingException { if ( IS_DEBUG ) { log.debug( "Check if DN '" + dn + "' exists." ); } if ( dn.size() == 0 ) { return true; } Partition backend = getBackend( dn ); return backend.hasEntry( dn ); }