org.wso2.carbon.apacheds
Interface PartitionManager


public interface PartitionManager

Handles apacheds service operations. E.g :- Adding new partitions, removing/deleting existing partitions etc ... In a multi-tenant environment we would have a new partition for each tenant. So we need to manage partitions according to the way tenants are created and deleted.


Method Summary
 void addPartition(PartitionInfo partitionInformation)
          Adds a new partition to current apacheds store.
 int getNumberOfPartitions()
          count the number of existing partitions
 void initializeExistingPartition(PartitionInfo parttionInfo)
          This method initializes a partition from an existing partition directory.
 boolean partitionDirectoryExists(String partitionID)
          This checks whether a partition directory exists with the given partition ID.
 boolean partitionInitialized(String partitionId)
          Checks whether a given partition is initialized in the directory service.
 void removeAllPartitions()
          Removes all partitions except system partition.
 void removePartition(String partitionSuffix)
          Removes given partition from apacheds server.
 void synchronizePartitions()
          Synchronizes the modified partitions.
 

Method Detail

addPartition

void addPartition(PartitionInfo partitionInformation)
                  throws DirectoryServerException
Adds a new partition to current apacheds store.

Parameters:
partitionInformation - This contains necessary information to create a partition. Mainly it contains following information, 1. partitionId - The partition id. Usually this is tenant id. 2. realm domain - name of the partition. Usually domain name and partition DN are same. Ex :- o=example.com 3. partitionDN - Suffix used when creating the partition. Usually this is the domain name. DN: dc=example,dc=com 4. adminInfo - User information for the domain.
Throws:
DirectoryServerException - If an error occurs while adding the partition.

partitionDirectoryExists

boolean partitionDirectoryExists(String partitionID)
                                 throws DirectoryServerException
This checks whether a partition directory exists with the given partition ID.

Parameters:
partitionID -
Returns:
Throws:
DirectoryServerException

partitionInitialized

boolean partitionInitialized(String partitionId)
Checks whether a given partition is initialized in the directory service. This differs from partitionExists because, although a partition directory is existed, we need to specifically initialize a partition in the current instance of the directory service.

Parameters:
partitionId - - Partition identifier to check availability.
Returns:
true if partition exists else false.

removePartition

void removePartition(String partitionSuffix)
                     throws DirectoryServerException
Removes given partition from apacheds server.

Parameters:
partitionSuffix - Partition suffix to be removed.
Throws:
DirectoryServerException - If error occurs during partition deletion.

synchronizePartitions

void synchronizePartitions()
                           throws DirectoryServerException
Synchronizes the modified partitions.

Throws:
DirectoryServerException - If an error occurred during operation.

removeAllPartitions

void removeAllPartitions()
                         throws DirectoryServerException
Removes all partitions except system partition.

Throws:
DirectoryServerException - If an error occurred during partition removal.

getNumberOfPartitions

int getNumberOfPartitions()
count the number of existing partitions

Returns:
number of partitions

initializeExistingPartition

void initializeExistingPartition(PartitionInfo parttionInfo)
                                 throws DirectoryServerException
This method initializes a partition from an existing partition directory.

Parameters:
parttionInfo -
Throws:
Exception
DirectoryServerException


Copyright © 2015 WSO2. All rights reserved.