/** * {@inheritDoc} */ @Override public Entry lookup( LookupOperationContext lookupContext ) throws LdapException { return session.getDirectoryService().getOperationManager().lookup( lookupContext ); }
/** * Creates a new instance of CramMd5CallbackHandler. * * @param ldapSession the mina IoSession * @param adminSession the admin session * @param bindRequest the bind message */ public CramMd5CallbackHandler( LdapSession ldapSession, CoreSession adminSession, BindRequest bindRequest ) { super( adminSession.getDirectoryService(), bindRequest ); this.ldapSession = ldapSession; this.adminSession = adminSession; schemaManager = adminSession.getDirectoryService().getSchemaManager(); }
/** * Creates a new instance of UnbindOperationContext. * * @param session The session to use */ public UnbindOperationContext( CoreSession session ) { super( session, session.getEffectivePrincipal().getDn() ); setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.UNBIND ) ); }
protected Dn getOperationPrincipal() throws LdapInvalidDnException { Principal principal = opContext.getSession().getEffectivePrincipal(); return opContext.getSession().getDirectoryService().getDnFactory().create( principal.getName() ); }
public void setDirectoryService( DirectoryService directoryService ) { this.directoryService = directoryService; this.schemaManager = directoryService.getSchemaManager(); this.session = directoryService.getAdminSession(); }
public static CoreSession getCoreSession( String principalDn, DirectoryService service, String dn ) throws LdapException { if ( principalDn == null ) { principalDn = ""; } Dn userDn = new Dn( service.getSchemaManager(), principalDn ); LdapPrincipal principal = new LdapPrincipal( service.getSchemaManager(), userDn, AuthenticationLevel.SIMPLE ); CoreSession session = service.getSession( principal ); return session; }
public SubentryUtils( DirectoryService directoryService ) { this.directoryService = directoryService; this.schemaManager = directoryService.getSchemaManager(); }
/** * {@inheritDoc} */ @Override public void delete( Dn dn ) throws LdapException { DeleteOperationContext deleteContext = new DeleteOperationContext( session, dn ); setup( deleteContext ); session.getDirectoryService().getOperationManager().delete( deleteContext ); }
/** * {@inheritDoc} */ @Override public void add( Entry entry, LogChange log ) throws LdapException { AddOperationContext addContext = new AddOperationContext( this, entry ); addContext.setLogChange( log ); OperationManager operationManager = directoryService.getOperationManager(); operationManager.add( addContext ); }
/** * {@inheritDoc} */ @Override public void delete( Dn dn, LogChange log ) throws LdapException { DeleteOperationContext deleteContext = new DeleteOperationContext( this, dn ); deleteContext.setLogChange( log ); OperationManager operationManager = directoryService.getOperationManager(); operationManager.delete( deleteContext ); }
/** * {@inheritDoc} */ @Override public void unbind() throws LdapException { UnbindOperationContext unbindContext = new UnbindOperationContext( this ); OperationManager operationManager = directoryService.getOperationManager(); operationManager.unbind( unbindContext ); }
/** * Initialize the CacheService * * @param layout The place on disk where the cache configuration will be stored */ public void initialize( InstanceLayout layout ) { initialize( layout, null ); }
/** * {@inheritDoc} */ @Override public Entry getRootDse() throws LdapException { return lookup( Dn.ROOT_DSE, SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY ); }
/** * Moves and renames the given entryDn.The old Rdn will be deleted * * @see #moveAndRename(org.apache.directory.api.ldap.model.name.Dn, org.apache.directory.api.ldap.model.name.Dn, boolean) */ @Override public void moveAndRename( Dn entryDn, Dn newDn ) throws LdapException { moveAndRename( entryDn, newDn, true ); }
/** * Creates a new instance of InstanceLayout. * * @param instanceDirectory the instance directory */ public InstanceLayout( File instanceDirectory ) { super( instanceDirectory ); init(); }
/** * {@inheritDoc} */ @Override public ExtendedResponse extended( Oid oid, byte[] value ) throws LdapException { return extended( ( String ) null ); }
public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException { // Return a safe copy constructed with user provided name. return opContext.getSession().getDirectoryService().getDnFactory().create( oldDn.getName() ); } };
/** * Creates a new instance of DigestMd5CallbackHandler. * * @param ldapSession the mina IoSession * @param adminSession the admin session * @param bindRequest the bind message */ public DigestMd5CallbackHandler( LdapSession ldapSession, CoreSession adminSession, BindRequest bindRequest ) { super( adminSession.getDirectoryService(), bindRequest ); this.ldapSession = ldapSession; this.adminSession = adminSession; schemaManager = adminSession.getDirectoryService().getSchemaManager(); }
/** * {@inheritDoc} */ @Override public Entry lookup( Dn dn ) throws LdapException { return lookup( dn, ( String[] ) null ); }
public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException { // Return a safe copy constructed with user provided name. return opContext.getSession().getDirectoryService().getDnFactory().create( oldSuperiorDn.getName() ); } };