@Override public DnFactory getDnFactory() { return wrapped.getDnFactory(); }
/** * This method does nothing by default. * * @param directoryService The DirectoryService instance * @throws LdapException If the initialization failed */ public void init( DirectoryService directoryService ) throws LdapException { // Initialize the fields that will be used by all the interceptors this.directoryService = directoryService; schemaManager = directoryService.getSchemaManager(); dnFactory = directoryService.getDnFactory(); finalInterceptor.init( directoryService ); }
public LdapClassLoader( DirectoryService directoryService ) throws LdapException { super( LdapClassLoader.class.getClassLoader() ); this.directoryService = directoryService; defaultSearchDn = directoryService.getDnFactory().create( DEFAULT_SEARCH_CONTEXTS_CONFIG ); objectClassAT = directoryService.getSchemaManager().getAttributeType( SchemaConstants.OBJECT_CLASS_AT ); }
private Partition createPartition(final String partitionId, final String partitionDn) throws Exception { return createPartition(this.service.getDnFactory(), partitionId, partitionDn, new File(service.getInstanceLayout().getPartitionsDirectory(), partitionId)); }
protected Dn getOperationPrincipal() throws LdapInvalidDnException { Principal principal = opContext.getSession().getEffectivePrincipal(); return opContext.getSession().getDirectoryService().getDnFactory().create( principal.getName() ); }
/** * Delete an existing consumer entry from ou=consumers,ou=system * * @param replica The added consumer replica * @throws LdapException If the addition failed */ public void deleteConsumerEntry( ReplicaEventLog replica ) throws LdapException { if ( replica == null ) { // No consumer ? Get out... return; } // Check that we have an entry for this consumer Dn consumerDn = directoryService.getDnFactory().create( SchemaConstants.ADS_DS_REPLICA_ID + "=" + replica.getId() + "," + replConsumerDn ); PROVIDER_LOG.debug( "Trying to delete the consumer entry {}", consumerDn ); if ( !adminSession.exists( consumerDn ) ) { // Error... String message = "The replica " + consumerDn.getName() + " does not exist"; LOG.error( message ); PROVIDER_LOG.debug( message ); return; } // Delete the consumer entry adminSession.delete( consumerDn ); LOG.debug( "Deleted replication consumer entry {}", consumerDn ); }
public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException { // Return a safe copy constructed with user provided name. return opContext.getSession().getDirectoryService().getDnFactory().create( newRdn.getName() ); } };
@Override public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException { // Return a safe copy constructed with user provided name. return opContext.getSession().getDirectoryService().getDnFactory().create( addedEntryName.getName() ); } };
public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException { // Return a safe copy constructed with user provided name. return opContext.getSession().getDirectoryService().getDnFactory().create( newSuperiorDn.getName() ); } };
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() ); } };
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() ); } };
public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException { // Return a safe copy constructed with user provided name. return opContext.getSession().getDirectoryService().getDnFactory().create( modifiedEntryName.getName() ); } };
public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapException { // Return a safe copy constructed with user provided name. return opContext.getSession().getDirectoryService().getDnFactory().create( deletedEntryName.getName() ); } };
public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException { // Return a safe copy constructed with user provided name. return opContext.getSession().getDirectoryService().getDnFactory().create( oldRdn.getName() ); } };
public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException { // Return a safe copy constructed with user provided name. return opContext.getSession().getDirectoryService().getDnFactory().create( newDn.getName() ); } };
/** * Create a new instance of the producer replication manager. * * @param directoryService The directoryService instance * @throws Exception if we add an error while creating the configuration */ public ReplConsumerManager( DirectoryService directoryService ) throws Exception { this.directoryService = directoryService; adminSession = directoryService.getAdminSession(); schemaManager = directoryService.getSchemaManager(); replConsumerDn = directoryService.getDnFactory().create( REPL_CONSUMER_DN_STR ); adsReplLastSentCsn = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ADS_REPL_LAST_SENT_CSN ); PROVIDER_LOG.debug( "Starting the replication consumer manager" ); createConsumersBranch(); }
/** * Inits the system partition. * * @throws Exception the exception */ private void initSystemPartition() throws Exception { // change the working directory to something that is unique // on the system and somewhere either under target directory // or somewhere in a temp area of the machine. // Inject the System Partition Partition systemPartition = partitionFactory.createPartition( directoryService.getSchemaManager(), directoryService.getDnFactory(), "system", ServerDNConstants.SYSTEM_DN, 500, new File( directoryService.getInstanceLayout().getPartitionsDirectory(), "system" ) ); systemPartition.setSchemaManager( directoryService.getSchemaManager() ); partitionFactory.addIndex( systemPartition, SchemaConstants.OBJECT_CLASS_AT, 100 ); directoryService.setSystemPartition( systemPartition ); }
/** * Creates a {@link JdbmPartition} with the given id and DN. * * @param id Id to create partition with. * @param dn Distinguished Name to use to create partition. * @return Created partition. */ private JdbmPartition createPartition(String id, Dn dn) throws LdapInvalidDnException { JdbmPartition partition = new JdbmPartition(service.getSchemaManager(), service.getDnFactory()); partition.setId(id); partition.setPartitionPath( new File(service.getInstanceLayout().getPartitionsDirectory(), id).toURI()); partition.setSuffixDn(dn); partition.setSchemaManager(service.getSchemaManager()); return partition; }
public static MavibotPartition createMavibotPartition( DirectoryService directoryService, MavibotPartitionBean mvbtPartitionBean ) throws ConfigurationException { if ( ( mvbtPartitionBean == null ) || mvbtPartitionBean.isDisabled() ) { return null; } MavibotPartition mvbtPartition = new MavibotPartition( directoryService.getSchemaManager(), directoryService.getDnFactory() ); mvbtPartition.setId( mvbtPartitionBean.getPartitionId() ); //mvbtPartition.setOptimizerEnabled( mvbtPartitionBean.isJdbmPartitionOptimizerEnabled() ); File partitionPath = new File( directoryService.getInstanceLayout().getPartitionsDirectory(), mvbtPartitionBean.getPartitionId() ); mvbtPartition.setPartitionPath( partitionPath.toURI() ); try { mvbtPartition.setSuffixDn( mvbtPartitionBean.getPartitionSuffix() ); } catch ( LdapInvalidDnException lide ) { String message = "Cannot set the Dn " + mvbtPartitionBean.getPartitionSuffix() + ", " + lide.getMessage(); LOG.error( message ); throw new ConfigurationException( message ); } mvbtPartition.setSyncOnWrite( mvbtPartitionBean.isPartitionSyncOnWrite() ); mvbtPartition.setIndexedAttributes( createMavibotIndexes( mvbtPartition, mvbtPartitionBean.getIndexes(), directoryService ) ); setContextEntry( mvbtPartitionBean, mvbtPartition ); return mvbtPartition; }
Dn subschemaSubentryDn = ds.getDnFactory().create( subschemaSubentry.getValue() );