| | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | |
| | | <function name="disconnectReplicationServers"> |
| | | <function-prolog> |
| | | This function breaks the connection among a group of replication servers |
| | | by resetting the replication-server attribute in the replication server of |
| | | a given list of servers. |
| | | </function-prolog> |
| | | <function-list-args> |
| | | <function-arg-def name="location" |
| | | type="optional" |
| | | default="STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Location of target host |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsPath" |
| | | type="optional" |
| | | default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)"> |
| | | <function-arg-description> |
| | | Pathname to installation root |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="serverList" type="required"> |
| | | <function-arg-description> |
| | | List of the servers whose replication servers are to be disconnected. |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Server-list"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="expectedRC" type="optional" default="0"> |
| | | <function-arg-description> |
| | | Expected return code value. Default value is 0. |
| | | Wildcard 'noCheck' to not check the RC |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | </function-list-args> |
| | | <sequence> |
| | | |
| | | <paralleliterate var="server" in="serverList"> |
| | | <sequence> |
| | | <script> |
| | | ldapServer = '%s:%s' % (server.getHostname(), |
| | | server.getPort()) |
| | | replicationServer = server.getChangelogServer() |
| | | replServer = '%s:%s' % (server.getHostname(), |
| | | replicationServer.getPort()) |
| | | </script> |
| | | <message> |
| | | 'Disconnecting \nreplication server: %s \nin server: %s' \ |
| | | % (replServer, ldapServer) |
| | | </message> |
| | | <!-- Remove peer RS from replicated domain --> |
| | | <call function="'dsconfig'"> |
| | | { 'location' : server.getHostname(), |
| | | 'dsPath' : '%s/%s' % (server.getDir(),OPENDSNAME), |
| | | 'dsInstanceHost' : server.getHostname(), |
| | | 'dsInstancePort' : server.getPort(), |
| | | 'dsInstanceDn' : server.getRootDn(), |
| | | 'dsInstancePswd' : server.getRootPwd(), |
| | | 'subcommand' : 'set-replication-server-prop', |
| | | 'objectType' : 'provider-name', |
| | | 'objectName' : 'Multimaster Synchronization', |
| | | 'optionsString' : '--reset replication-server', |
| | | 'expectedRC' : expectedRC |
| | | } |
| | | </call> |
| | | </sequence> |
| | | </paralleliterate> |
| | | |
| | | <return> |
| | | STAXResult |
| | | </return> |
| | | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | |
| | | <function name="reconnectReplicationServers"> |
| | | <function-prolog> |
| | | This function re-establishes the connection among a group of replication |
| | | servers by setting the replication-server attribute in the replication |
| | | server of a server with the replication servers of a given list of servers |
| | | </function-prolog> |
| | | <function-list-args> |
| | | <function-arg-def name="location" |
| | | type="optional" |
| | | default="STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Location of target host |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="dsPath" |
| | | type="optional" |
| | | default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)"> |
| | | <function-arg-description> |
| | | Pathname to installation root |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath" /> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="serverList" type="required"> |
| | | <function-arg-description> |
| | | List of the servers whose replication servers are to be reconnected. |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Server-list"/> |
| | | </function-arg-def> |
| | | |
| | | <function-arg-def name="expectedRC" type="optional" default="0"> |
| | | <function-arg-description> |
| | | Expected return code value. Default value is 0. |
| | | Wildcard 'noCheck' to not check the RC |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | </function-list-args> |
| | | <sequence> |
| | | |
| | | <script> |
| | | optionList = [] |
| | | replServerList = [] |
| | | mainServer = serverList[0] |
| | | </script> |
| | | |
| | | <iterate var="server" in="serverList"> |
| | | <sequence> |
| | | <script> |
| | | ldapServer = '%s:%s' % (server.getHostname(), |
| | | server.getPort()) |
| | | replicationServer = server.getChangelogServer() |
| | | replServer = '%s:%s' % (server.getHostname(), |
| | | replicationServer.getPort()) |
| | | optionList.append('--set replication-server:%s' % replServer) |
| | | replServerList.append(replServer) |
| | | </script> |
| | | </sequence> |
| | | </iterate> |
| | | |
| | | <script> |
| | | optionString = ' '.join(optionList) |
| | | replServers = ' '.join(replServerList) |
| | | </script> |
| | | |
| | | <message> |
| | | 'Reconnecting \nreplication servers: %s \nin server: %s:%s' \ |
| | | % (replServers, mainServer.getHostname(), |
| | | mainServer.getPort()) |
| | | </message> |
| | | <!-- Remove peer RS from replicated domain --> |
| | | <call function="'dsconfig'"> |
| | | { 'location' : mainServer.getHostname(), |
| | | 'dsPath' : '%s/%s' \ |
| | | % (mainServer.getDir(),OPENDSNAME), |
| | | 'dsInstanceHost' : mainServer.getHostname(), |
| | | 'dsInstancePort' : mainServer.getPort(), |
| | | 'dsInstanceDn' : mainServer.getRootDn(), |
| | | 'dsInstancePswd' : mainServer.getRootPwd(), |
| | | 'subcommand' : 'set-replication-server-prop', |
| | | 'objectType' : 'provider-name', |
| | | 'objectName' : 'Multimaster Synchronization', |
| | | 'optionsString' : optionString, |
| | | 'expectedRC' : expectedRC |
| | | } |
| | | </call> |
| | | |
| | | <return> |
| | | STAXResult |
| | | </return> |
| | | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | </stax> |