wt.fv.replica
Class StandardReplicaService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.fv.replica.StandardReplicaService
All Implemented Interfaces:
Manager, NetFactor, ReplicaServiceSvr, Serializable

public class StandardReplicaService
extends StandardManager
implements ReplicaServiceSvr, Serializable

Use the newStandardReplicaService static factory method(s), not the StandardReplicaService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: false

Extendable: false

See Also:
Serialized Form

Nested Class Summary
private  class StandardReplicaService.FetchThread
           
 
Field Summary
private static ConfigCache _configCache
           
private static Object _configLock
           
private static Hashtable _folderKeys
           
private static Hashtable _masterID2URLKeys
           
private static Hashtable _mastersReady
           
private static String _myHostName
           
private static ResourceBundle _rb
           
private static Hashtable _vaultKeys
           
private static int bufferSize
           
private static String CLASSNAME
           
static String CONTENT_TYPE_HDR
           
private static String inboxName
           
private static String outboxName
           
private static String RESOURCE
           
private  Vector siteDescConfig
           
private static String transportName
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardReplicaService()
           
 
Method Summary
static ActionShippingItem acceptReplicateStreamed(Long replSessionID, Long replicatedItemID, Long replicaVaultID, String siteURL, InputStream contentStream)
           
static ActionShippingItem cleanUpFilesInFolder(Long folderID, Vector filesToDelete, String siteURL, ActionShippingItem reply)
           
static ActionShippingItem copyFileFromVaultToVault(Long sessionID, Long destItemID, Long destVaultID, Long origFolderID, Long origItemID, String siteURL)
           
static void doDownload(HTTPRequest req, HTTPResponse resp)
          

Supported API: false
private  FolderDesc findActiveFolder(VaultDesc vault)
           
 String findFolderPathInCache(String siteUrl, long fid)
          Deprecated.  
 FolderDesc findFolderToSaveFile(String site_url, long vault_id)
          Finds the folder on the local system to save the file to?

Supported API: false
 String getConceptualClassname()
          Deprecated.  
private  ConfigCache getConfigCache()
          Returns the configuration information stored in the ServerManger.
private  void getConfigCacheFromMaster(String masterHost)
           
 FolderDesc getFolderDescById(String siteUrl, long id)
          Gets a folder description object given the site and object ID.
static String getFolderPathFromCache(String masterURL, Long folderId)
          

Supported API: false
private static String getMyHostName()
           
private static ActionShippingItem handleExeptionOnAcceptReplicateStreamed(ActionShippingItem reply, Long replicatedItemID, Long rSessionID, Long folderToRO)
           
private  void initConfigCache()
          If the config info is already in the cache get it.
private static void initConfigInfo(String masterUrl)
           
private  boolean isMasterReady(String master)
           
private static void logCurrDesc(HostDesc currDesc)
           
static StandardReplicaService newStandardReplicaService()
          Default factory for the class.
protected  void performStartupProcess()
          Initialization tasks performed by the engine service.
private static void printCurrDesc(HostDesc currDesc)
           
static void receiveConfigInfo(String master, SiteDesc theConfigInfo)
          This is the Doer method that processes the input information from the HTTPRequest that we posted earlier.
private static boolean replCopyFile(BackupedFile fromFile, BackupedFile toFile, FolderDesc destFolder)
           
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, registerEvents, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

siteDescConfig

private Vector siteDescConfig

_configCache

private static ConfigCache _configCache

_myHostName

private static String _myHostName

_configLock

private static Object _configLock

_mastersReady

private static Hashtable _mastersReady

_folderKeys

private static Hashtable _folderKeys

_vaultKeys

private static Hashtable _vaultKeys

_masterID2URLKeys

private static Hashtable _masterID2URLKeys

CONTENT_TYPE_HDR

public static final String CONTENT_TYPE_HDR
See Also:
Constant Field Values

_rb

private static ResourceBundle _rb

outboxName

private static final String outboxName
See Also:
Constant Field Values

inboxName

private static final String inboxName
See Also:
Constant Field Values

transportName

private static final String transportName
See Also:
Constant Field Values

bufferSize

private static int bufferSize
Constructor Detail

StandardReplicaService

public StandardReplicaService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException
Initialization tasks performed by the engine service. Includes queue activation and event subscription.

Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

doDownload

public static void doDownload(HTTPRequest req,
                              HTTPResponse resp)
                       throws WTException


Supported API: false

Parameters:
req -
resp -
Throws:
WTException

getFolderPathFromCache

public static String getFolderPathFromCache(String masterURL,
                                            Long folderId)
                                     throws WTException


Supported API: false

Parameters:
masterURL -
folderId -
Returns:
String
Throws:
WTException

newStandardReplicaService

public static StandardReplicaService newStandardReplicaService()
                                                        throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardReplicaService
Throws:
WTException

getFolderDescById

public FolderDesc getFolderDescById(String siteUrl,
                                    long id)
                             throws WTException
Gets a folder description object given the site and object ID.

Supported API: false

Specified by:
getFolderDescById in interface ReplicaServiceSvr
Parameters:
siteUrl -
id -
Returns:
FolderDesc
Throws:
WTException

findFolderToSaveFile

public FolderDesc findFolderToSaveFile(String site_url,
                                       long vault_id)
                                throws WTException
Finds the folder on the local system to save the file to?

Supported API: false

Specified by:
findFolderToSaveFile in interface ReplicaServiceSvr
Parameters:
site_url -
vault_id -
Returns:
FolderDesc
Throws:
WTException

findFolderPathInCache

public String findFolderPathInCache(String siteUrl,
                                    long fid)
                             throws WTException
Deprecated.  

Search the cache to find the path for a specified folder.

Supported API: false

Specified by:
findFolderPathInCache in interface ReplicaServiceSvr
Parameters:
siteUrl -
fid -
Returns:
String
Throws:
WTException

getConfigCache

private ConfigCache getConfigCache()
                            throws MethodServerException
Returns the configuration information stored in the ServerManger.

Returns:
ConfigCache
Throws:
MethodServerException

getMyHostName

private static String getMyHostName()

initConfigCache

private void initConfigCache()
If the config info is already in the cache get it. If the config info is not already in the cache, mark it as unavailable. The config info will be obtained if a request for content from a particular master will be obtained


isMasterReady

private boolean isMasterReady(String master)

getConfigCacheFromMaster

private void getConfigCacheFromMaster(String masterHost)

receiveConfigInfo

public static void receiveConfigInfo(String master,
                                     SiteDesc theConfigInfo)
This is the Doer method that processes the input information from the HTTPRequest that we posted earlier.


printCurrDesc

private static void printCurrDesc(HostDesc currDesc)

logCurrDesc

private static void logCurrDesc(HostDesc currDesc)

initConfigInfo

private static void initConfigInfo(String masterUrl)

findActiveFolder

private FolderDesc findActiveFolder(VaultDesc vault)

acceptReplicateStreamed

public static ActionShippingItem acceptReplicateStreamed(Long replSessionID,
                                                         Long replicatedItemID,
                                                         Long replicaVaultID,
                                                         String siteURL,
                                                         InputStream contentStream)

handleExeptionOnAcceptReplicateStreamed

private static ActionShippingItem handleExeptionOnAcceptReplicateStreamed(ActionShippingItem reply,
                                                                          Long replicatedItemID,
                                                                          Long rSessionID,
                                                                          Long folderToRO)

cleanUpFilesInFolder

public static ActionShippingItem cleanUpFilesInFolder(Long folderID,
                                                      Vector filesToDelete,
                                                      String siteURL,
                                                      ActionShippingItem reply)

copyFileFromVaultToVault

public static ActionShippingItem copyFileFromVaultToVault(Long sessionID,
                                                          Long destItemID,
                                                          Long destVaultID,
                                                          Long origFolderID,
                                                          Long origItemID,
                                                          String siteURL)

replCopyFile

private static boolean replCopyFile(BackupedFile fromFile,
                                    BackupedFile toFile,
                                    FolderDesc destFolder)