org.openanzo.model.embedded
Class EmbeddedReplicationService

java.lang.Object
  extended by org.openanzo.model.embedded.EmbeddedReplicationService
All Implemented Interfaces:
IReplicationService, IService

public class EmbeddedReplicationService
extends java.lang.Object
implements IReplicationService

An Embedded version of the IReplicationService which has a direct connection to the Anzo server.

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Field Summary
 
Fields inherited from interface org.openanzo.services.IReplicationService
REPLICATION_AUTOMATIC, REPLICATION_IMMEDIATE_ASYNC, REPLICATION_IMMEDIATE_SYNC, REPLICATION_MANUAL
 
Constructor Summary
EmbeddedReplicationService(EmbeddedServiceBase baseService)
          Get an instance of the EmbeddedReplicationService
 
Method Summary
 java.lang.Long execReplicate(java.lang.Long markerIn, java.util.Set<ITracker> statementTrackers, java.util.Set<ITracker> newStatementTrackers, IRepositoryHandler handler)
          Replicate with the Anzo server
static IReplicationService getInstance(java.lang.Object parent, java.util.Properties props)
          Get an instance of the EmbeddedReplicationService
 java.lang.String getServicePassword()
          Get the Password for the current thread
 java.lang.String getServiceUser()
          Get the UserId for the current thread
 void setServicePassword(java.lang.String password)
          Set the password for the current thread's operations
 void setServiceUser(java.lang.String userId)
          Set the UserID for the current thread's operations
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddedReplicationService

public EmbeddedReplicationService(EmbeddedServiceBase baseService)
Get an instance of the EmbeddedReplicationService

Parameters:
baseService - the base embedded service which this service is built upon
Method Detail

getInstance

public static IReplicationService getInstance(java.lang.Object parent,
                                              java.util.Properties props)
Get an instance of the EmbeddedReplicationService

Parameters:
parent - The object creating this service
props - The configuration properties for this service
Returns:
A newly created EmbeddedReplicationService

execReplicate

public java.lang.Long execReplicate(java.lang.Long markerIn,
                                    java.util.Set<ITracker> statementTrackers,
                                    java.util.Set<ITracker> newStatementTrackers,
                                    IRepositoryHandler handler)
                             throws AnzoException
Description copied from interface: IReplicationService
Replicate with the Anzo server

Specified by:
execReplicate in interface IReplicationService
Parameters:
markerIn - Timestamp of last replication
statementTrackers - Set of already replicated notification trackers
newStatementTrackers - Set of new notification trackers
handler - IRepositoryHandler to handle the results of the replication
Returns:
Return the timestamp for last transaction included in replication
Throws:
AnzoException - if there was an error replicating with the server

getServicePassword

public java.lang.String getServicePassword()
Description copied from interface: IService
Get the Password for the current thread

Specified by:
getServicePassword in interface IService
Returns:
the Password for the current thread

getServiceUser

public java.lang.String getServiceUser()
Description copied from interface: IService
Get the UserId for the current thread

Specified by:
getServiceUser in interface IService
Returns:
the UserId for the current thread

setServicePassword

public void setServicePassword(java.lang.String password)
Description copied from interface: IService
Set the password for the current thread's operations

Specified by:
setServicePassword in interface IService
Parameters:
password - Password to use in current thread's operations

setServiceUser

public void setServiceUser(java.lang.String userId)
Description copied from interface: IService
Set the UserID for the current thread's operations

Specified by:
setServiceUser in interface IService
Parameters:
userId - UserId to use in current thread's operations


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.