public void add(NextInterceptor next, LdapDN normName, Attributes entry) throws NamingException { nexus.add( normName, entry ); }
public LdapDN getMatchedName ( NextInterceptor next, LdapDN dn ) throws NamingException { return ( LdapDN ) nexus.getMatchedName( dn ).clone(); }
private void initialize() throws NamingException { // search all naming contexts for access control subentenries // generate ACITuple Arrays for each subentry // add that subentry to the hash Iterator suffixes = nexus.listSuffixes(); while ( suffixes.hasNext() ) { String suffix = ( String ) suffixes.next(); LdapDN baseDn = parseNormalized( suffix ); ExprNode filter = new SimpleNode( OC_ATTR, ACSUBENTRY_OC, SimpleNode.EQUALITY ); SearchControls ctls = new SearchControls(); ctls.setSearchScope( SearchControls.SUBTREE_SCOPE ); NamingEnumeration results = nexus.search( baseDn, env, filter, ctls ); while ( results.hasMore() ) { SearchResult result = ( SearchResult ) results.next(); String subentryDn = result.getName(); Attribute aci = result.getAttributes().get( ACI_ATTR ); if ( aci == null ) { log.warn( "Found accessControlSubentry '" + subentryDn + "' without any " + ACI_ATTR ); continue; } LdapDN normName = parseNormalized( subentryDn ); subentryAdded( subentryDn, normName, result.getAttributes() ); } results.close(); } }
public void delete( NextInterceptor next, LdapDN name ) throws NamingException Attributes entry = nexus.lookup( name ); Attribute objectClasses = ServerUtils.getAttribute( objectClassType, entry ); { "+", "*" } ); NamingEnumeration subentries = nexus.search( baseDn, factoryCfg.getEnvironment(), filter, controls ); while ( subentries.hasMore() ) nexus.modify( dn, getOperationalModsForRemove( name, candidate ) );
public Attributes lookup( NextInterceptor next, LdapDN name ) throws NamingException { return ( Attributes ) nexus.lookup( name ).clone(); }
public void modify( NextInterceptor next, LdapDN name, int modOp, Attributes mods ) throws NamingException { nexus.modify( name, modOp, mods ); }
new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService ); EntryFilteringCursor cursor = nexus.search( new SearchOperationContext( adminSession, contextName, AliasDerefMode.DEREF_ALWAYS, filter, ctrl ) ); ServerEntry entry = nexus.lookup( new LookupOperationContext( adminSession, name ) ); LOG.info( "[Replica-{}] Purge: " + name + " (" + entry + ')', configuration.getReplicaId() ); nexus.delete( new DeleteOperationContext( adminSession, name ) );
public NamingEnumeration search( NextInterceptor next, LdapDN base, Map env, ExprNode filter, SearchControls searchCtls ) throws NamingException { return nexus.search( base, env, filter, searchCtls ); }
public Attributes getRootDSE( NextInterceptor next ) throws NamingException { return nexus.getRootDSE(); }
/** * Inject the entry into the local server * * @param nexus the local partition to update * @param store not used... Just for inheritence sake. * @param coreSession the current session */ protected void execute0( PartitionNexus nexus, ReplicationStore store, CoreSession coreSession ) throws Exception { if ( ! EntryUtil.isEntryUpdatable( coreSession, entry.getDn(), getCSN() ) ) { return; } EntryUtil.createGlueEntries( coreSession, entry.getDn(), false ); // Replace the entry if an entry with the same name exists. if ( nexus.lookup( new LookupOperationContext( coreSession, entry.getDn() ) ) != null ) { recursiveDelete( nexus, entry.getDn(), coreSession ); } nexus.add( new AddOperationContext( coreSession, (ServerEntry)entry ) ); }
/** * Make sure the specified <tt>newEntryName</tt> already exists. It * checked {@link Constants#ENTRY_DELETED} additionally to see if the * entry actually exists in a {@link Partition} but maked as deleted. * * @param newEntryName makes sure an entry already exists. */ private void checkBeforeAdd( LdapDN newEntryName ) throws Exception { LdapDN adminDn = new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED ); adminDn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() ); CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), ds ); if ( nexus.hasEntry( new EntryOperationContext( adminSession, newEntryName ) ) ) { ServerEntry entry = nexus.lookup( new LookupOperationContext( adminSession, newEntryName ) ); EntryAttribute deleted = entry.get( Constants.ENTRY_DELETED ); Object value = deleted == null ? null : deleted.get(); /* * Check first if the entry has been marked as deleted before * throwing an exception and delete the entry if so and return * without throwing an exception. */ if ( value != null && "TRUE".equalsIgnoreCase( value.toString() ) ) { return; } throw new NameAlreadyBoundException( newEntryName.toString() + " already exists." ); } }
public void delete( NextInterceptor next, LdapDN name ) throws NamingException { nexus.delete( name ); }
public NamingEnumeration list( NextInterceptor next, LdapDN base ) throws NamingException { return nexus.list( base ); }
public boolean hasEntry( NextInterceptor next, LdapDN name ) throws NamingException { return nexus.hasEntry( name ); }
public void addContextPartition( NextInterceptor next, PartitionConfiguration cfg ) throws NamingException { nexus.addContextPartition( cfg ); }
public void modify( NextInterceptor next, LdapDN name, int modOp, Attributes mods ) throws NamingException Attributes entry = nexus.lookup( name ); Attributes oldEntry = (Attributes) AttributeUtils.toAttributesImpl( entry ).clone(); Attribute objectClasses = ServerUtils.getAttribute( objectClassType, entry ); controls.setReturningAttributes( new String[] { "+", "*" } ); NamingEnumeration subentries = nexus.search( oldBaseDn, factoryCfg.getEnvironment(), filter, controls ); while ( subentries.hasMore() ) nexus.modify( dn, getOperationalModsForRemove( name, candidate ) ); LdapDN newBaseDn = ( LdapDN ) apName.clone(); newBaseDn.addAll( ssNew.getBase() ); subentries = nexus.search( newBaseDn, factoryCfg.getEnvironment(), filter, controls ); while ( subentries.hasMore() ) nexus.modify( dn, getOperationalModsForAdd( candidate, operational ) ); Attributes newEntry = nexus.lookup( name ); nexus.modify(name, subentriesOpAttrMods);