replication.py revision 987a50dfe113ed235d28716ff080b59e8873655c
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at
# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
# add the following below this CDDL HEADER, with the fields enclosed
# information:
# Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Portions Copyright 2007 Sun Microsystems, Inc.
# Global variable containing the list of servers ("Server" class instances) deployed
_topologyServerList = []
# Define ChangelogServer class
class ChangelogServer:
self.changelogServerList = []
def getChangelogServerList(self):
return self.changelogServerList
# Define SynchronizedSuffix class:
class SynchronizedSuffix:
self.changelogServerList = []
def getSuffixDn(self):
def getChangelogServerList(self):
return self.changelogServerList
# Define Server class
class Server:
self.changelogServer = None
def getHostname(self):
def getSslPort(self):
def getJmxPort(self):
def getRootPwd(self):
def getChangelogServer(self):
return self.changelogServer
return self.synchronizedSuffixList
def requiresSynchronization(self):
# Define the function that writes a ldif file with the replication configuration
# corresponding to the given server.
ldifLines = []
# write the main replication configuration entry
# if server is a changelog server, write its corresponding configuration
if changelogServer is not None :
ldifLines.append('dn: cn=Replication Server,cn=Multimaster Synchronization,cn=Synchronization Providers,cn=config')
for chglgServer in list:
# write the domains replication configuration entry
ldifLines.append('dn: cn=domains,cn=Multimaster Synchronization,cn=Synchronization Providers,cn=config')
# write the configuration for the synchronized suffixes, if any
name = 'SUFFIX-%s' % i
ldifLines.append('dn: cn=%s,cn=domains,cn=Multimaster Synchronization,cn=Synchronization Providers,cn=config' % name)
for chglgServer in list:
# write out the ldif file
# Define the function that writes a ldif file with the root suffix entry to add
# for a given suffix.
ldifLines = []
if commaChar == -1:
if rdnType == 'o':
objclass = 'organization'
elif rdnType == 'ou':
objclass = 'organizationalunit'
elif rdnType == 'dc':
objclass = 'domain'
else:
objclass = 'unknown'
# write out the ldif file
# Define the function that writes a ldif file with an entry to add
# under a given suffix.
ldifLines = []
# write out the ldif file
# Define the function that writes a ldif file with the entries to add
# under a given suffix.
ldifLines = []
# write out the ldif file
# Define the function that writes a ldif file with the modify to operate
# on an entry in a given suffix.
ldifLines = []
if attr_value != None :
# write out the ldif file
# Define the function that writes a ldif file with the modify to operate
# on an entry in a given suffix.
# open file and read the binary value (which is encoded in base64)
ldifLines = []
# write out the ldif file
# Define the function that writes a ldif file with the modDN to operate
# on an entry in a given suffix.
ldifLines = []
if newsuperior != None:
# write out the ldif file