com.gentics.api.portalnode.connector
Class CRSync

java.lang.Object
  extended by com.gentics.api.portalnode.connector.CRSync

public class CRSync
extends java.lang.Object

CRSync synchronizes two given ContentRepositories based on two CNDatasources.

CRSync tries this by only syncing the changes.
If an intelligent sync is not possible, CRSync syncs the complete source repository to the target repository completly overwriting the target repository.
More help is available in the command line help (CRSync -help).


Constructor Summary
CRSync(Datasource source, WriteableDatasource target, java.lang.String rule)
          Initialize the sync with source and target datasource, leave flags to default values (false).
CRSync(Datasource source, WriteableDatasource target, java.lang.String rule, boolean test, boolean allowEmpty, boolean allowAlterTable, boolean delete, boolean sourceTransaction, boolean targetTransaction, int batchSize, CRSyncModifier modifier)
          Initialize the sync with source and target datasource.
CRSync(Datasource source, WriteableDatasource target, java.lang.String rule, boolean test, boolean allowEmpty, boolean allowAlterTable, boolean delete, int batchSize)
          Initialize the sync with source and target datasource, leave flags to default values (false).
 
Method Summary
 java.lang.String doSync()
          Do the sync
static void main(java.lang.String[] args)
          Read the commandline parameters and start the sync.
 void setIgnoreOptimized(boolean ignoreOptimized)
          Set the flag for ignoring the optimized flag of attributetypes
 void setObsoletionCheckBatchSize(int batchSize)
          Set the batchsize for the obsoletion check.
 void setUseLobStreams(boolean useLobStreams)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRSync

public CRSync(Datasource source,
              WriteableDatasource target,
              java.lang.String rule)
       throws NodeException
Initialize the sync with source and target datasource, leave flags to default values (false). For details see commandline help (-help).

Parameters:
source - source datasource
target - target datasource
rule - optional rule to restrict sync'ed objects
Throws:
NodeException

CRSync

public CRSync(Datasource source,
              WriteableDatasource target,
              java.lang.String rule,
              boolean test,
              boolean allowEmpty,
              boolean allowAlterTable,
              boolean delete,
              int batchSize)
       throws DatasourceException
Initialize the sync with source and target datasource, leave flags to default values (false). For details see commandline help (-help).

Parameters:
source - source datasource
target - target datasource
rule - optional rule to restrict sync'ed objects
test - test - only simulate the changes
allowEmpty - allow empty Source-Repository
allowAlterTable - allow structural changes to contentrepository
delete - remove all objects not matching the given rule in targetDS
Throws:
DatasourceException

CRSync

public CRSync(Datasource source,
              WriteableDatasource target,
              java.lang.String rule,
              boolean test,
              boolean allowEmpty,
              boolean allowAlterTable,
              boolean delete,
              boolean sourceTransaction,
              boolean targetTransaction,
              int batchSize,
              CRSyncModifier modifier)
       throws DatasourceException
Initialize the sync with source and target datasource. For details see commandline help (-help).

Parameters:
source - source datasource
target - target datasource
rule - optional rule to restrict sync'ed objects
test - test - only simulate the changes
allowEmpty - allow empty Source-Repository
allowAlterTable - allow structural changes to contentrepository
delete - remove all objects not matching the given rule in targetDS
sourceTransaction - use transactions in source database
targetTransaction - use transactions in target database
batchSize - batch size (maximum number of objects to be synced at once)
modifier - modify objects before storing them
Throws:
DatasourceException - no source or target datasource given
Method Detail

main

public static void main(java.lang.String[] args)
Read the commandline parameters and start the sync. For details and available parameters, see commandline help (-help).


setObsoletionCheckBatchSize

public void setObsoletionCheckBatchSize(int batchSize)
Set the batchsize for the obsoletion check.

Parameters:
batchSize - new batchsize

setIgnoreOptimized

public void setIgnoreOptimized(boolean ignoreOptimized)
Set the flag for ignoring the optimized flag of attributetypes

Parameters:
ignoreOptimized - true when optimized flags shall be ignored, false if not

setUseLobStreams

public void setUseLobStreams(boolean useLobStreams)

doSync

public java.lang.String doSync()
                        throws NodeException,
                               java.sql.SQLException
Do the sync

Returns:
informational message (how many objects were sync'ed)
Throws:
NodeException - when something went wrong
java.sql.SQLException


Copyright © 2013 Gentics Software GmbH. All Rights Reserved.