wt.fv.uploadtocache
Class StandardUploadToCacheService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.fv.uploadtocache.StandardUploadToCacheService
All Implemented Interfaces:
Manager, NetFactor, Serializable, UploadToCacheService

public class StandardUploadToCacheService
extends StandardManager
implements UploadToCacheService, Serializable

Use the newStandardUploadToCacheService static factory method(s), not the StandardUploadToCacheService 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
(package private) static class StandardUploadToCacheService.RevaultCachedContentListener
           
 
Field Summary
private static String CLASSNAME
           
private static String MIRROR_MOUNT_PATH_SEPARATOR
           
private static String RESOURCE
           
private static boolean REVAULT_CACHEDITEMS_ON_COMMIT
           
private static String REVAULT_CACHEDITEMS_QUEUE_NAME
           
private static String REVAULT_CACHEDITEMS_TRANSACTION_LISTENER
           
private static ProcessingQueue revaultQueue
           
private static String UPLOAD_HELPER_CLASS
           
private static String UPLOAD_TO_MASTER_CACHE_METHOD
           
private static String UPLOAD_TO_REPLICA_CACHE_METHOD
           
private static boolean USE_FVITEMS_STORED_PROCEDURE
           
 
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
StandardUploadToCacheService()
           
 
Method Summary
 void clientUpdateContent(String docNumber, String fileName, CachedContentDescriptor cachedContDescr)
          This method is intended for test purposes only.
private  FvItem createFvItem(FileFolder actFolder)
           
private  Object[] createFvItems(FileFolder actFolder, long numberOfItems)
           
private  FvItem createLocalFvItem(FileFolder actFolder)
          This method only create FvItem and set folder reference, it will not save it to database.
private  MasteredOnReplicaItem createLocalMasteredOnReplicaItem(FileFolder actFolder)
          This method only create MasteredOnReplicaItem and set folder reference, it will not save it to database.
private  MasteredOnReplicaItem createMasteredOnReplicaItem(FileFolder actFolder)
           
private  Object[] createMasteredOnReplicaItems(FileFolder actFolder, long numberOfItems)
           
private static ProcessingQueue createQueue(String queueName, boolean removeFailedEntires)
           
private  Object[] createStoredItems(FileFolder actFolder, long numberOfItems, boolean masteredOnReplica)
           
private  String createURLToCacheContent(Site cacheSite)
           
 Vector findBackupFileList(String holderId)
          Find a list of files related to Content Cache Server needed to backup for the specified ContentHolder with the ID "holderId".
 Vector findBackupFileListForSite(String siteName)
          Find a list of files related to Content Cache Server needed to backup for the specified site.
static void findStreamAtReplica(HTTPRequest request, HTTPResponse response)
           
 CacheDescriptor getCacheDescriptor(int number_of_files)
          

Supported API: false
 CacheDescriptor getCacheDescriptor(int number_of_files, boolean useMasterCache)
          Get CacheDescriptor for the specified number of files for upload to preferred site.
private  Site getCacheSite(boolean useMasterCache)
           
 String getConceptualClassname()
          Deprecated.  
static Vault getEnabledCacheDesignatedVault(Site site)
           
static FvItem getFvItem(long streamId)
           
static Hashtable getFvItems(long[] streamIds)
           
private  Site getLocalSite()
           
static InputStream getMasteredItemInputStream(MasteredOnReplicaItem item)
          Get the InputStream from replica site corresponding to the MasteredOnReplicaItem "item"

Supported API: false
static MasteredOnReplicaItem getMasteredOnReplicaItem(long streamId)
           
static Hashtable getMasteredOnReplicaItems(long[] streamIds)
           
private static String getSafeFolderPath(String folderPath)
          Gets the first path in the folder mount.
static StandardUploadToCacheService newStandardUploadToCacheService()
          Default factory for the class.
private static void PP(String s)
           
private static InputStream pullStreamFromReplica(String replicaUrl, long FolderId, String fileName)
           
private static WTDocument queryDocument(String number)
           
private static Site querySiteForMasteredOnReplicaItem(MasteredOnReplicaItem item)
           
static void registerForRevaulting(ContentHolder holder, FvItem contentItem)
           
static void setMirrorMountPathSeparator(String newSeparator)
          Sets a new separator used for mirror mount multiple paths.
Default separator is semicolon ( ; )
private  String signURL(String aUrl)
           
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, performStartupProcess, 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

UPLOAD_HELPER_CLASS

private static final String UPLOAD_HELPER_CLASS
See Also:
Constant Field Values

UPLOAD_TO_REPLICA_CACHE_METHOD

private static final String UPLOAD_TO_REPLICA_CACHE_METHOD
See Also:
Constant Field Values

UPLOAD_TO_MASTER_CACHE_METHOD

private static final String UPLOAD_TO_MASTER_CACHE_METHOD
See Also:
Constant Field Values

MIRROR_MOUNT_PATH_SEPARATOR

private static String MIRROR_MOUNT_PATH_SEPARATOR

REVAULT_CACHEDITEMS_TRANSACTION_LISTENER

private static final String REVAULT_CACHEDITEMS_TRANSACTION_LISTENER
See Also:
Constant Field Values

REVAULT_CACHEDITEMS_QUEUE_NAME

private static final String REVAULT_CACHEDITEMS_QUEUE_NAME
See Also:
Constant Field Values

REVAULT_CACHEDITEMS_ON_COMMIT

private static boolean REVAULT_CACHEDITEMS_ON_COMMIT

revaultQueue

private static ProcessingQueue revaultQueue

USE_FVITEMS_STORED_PROCEDURE

private static boolean USE_FVITEMS_STORED_PROCEDURE
Constructor Detail

StandardUploadToCacheService

public StandardUploadToCacheService()
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

getMasteredItemInputStream

public static InputStream getMasteredItemInputStream(MasteredOnReplicaItem item)
                                              throws WTException
Get the InputStream from replica site corresponding to the MasteredOnReplicaItem "item"

Supported API: false

Parameters:
item -
Returns:
InputStream
Throws:
WTException

newStandardUploadToCacheService

public static StandardUploadToCacheService newStandardUploadToCacheService()
                                                                    throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardUploadToCacheService
Throws:
WTException

getCacheDescriptor

public CacheDescriptor getCacheDescriptor(int number_of_files)
                                   throws WTException


Supported API: false

Specified by:
getCacheDescriptor in interface UploadToCacheService
Parameters:
number_of_files -
Returns:
CacheDescriptor
Throws:
WTException

clientUpdateContent

public void clientUpdateContent(String docNumber,
                                String fileName,
                                CachedContentDescriptor cachedContDescr)
                         throws WTException,
                                PropertyVetoException
This method is intended for test purposes only. It intends to add new cached content to WTDocument located by docNumber.

Supported API: false

Specified by:
clientUpdateContent in interface UploadToCacheService
Parameters:
docNumber -
fileName -
cachedContDescr -
Throws:
WTException
PropertyVetoException

findBackupFileListForSite

public Vector findBackupFileListForSite(String siteName)
                                 throws WTException
Find a list of files related to Content Cache Server needed to backup for the specified site.

Supported API: false

Specified by:
findBackupFileListForSite in interface UploadToCacheService
Parameters:
siteName -
Returns:
Vector
Throws:
WTException

findBackupFileList

public Vector findBackupFileList(String holderId)
                          throws WTException
Find a list of files related to Content Cache Server needed to backup for the specified ContentHolder with the ID "holderId".

Supported API: false

Specified by:
findBackupFileList in interface UploadToCacheService
Parameters:
holderId -
Returns:
Vector
Throws:
WTException

getCacheDescriptor

public CacheDescriptor getCacheDescriptor(int number_of_files,
                                          boolean useMasterCache)
                                   throws WTException
Get CacheDescriptor for the specified number of files for upload to preferred site. If preferred site is not set for user or preferred site does not have a Content Cache designated Vault then CacheDescriptor for upload to local master content cache is returned if useMasterCache is true else null is returned.

Supported API: false

Specified by:
getCacheDescriptor in interface UploadToCacheService
Parameters:
number_of_files -
useMasterCache -
Returns:
CacheDescriptor
Throws:
WTException

pullStreamFromReplica

private static InputStream pullStreamFromReplica(String replicaUrl,
                                                 long FolderId,
                                                 String fileName)
                                          throws WTException
Throws:
WTException

findStreamAtReplica

public static void findStreamAtReplica(HTTPRequest request,
                                       HTTPResponse response)
                                throws WTException
Throws:
WTException

getCacheSite

private Site getCacheSite(boolean useMasterCache)
                   throws WTException
Throws:
WTException

getLocalSite

private Site getLocalSite()
                   throws WTException
Throws:
WTException

createURLToCacheContent

private String createURLToCacheContent(Site cacheSite)
                                throws WTException
Throws:
WTException

createLocalMasteredOnReplicaItem

private MasteredOnReplicaItem createLocalMasteredOnReplicaItem(FileFolder actFolder)
                                                        throws WTException
This method only create MasteredOnReplicaItem and set folder reference, it will not save it to database.

Throws:
WTException

createMasteredOnReplicaItem

private MasteredOnReplicaItem createMasteredOnReplicaItem(FileFolder actFolder)
                                                   throws WTException
Throws:
WTException

createMasteredOnReplicaItems

private Object[] createMasteredOnReplicaItems(FileFolder actFolder,
                                              long numberOfItems)
                                       throws WTException
Throws:
WTException

createFvItems

private Object[] createFvItems(FileFolder actFolder,
                               long numberOfItems)
                        throws WTException
Throws:
WTException

createStoredItems

private Object[] createStoredItems(FileFolder actFolder,
                                   long numberOfItems,
                                   boolean masteredOnReplica)
                            throws WTException
Throws:
WTException

createLocalFvItem

private FvItem createLocalFvItem(FileFolder actFolder)
                          throws WTException
This method only create FvItem and set folder reference, it will not save it to database.

Throws:
WTException

createFvItem

private FvItem createFvItem(FileFolder actFolder)
                     throws WTException
Throws:
WTException

getEnabledCacheDesignatedVault

public static Vault getEnabledCacheDesignatedVault(Site site)
                                            throws WTException
Throws:
WTException

getMasteredOnReplicaItem

public static MasteredOnReplicaItem getMasteredOnReplicaItem(long streamId)
                                                      throws WTException
Throws:
WTException

getMasteredOnReplicaItems

public static Hashtable getMasteredOnReplicaItems(long[] streamIds)
                                           throws WTException
Throws:
WTException

getFvItems

public static Hashtable getFvItems(long[] streamIds)
                            throws WTException
Throws:
WTException

getFvItem

public static FvItem getFvItem(long streamId)
                        throws WTException
Throws:
WTException

queryDocument

private static WTDocument queryDocument(String number)
                                 throws WTException
Throws:
WTException

querySiteForMasteredOnReplicaItem

private static Site querySiteForMasteredOnReplicaItem(MasteredOnReplicaItem item)
                                               throws WTException
Throws:
WTException

PP

private static void PP(String s)

setMirrorMountPathSeparator

public static void setMirrorMountPathSeparator(String newSeparator)
Sets a new separator used for mirror mount multiple paths.
Default separator is semicolon ( ; )

Parameters:
newSeparator - a string with the new separator
Since:
Windchill R6 - build 40

getSafeFolderPath

private static String getSafeFolderPath(String folderPath)
Gets the first path in the folder mount.

Parameters:
folderPath - folder path as stored in the mount
Returns:
first path encountered in the mount
Since:
Windchill R6 - build 40

signURL

private String signURL(String aUrl)
                throws WTException
Throws:
WTException

registerForRevaulting

public static void registerForRevaulting(ContentHolder holder,
                                         FvItem contentItem)

createQueue

private static ProcessingQueue createQueue(String queueName,
                                           boolean removeFailedEntires)
                                    throws WTException
Throws:
WTException