| | |
| | | /* This table is used to store the list of dn for which we are currently |
| | | * handling servers. |
| | | */ |
| | | private ConcurrentHashMap<DN, ReplicationServerDomain> baseDNs = |
| | | new ConcurrentHashMap<DN, ReplicationServerDomain>(); |
| | | private ConcurrentHashMap<String, ReplicationServerDomain> baseDNs = |
| | | new ConcurrentHashMap<String, ReplicationServerDomain>(); |
| | | |
| | | private String localURL = "null"; |
| | | private boolean shutdown = false; |
| | |
| | | assuredTimeout = configuration.getAssuredTimeout(); |
| | | degradedStatusThreshold = configuration.getDegradedStatusThreshold(); |
| | | |
| | | replSessionSecurity = new ReplSessionSecurity(configuration); |
| | | replSessionSecurity = new ReplSessionSecurity(); |
| | | initialize(replicationPort); |
| | | configuration.addChangeListener(this); |
| | | DirectoryServer.registerMonitorProvider(this); |
| | |
| | | * colon. |
| | | * @param baseDn The baseDn of the connection |
| | | */ |
| | | private void connect(String serverURL, DN baseDn) |
| | | private void connect(String serverURL, String baseDn) |
| | | { |
| | | int separator = serverURL.lastIndexOf(':'); |
| | | String port = serverURL.substring(separator + 1); |
| | |
| | | * @return The ReplicationServerDomain associated to the base DN given in |
| | | * parameter. |
| | | */ |
| | | public ReplicationServerDomain getReplicationServerDomain(DN baseDn, |
| | | public ReplicationServerDomain getReplicationServerDomain(String baseDn, |
| | | boolean create) |
| | | { |
| | | ReplicationServerDomain replicationServerDomain; |
| | |
| | | * DN given in parameter. |
| | | * @throws DatabaseException in case of underlying database problem. |
| | | */ |
| | | public DbHandler newDbHandler(short id, DN baseDn) |
| | | public DbHandler newDbHandler(short id, String baseDn) |
| | | throws DatabaseException |
| | | { |
| | | return new DbHandler(id, baseDn, this, dbEnv, queueSize); |
| | |
| | | * @param baseDn The baseDn for which to delete the generationId. |
| | | * @throws DatabaseException When it occurs. |
| | | */ |
| | | public void clearGenerationId(DN baseDn) |
| | | public void clearGenerationId(String baseDn) |
| | | throws DatabaseException |
| | | { |
| | | try |
| | |
| | | * Add all the base DNs that are known by this replication server. |
| | | */ |
| | | AttributeBuilder builder = new AttributeBuilder("base-dn"); |
| | | for (DN base : baseDNs.keySet()) |
| | | for (String base : baseDNs.keySet()) |
| | | { |
| | | builder.add(base.toString()); |
| | | } |
| | |
| | | |
| | | // Publish to monitor the generation ID by replicationServerDomain |
| | | builder = new AttributeBuilder("base-dn-generation-id"); |
| | | for (DN base : baseDNs.keySet()) |
| | | for (String base : baseDNs.keySet()) |
| | | { |
| | | long generationId=-1; |
| | | ReplicationServerDomain replicationServerDomain = |
| | |
| | | * @param baseDN The baseDN of the replicationServerDomain. |
| | | * @return The value of the generationID. |
| | | */ |
| | | public long getGenerationId(DN baseDN) |
| | | public long getGenerationId(String baseDN) |
| | | { |
| | | ReplicationServerDomain rsd = |
| | | this.getReplicationServerDomain(baseDN, false); |