/** * Add a new partition to the server * * @param partitionId The partition Id * @param partitionDn The partition DN * @return The newly added partition * @throws Exception If the partition can't be added */ private Partition addPartition(String partitionId, String partitionDn) throws Exception { JdbmPartition partition = new JdbmPartition(); partition.setId(partitionId); partition.setPartitionDir(new File(service.getWorkingDirectory(), partitionId)); partition.setSuffix(partitionDn); service.addPartition(partition); return partition; }
String workingDirectory = service.getWorkingDirectory().getPath(); ldifPartition.setWorkingDirectory(workingDirectory + "/schema");
/** * Add a new partition to the server. * * @param partitionId The partition Id * @param partitionDn The partition DN * @return The newly added partition * @throws Exception If the partition can't be added */ private Partition addPartition(String partitionId, String partitionDn) throws Exception { // Create a new partition named 'foo'. JdbmPartition partition = new JdbmPartition(); partition.setId(partitionId); partition.setPartitionDir(new File(service.getWorkingDirectory(), partitionId)); partition.setSuffix(partitionDn); service.addPartition(partition); return partition; }//addPartition
/** * Inits the system partition. * * @throws Exception the exception */ private void initSystemPartition() throws Exception { // change the working apacheds to something that is unique // on the system and somewhere either under target apacheds // or somewhere in a temp area of the machine. // Inject the System Partition Partition systemPartition = partitionFactory.createPartition( "system", ServerDNConstants.SYSTEM_DN, PARTITION_CACHE_SIZE, new File(directoryService.getWorkingDirectory(), "system")); systemPartition.setSchemaManager(directoryService.getSchemaManager()); partitionFactory.addIndex(systemPartition, SchemaConstants.OBJECT_CLASS_AT, INDEX_CACHE_SIZE); directoryService.setSystemPartition(systemPartition); }
dbURI = DB_URI_PREFIX + serviceCfg.getWorkingDirectory().getPath() + File.separator + "replication";
/** * initialize the schema manager and add the schema partition to diectory service * * @throws Exception if the schema LDIF files are not found on the classpath */ private void initSchemaPartition() throws Exception { SchemaPartition schemaPartition = service.getSchemaService().getSchemaPartition(); // Init the LdifPartition LdifPartition ldifPartition = new LdifPartition(); String workingDirectory = service.getWorkingDirectory().getPath(); ldifPartition.setWorkingDirectory(workingDirectory + "/schema"); // Extract the schema on disk (a brand new one) and load the registries File schemaRepository = new File(workingDirectory, "schema"); SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor(new File(workingDirectory)); extractor.extractOrCopy(true); schemaPartition.setWrappedPartition(ldifPartition); SchemaLoader loader = new LdifSchemaLoader(schemaRepository); SchemaManager schemaManager = new DefaultSchemaManager(loader); service.setSchemaManager(schemaManager); // We have to load the schema now, otherwise we won't be able // to initialize the Partitions, as we won't be able to parse // and normalize their suffix DN schemaManager.loadAllEnabled(); schemaPartition.setSchemaManager(schemaManager); List<Throwable> errors = schemaManager.getErrors(); if (errors.size() != 0) { throw new Exception("Schema load failed : " + errors); } }
String workingDirectory = directoryService.getWorkingDirectory().getPath(); ldifPartition.setWorkingDirectory(workingDirectory + File.separator + "schema");
/** * Add a new partition to the server * * @param partitionId The partition Id * @param partitionDn The partition DN * @return The newly added partition * @throws Exception If the partition can't be added */ private Partition addPartition(String partitionId, String partitionDn) throws Exception { // Create a new partition named 'foo'. JdbmPartition partition = new JdbmPartition(); partition.setId(partitionId); partition.setPartitionDir(new File(service.getWorkingDirectory(), partitionId)); partition.setSuffix(partitionDn); service.addPartition(partition); return partition; }
/** * Add a new partition to the server * * @param partitionId The partition Id * @param partitionDn The partition DN * @return The newly added partition * @throws Exception If the partition can't be added */ private Partition addPartition(String partitionId, String partitionDn) throws Exception { // Create a new partition named 'foo'. JdbmPartition partition = new JdbmPartition(); partition.setId(partitionId); partition.setPartitionDir(new File(service.getWorkingDirectory(), partitionId)); partition.setSuffix(partitionDn); service.addPartition(partition); return partition; }
/** * initialize the schema manager and add the schema partition to diectory service * * @throws Exception if the schema LDIF files are not found on the classpath */ private void initSchemaPartition() throws Exception { SchemaPartition schemaPartition = service.getSchemaService().getSchemaPartition(); // Init the LdifPartition LdifPartition ldifPartition = new LdifPartition(); String workingDirectory = service.getWorkingDirectory().getPath(); ldifPartition.setWorkingDirectory(workingDirectory + "/schema"); // Extract the schema on disk (a brand new one) and load the registries File schemaRepository = new File(workingDirectory, "schema"); SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor(new File(workingDirectory)); extractor.extractOrCopy(true); schemaPartition.setWrappedPartition(ldifPartition); SchemaLoader loader = new LdifSchemaLoader(schemaRepository); SchemaManager schemaManager = new DefaultSchemaManager(loader); service.setSchemaManager(schemaManager); // We have to load the schema now, otherwise we won't be able // to initialize the Partitions, as we won't be able to parse // and normalize their suffix DN schemaManager.loadAllEnabled(); schemaPartition.setSchemaManager(schemaManager); List<Throwable> errors = schemaManager.getErrors(); if (errors.size() != 0) { throw new Exception("Schema load failed : " + errors); } }
/** * initialize the schema manager and add the schema partition to diectory service * * @throws Exception if the schema LDIF files are not found on the classpath */ private void initSchemaPartition() throws Exception { SchemaPartition schemaPartition = service.getSchemaService().getSchemaPartition(); // Init the LdifPartition LdifPartition ldifPartition = new LdifPartition(); String workingDirectory = service.getWorkingDirectory().getPath(); ldifPartition.setWorkingDirectory(workingDirectory + "/schema"); // Extract the schema on disk (a brand new one) and load the registries File schemaRepository = new File(workingDirectory, "schema"); SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor(new File(workingDirectory)); extractor.extractOrCopy(true); schemaPartition.setWrappedPartition(ldifPartition); SchemaLoader loader = new LdifSchemaLoader(schemaRepository); SchemaManager schemaManager = new DefaultSchemaManager(loader); service.setSchemaManager(schemaManager); // We have to load the schema now, otherwise we won't be able // to initialize the Partitions, as we won't be able to parse // and normalize their suffix DN schemaManager.loadAllEnabled(); schemaPartition.setSchemaManager(schemaManager); List<Throwable> errors = schemaManager.getErrors(); if (errors.size() != 0) { throw new Exception("Schema load failed : " + errors); } }
doDelete( directoryService.getWorkingDirectory() ); configureDirectoryService(); directoryService.startup();