Package org.jumpmind.symmetric
Class AbstractSymmetricEngine
java.lang.Object
org.jumpmind.symmetric.AbstractSymmetricEngine
- All Implemented Interfaces:
ISymmetricEngine
- Direct Known Subclasses:
ClientSymmetricEngine
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IAcknowledgeService
protected IBandwidthService
protected ICacheManager
protected IClusterService
protected IConcurrentConnectionManager
protected IConfigurationService
protected IContextService
protected IDataExtractorService
protected IDataLoaderService
protected IDataService
protected String
protected String
protected IExtensionService
protected IDataExtractorService
protected IFileSyncService
protected IGroupletService
protected IIncomingBatchService
protected IInitialLoadService
protected IJobManager
protected Date
protected ILoadFilterService
protected INodeCommunicationService
protected INodeService
protected IOfflinePullService
protected IOfflinePushService
protected ITransportManager
protected IOutgoingBatchService
protected ParameterService
protected IDatabasePlatform
protected ITypedPropertiesFactory
protected IPullService
protected IPurgeService
protected IPushService
protected boolean
protected IRegistrationService
protected IRouterService
protected ISecurityService
protected ISequenceService
protected IStagingManager
protected IStatisticManager
protected IStatisticService
protected ISymmetricDialect
protected ITransformService
protected ITransportManager
protected ITriggerRouterService
protected IUpdateService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected IFileSyncService
protected INodeCommunicationService
protected IRouterService
protected boolean
protected Node
checkSystemIntegrity
(Node node) void
protected IClusterService
protected abstract IDatabasePlatform
createDatabasePlatform
(TypedProperties properties) protected abstract IExtensionService
protected abstract IJobManager
protected abstract IStagingManager
protected abstract IStatisticManager
protected abstract ISymmetricDialect
protected ISymmetricDialect
protected abstract ITypedPropertiesFactory
void
destroy()
static ISymmetricEngine
findEngineByName
(String name) Locate aStandaloneSymmetricEngine
in the same JVMstatic ISymmetricEngine
findEngineByNodeId
(String nodeId) static ISymmetricEngine
findEngineByUrl
(String url) Locate aStandaloneSymmetricEngine
in the same JVMstatic List<ISymmetricEngine>
boolean
Call this to force all triggers to be rebuilt<T> T
org.slf4j.Logger
getLog()
Get the current status of this node.Get a list of configured properties for Symmetric.protected abstract SecurityServiceFactory.SecurityServiceType
protected boolean
void
heartbeat
(boolean force) Push a copy of the node onto the push queue so the SymmetricDS node 'checks' in with it's root node.protected void
init()
boolean
Will check to see if this instance of SymmetricDS is configured with the required properties for a node to operate.boolean
boolean
Check to see if this node has been registered.boolean
Check to see if this node has been started.boolean
Check to see if this node is starting.protected boolean
Give the end user the option to provide a script that will load a registration server with an initial SymmetricDS setup.void
openRegistration
(String nodeGroupId, String externalId) Open up registration for node to attach.pull()
Will perform a pull the same way thePullJob
would have.void
purge()
This can be called to do a purge.push()
Will perform a push the same way thePushJob
would have.protected void
registerSymDSDriver
(TypedProperties engineProperties) reloadNode
(String nodeId, String createBy) Queue up an initial load or a reload to a node.void
removeAndCleanupNode
(String nodeId) void
reOpenRegistration
(String nodeId) void
route()
Route captured data the same way theRouterJob
would have.void
setDeploymentSubType
(String deploymentSubType) void
setDeploymentType
(String deploymentType) void
setup()
Will setup the SymmetricDS tables, if not already setup and if the engine is configured to do so.void
setupDatabase
(boolean force) Attempt to configure the database objects that support SymmetricDS.boolean
start()
Must be called to start SymmetricDS.boolean
start
(boolean startJobs) void
stop()
boolean
Call this to resync triggerstoString()
void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jumpmind.symmetric.ISymmetricEngine
listSnapshots, snapshot
-
Field Details
-
deploymentType
-
deploymentSubType
-
propertiesFactory
-
platform
-
securityService
-
parameterService
-
symmetricDialect
-
nodeService
-
configurationService
-
bandwidthService
-
statisticService
-
statisticManager
-
concurrentConnectionManager
-
transportManager
-
offlineTransportManager
-
clusterService
-
purgeService
-
transformService
-
initialLoadService
-
loadFilterService
-
triggerRouterService
-
outgoingBatchService
-
dataService
-
routerService
-
dataExtractorService
-
fileSyncExtractorService
-
registrationService
-
dataLoaderService
-
incomingBatchService
-
acknowledgeService
-
pushService
-
pullService
-
offlinePushService
-
offlinePullService
-
jobManager
-
sequenceService
-
extensionService
-
groupletService
-
stagingManager
-
nodeCommunicationService
-
fileSyncService
-
contextService
-
updateService
-
cacheManager
-
lastRestartTime
-
registerEngine
protected boolean registerEngine
-
-
Constructor Details
-
AbstractSymmetricEngine
protected AbstractSymmetricEngine(boolean registerEngine)
-
-
Method Details
-
createTypedPropertiesFactory
-
createDatabasePlatform
-
findEngines
-
findEngineByUrl
Locate aStandaloneSymmetricEngine
in the same JVM -
findEngineByName
Locate aStandaloneSymmetricEngine
in the same JVM -
findEngineByNodeId
-
setDeploymentType
-
setDeploymentSubType
-
getSecurityServiceType
-
init
protected void init() -
registerSymDSDriver
-
createClusterService
-
buildRouterService
-
buildFileSyncService
-
buildNodeCommunicationService
-
createStagingManager
-
createStatisticManager
-
createSymmetricDialect
-
createTargetDialect
-
createExtensionService
-
createJobManager
-
getSyncUrl
- Specified by:
getSyncUrl
in interfaceISymmetricEngine
- Returns:
- the URL that represents this engine
-
getProperties
Description copied from interface:ISymmetricEngine
Get a list of configured properties for Symmetric. Read-only.- Specified by:
getProperties
in interfaceISymmetricEngine
-
getEngineName
- Specified by:
getEngineName
in interfaceISymmetricEngine
- Returns:
- The lower case representation of the engine name as setup in the symmetric.properties file. We always use a lower case representation because there are times the engine name is used in triggers at which point you can lose the original case representation.
-
setup
public void setup()Description copied from interface:ISymmetricEngine
Will setup the SymmetricDS tables, if not already setup and if the engine is configured to do so.- Specified by:
setup
in interfaceISymmetricEngine
-
setupDatabase
public void setupDatabase(boolean force) Description copied from interface:ISymmetricEngine
Attempt to configure the database objects that support SymmetricDS. If they are out of date this method will attempt to alter the tables to bring them up to date.- Specified by:
setupDatabase
in interfaceISymmetricEngine
- Parameters:
force
- forces this action to be run regardless of the parameter settings
-
hasSoftwareVersionChanged
protected boolean hasSoftwareVersionChanged() -
autoConfigRegistrationServer
protected void autoConfigRegistrationServer() -
buildTablesFromDdlUtilXmlIfProvided
protected boolean buildTablesFromDdlUtilXmlIfProvided() -
loadFromScriptIfProvided
protected boolean loadFromScriptIfProvided()Give the end user the option to provide a script that will load a registration server with an initial SymmetricDS setup. Look first on the file system, then in the classpath for the SQL file.- Returns:
- true if the script was executed
-
start
public boolean start()Description copied from interface:ISymmetricEngine
Must be called to start SymmetricDS.- Specified by:
start
in interfaceISymmetricEngine
- Returns:
- true if successfully started
-
start
public boolean start(boolean startJobs) - Specified by:
start
in interfaceISymmetricEngine
-
checkSystemIntegrity
-
getEngineDescription
- Specified by:
getEngineDescription
in interfaceISymmetricEngine
-
uninstall
public void uninstall()- Specified by:
uninstall
in interfaceISymmetricEngine
-
stop
public void stop()- Specified by:
stop
in interfaceISymmetricEngine
-
destroy
public void destroy()- Specified by:
destroy
in interfaceISymmetricEngine
-
reloadNode
Description copied from interface:ISymmetricEngine
Queue up an initial load or a reload to a node.- Specified by:
reloadNode
in interfaceISymmetricEngine
createBy
- TODO
-
sendSQL
public String sendSQL(String nodeId, String catalogName, String schemaName, String tableName, String sql) - Specified by:
sendSQL
in interfaceISymmetricEngine
-
push
Description copied from interface:ISymmetricEngine
Will perform a push the same way thePushJob
would have.- Specified by:
push
in interfaceISymmetricEngine
- Returns:
RemoteNodeStatuses
- See Also:
-
syncTriggers
public boolean syncTriggers()Description copied from interface:ISymmetricEngine
Call this to resync triggers- Specified by:
syncTriggers
in interfaceISymmetricEngine
- See Also:
-
forceTriggerRebuild
public boolean forceTriggerRebuild()Description copied from interface:ISymmetricEngine
Call this to force all triggers to be rebuilt- Specified by:
forceTriggerRebuild
in interfaceISymmetricEngine
- See Also:
-
ITriggerRouterService#forceTriggerRebuild()
-
getNodeStatus
Description copied from interface:ISymmetricEngine
Get the current status of this node.- Specified by:
getNodeStatus
in interfaceISymmetricEngine
- Returns:
NodeStatus
-
removeAndCleanupNode
- Specified by:
removeAndCleanupNode
in interfaceISymmetricEngine
-
pull
Description copied from interface:ISymmetricEngine
Will perform a pull the same way thePullJob
would have.- Specified by:
pull
in interfaceISymmetricEngine
- Returns:
RemoteNodeStatuses
- See Also:
-
route
public void route()Description copied from interface:ISymmetricEngine
Route captured data the same way theRouterJob
would have.- Specified by:
route
in interfaceISymmetricEngine
-
purge
public void purge()Description copied from interface:ISymmetricEngine
This can be called to do a purge. It may be called only if theOutgoingPurgeJob
has not been enabled.- Specified by:
purge
in interfaceISymmetricEngine
- See Also:
-
isConfigured
public boolean isConfigured()Description copied from interface:ISymmetricEngine
Will check to see if this instance of SymmetricDS is configured with the required properties for a node to operate.- Specified by:
isConfigured
in interfaceISymmetricEngine
-
heartbeat
public void heartbeat(boolean force) Description copied from interface:ISymmetricEngine
Push a copy of the node onto the push queue so the SymmetricDS node 'checks' in with it's root node.- Specified by:
heartbeat
in interfaceISymmetricEngine
- Parameters:
force
- When force is true the heart beat will always be inserted. If it is false, the heart beat will only be inserted if the period between heart beats has expired.
-
openRegistration
Description copied from interface:ISymmetricEngine
Open up registration for node to attach.- Specified by:
openRegistration
in interfaceISymmetricEngine
- See Also:
-
clearCaches
public void clearCaches()- Specified by:
clearCaches
in interfaceISymmetricEngine
-
reOpenRegistration
- Specified by:
reOpenRegistration
in interfaceISymmetricEngine
-
isRegistered
public boolean isRegistered()Description copied from interface:ISymmetricEngine
Check to see if this node has been registered.- Specified by:
isRegistered
in interfaceISymmetricEngine
- Returns:
- true if the node is registered
-
isStarted
public boolean isStarted()Description copied from interface:ISymmetricEngine
Check to see if this node has been started.- Specified by:
isStarted
in interfaceISymmetricEngine
- Returns:
- true if the node is started
-
isStarting
public boolean isStarting()Description copied from interface:ISymmetricEngine
Check to see if this node is starting.- Specified by:
isStarting
in interfaceISymmetricEngine
- Returns:
- true if the node is starting
-
isInitialized
public boolean isInitialized()- Specified by:
isInitialized
in interfaceISymmetricEngine
-
getConfigurationService
- Specified by:
getConfigurationService
in interfaceISymmetricEngine
-
getParameterService
- Specified by:
getParameterService
in interfaceISymmetricEngine
-
getNodeService
- Specified by:
getNodeService
in interfaceISymmetricEngine
-
getRegistrationService
- Specified by:
getRegistrationService
in interfaceISymmetricEngine
-
getClusterService
- Specified by:
getClusterService
in interfaceISymmetricEngine
-
getPurgeService
- Specified by:
getPurgeService
in interfaceISymmetricEngine
-
getDataService
- Specified by:
getDataService
in interfaceISymmetricEngine
-
getJobManager
- Specified by:
getJobManager
in interfaceISymmetricEngine
-
getOutgoingBatchService
- Specified by:
getOutgoingBatchService
in interfaceISymmetricEngine
-
getAcknowledgeService
- Specified by:
getAcknowledgeService
in interfaceISymmetricEngine
-
getBandwidthService
- Specified by:
getBandwidthService
in interfaceISymmetricEngine
-
getDataExtractorService
- Specified by:
getDataExtractorService
in interfaceISymmetricEngine
-
getFileSyncExtractorService
- Specified by:
getFileSyncExtractorService
in interfaceISymmetricEngine
-
getDataLoaderService
- Specified by:
getDataLoaderService
in interfaceISymmetricEngine
-
getIncomingBatchService
- Specified by:
getIncomingBatchService
in interfaceISymmetricEngine
-
getPullService
- Specified by:
getPullService
in interfaceISymmetricEngine
-
getPushService
- Specified by:
getPushService
in interfaceISymmetricEngine
-
getOfflinePullService
- Specified by:
getOfflinePullService
in interfaceISymmetricEngine
-
getOfflinePushService
- Specified by:
getOfflinePushService
in interfaceISymmetricEngine
-
getRouterService
- Specified by:
getRouterService
in interfaceISymmetricEngine
-
getSecurityService
- Specified by:
getSecurityService
in interfaceISymmetricEngine
-
getStatisticService
- Specified by:
getStatisticService
in interfaceISymmetricEngine
-
getStatisticManager
- Specified by:
getStatisticManager
in interfaceISymmetricEngine
-
getTriggerRouterService
- Specified by:
getTriggerRouterService
in interfaceISymmetricEngine
-
getDeploymentType
- Specified by:
getDeploymentType
in interfaceISymmetricEngine
-
getDeploymentSubType
- Specified by:
getDeploymentSubType
in interfaceISymmetricEngine
-
getTransformService
- Specified by:
getTransformService
in interfaceISymmetricEngine
-
getLoadFilterService
- Specified by:
getLoadFilterService
in interfaceISymmetricEngine
-
getInitialLoadService
- Specified by:
getInitialLoadService
in interfaceISymmetricEngine
-
getConcurrentConnectionManager
- Specified by:
getConcurrentConnectionManager
in interfaceISymmetricEngine
-
getTablePrefix
- Specified by:
getTablePrefix
in interfaceISymmetricEngine
-
getTransportManager
- Specified by:
getTransportManager
in interfaceISymmetricEngine
-
getOfflineTransportManager
-
getExtensionService
- Specified by:
getExtensionService
in interfaceISymmetricEngine
-
getContextService
- Specified by:
getContextService
in interfaceISymmetricEngine
-
getStagingManager
- Specified by:
getStagingManager
in interfaceISymmetricEngine
-
getSequenceService
- Specified by:
getSequenceService
in interfaceISymmetricEngine
-
getNodeCommunicationService
- Specified by:
getNodeCommunicationService
in interfaceISymmetricEngine
-
getGroupletService
- Specified by:
getGroupletService
in interfaceISymmetricEngine
-
getLastException
- Specified by:
getLastException
in interfaceISymmetricEngine
-
getLastExceptionMessage
- Specified by:
getLastExceptionMessage
in interfaceISymmetricEngine
-
getLastRestartTime
- Specified by:
getLastRestartTime
in interfaceISymmetricEngine
-
getSqlTemplate
- Specified by:
getSqlTemplate
in interfaceISymmetricEngine
-
getLog
public org.slf4j.Logger getLog()- Specified by:
getLog
in interfaceISymmetricEngine
-
getDataSource
public <T> T getDataSource()- Specified by:
getDataSource
in interfaceISymmetricEngine
-
getDatabasePlatform
- Specified by:
getDatabasePlatform
in interfaceISymmetricEngine
-
getFileSyncService
- Specified by:
getFileSyncService
in interfaceISymmetricEngine
-
getUpdateService
- Specified by:
getUpdateService
in interfaceISymmetricEngine
-
getNodeId
- Specified by:
getNodeId
in interfaceISymmetricEngine
-
getSymmetricDialect
- Specified by:
getSymmetricDialect
in interfaceISymmetricEngine
-
getTargetDialect
- Specified by:
getTargetDialect
in interfaceISymmetricEngine
-
toString
-
getCacheManager
- Specified by:
getCacheManager
in interfaceISymmetricEngine
-