public class ReplConsumerManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private CoreSession |
adminSession
The admin session used to commuicate with the backend
|
private org.apache.directory.api.ldap.model.schema.AttributeType |
adsReplLastSentCsn
An AdsReplLastSentCsn AT instance
|
private static java.lang.String |
CONSUMERS
The consumers' ou value
|
private DirectoryService |
directoryService
The DirectoryService instance
|
private static org.slf4j.Logger |
LOG
Logger for this class
|
private java.util.Map<java.lang.Integer,org.apache.directory.api.ldap.model.entry.Modification> |
modMap
A map containing the last sent CSN for every connected consumer
|
private static org.slf4j.Logger |
PROVIDER_LOG
A logger for the replication provider
|
private static java.lang.String |
REPL_CONSUMER_DN_STR
The replication factory DN
|
private org.apache.directory.api.ldap.model.name.Dn |
replConsumerDn |
private org.apache.directory.api.ldap.model.schema.SchemaManager |
schemaManager
The schema manager instance
|
| Constructor and Description |
|---|
ReplConsumerManager(DirectoryService directoryService)
Create a new instance of the producer replication manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConsumerEntry(ReplicaEventLog replica)
Add a new consumer entry in ou=consumers,ou=system
|
private ReplicaEventLog |
convertEntryToReplica(org.apache.directory.api.ldap.model.entry.Entry entry)
Convert the stored entry to a valid ReplicaEventLog structure
|
private void |
createConsumersBranch()
Initialize the replication Store, creating the ou=consumers,ou=system entry (only if it does not exist yet)
|
void |
deleteConsumerEntry(ReplicaEventLog replica)
Delete an existing consumer entry from ou=consumers,ou=system
|
java.util.List<ReplicaEventLog> |
getReplicaEventLogs()
Get the list of consumers' configuration
|
void |
updateReplicaLastSentCsn(ReplicaEventLog replica)
Store the new CSN sent by the consumer in place of the previous one.
|
private static final org.slf4j.Logger LOG
private static final org.slf4j.Logger PROVIDER_LOG
private CoreSession adminSession
private DirectoryService directoryService
private org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager
private static final java.lang.String REPL_CONSUMER_DN_STR
private org.apache.directory.api.ldap.model.name.Dn replConsumerDn
private static final java.lang.String CONSUMERS
private org.apache.directory.api.ldap.model.schema.AttributeType adsReplLastSentCsn
private java.util.Map<java.lang.Integer,org.apache.directory.api.ldap.model.entry.Modification> modMap
public ReplConsumerManager(DirectoryService directoryService) throws java.lang.Exception
directoryService - The directoryService instancejava.lang.Exception - if we add an error while creating the configurationprivate void createConsumersBranch()
throws java.lang.Exception
java.lang.Exceptionpublic void addConsumerEntry(ReplicaEventLog replica) throws java.lang.Exception
replica - The added consumer replicajava.lang.Exception - If the addition failedpublic void deleteConsumerEntry(ReplicaEventLog replica) throws org.apache.directory.api.ldap.model.exception.LdapException
replica - The added consumer replicajava.lang.Exception - If the addition failedorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic void updateReplicaLastSentCsn(ReplicaEventLog replica) throws java.lang.Exception
replica - The consumer informationsjava.lang.Exception - If the update failedpublic java.util.List<ReplicaEventLog> getReplicaEventLogs() throws java.lang.Exception
java.lang.Exception - If we had an error while building this listprivate ReplicaEventLog convertEntryToReplica(org.apache.directory.api.ldap.model.entry.Entry entry) throws java.lang.Exception
java.lang.Exception