wt.fv
Class StandardFvService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.fv.StandardFvService
All Implemented Interfaces:
FvService, Manager, NetFactor, Serializable

public class StandardFvService
extends StandardManager
implements FvService, Serializable

Standard implementation of the file vault service. Contains implementation of the client and server APIs.

Use the newStandardFvService static factory method(s), not the StandardFvService 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
static class StandardFvService.ActiveFolderCache
          ActiveFolderCache maintains two mappings, vault-to-folder and folder-to-vault (we could have maintain only one mapping but CacheManager doesn't provide API to get a list of values without giving a key, so if we have only the vault-to-folder mapping, then given a folder, we have no way to find the corresponding vault, hence the extra mapping).
static class StandardFvService.FvFolderCache
           
static class StandardFvService.FvMountCache
           
private  class StandardFvService.FvRuleDepItem
           
(package private)  class StandardFvService.FvServiceEventListener
           
(package private)  class StandardFvService.FvServiceMultiObjectEventListener
           
static class StandardFvService.HostCache
           
(package private)  class StandardFvService.RevaultFinderAction
           
(package private)  class StandardFvService.RevaultFinderActionCurVaultToOtherVaults
           
(package private)  class StandardFvService.RevaultFinderActionForceToSingleVault
           
(package private)  class StandardFvService.RevaultFinderActionOtherVaultsToCurVault
           
(package private)  class StandardFvService.RevaultFinderActionPDSToVault
           
(package private)  class StandardFvService.RevaultFinderActionVaultToPDS
           
(package private) static class StandardFvService.UnreferencedFvItemsPurging
          Class for thread spawning of ScheduleUnreferencedFvItemsPurging.
 
Field Summary
private static StandardFvService.ActiveFolderCache _activeFolderCache
           
private static StandardFvService.FvFolderCache _fvFolderCache
           
private static StandardFvService.FvMountCache _fvMountCache
           
private static StandardFvService.HostCache _hostCache
           
private static String CLASSNAME
           
private static boolean DEBUG
           
private static boolean forceOneVault
           
private static String FvHOSTCACHEKEY
           
private static String FvRESOURCE
           
private static ScheduleItem g_scheduledUnreferencedFvItemsPurging
           
private  boolean needRefresh
           
private static FvPolicyRuleHelper policyHelper
           
private static FvPolicyItemCache policyItemCache
           
private static String PURGE_UNREFERENCED_FVITEM_METHOD_NAME
           
private static String PURGE_UNREFERENCED_FVITEM_QUEUE_NAME
           
private static String RESOURCE
           
private static long SLEEP_PURGING_THREAD
           
private static FvSurrogate surrogate
           
 
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
StandardFvService()
           
 
Method Summary
private  void accumulateAllConcreteHolders(String className, Vector res)
           
private static ScheduleItem activateUnreferencedFvItemsPurging()
          Adds the Unreferenced Fvitems purging process to the queue.
 FvFolder addFolder(FvVault vault, FvFolder folder)
          Add a folder to a given vault.
 FvHost addHostToSite(Site site, FvHost host)
          Adds the given host to the give site.
 FvPolicyRule addPolicyRule(FvPolicyRule rule)
          Adds a policy rule.
 Vault addVaultToSite(Site site, Vault vault)
          Adds the given vault to the given site.
private  boolean cancelUnreferencedFvItemsPurging()
          Cancels Unreferenced FvItems Purging process.
private  long checkFileName(String name)
           
private  void checkForceContentToVaultConditions()
           
private  void checkMasterAttr()
           
private  DeletedFilesStatistics cleanUpFilesInFolder(File dir, Vector fileNumbersV, FvFolder folder)
           
private  DeletedFilesStatistics cleanUpFolder(File dir, FvFolder folder)
           
 DeletedFilesStatistics cleanUpFolder(FvFolder folder)
          Clean up a folder by removing unreferenced files from it.
 DeletedFilesStatistics cleanUpFolders(FvVault vault)
          Clean up all the folders from the given FvVault.
private  boolean deleteFile(String path, String name)
           
static void doLocalCleanUp(FvVault vault, CountedHistory history)
          Deletes unreferenced contents.
private  void downloadMountInfo(FvHost host, BufferedWriter out)
           
 void dumpBackupInfo()
          

Supported API: false
private  Vector findAllContHolderClasses(Vault vault)
           
static FileFolder getActiveFolder(Vault vault)
           
protected static FileFolder getActiveFolderFromCache(Vault vault)
           
private static FileFolder getActiveFolderFromDatabase(Vault vault)
           
private  Vector getAllContentHolderClassesInfo()
           
 Vector getAllFolders(Site site, Vault vault)
          Gets all the folders for a given site and FvVault

Supported API: false
 Enumeration getAllHosts(Site site)
          For the given Site, returns all the hosts in the system as an Enumaration of FvHost objects.
 FvPolicyRule[] getAllPolicyRules(String domainName)
          Returns all of the policy rules

Supported API: false
private  void getAllRevaultableItems(Vault vault, Class holderClass, Vector queryInfo, Vector resultItems, String StreamedClass, int pageSize, int numElemToReturn)
           
 Vector getAllRevaultableItems(Vault vault, Vector queryInfo, int pageSize)
          Get all revaultable items from the given vault with streamId is at least "startingStreamId".
private  ApplicationData getAppData(ContentHolder holder, Streamed item)
           
 String getConceptualClassname()
          Deprecated.  
private static ContentHolder getContentHolder(ApplicationData appData)
          Gets the ContentHolder associated with a specific ApplicationData.
static FileFolder getFileFolderFromCache(ObjectIdentifier folderKey)
           
 String[] getFileLists(FvMount mount)
          Get the list of all files in the directory as identified by the "mount"

Supported API: false
static Vector getFileLocation(ApplicationData appData)
          Gets set of possible locations associated with a file in URL format.
Warning:
This method has a limited scope and will work under most of possible mounting scenarios, but not all of them (different physical folders, abandoned mount, etc).
static Vector getFileLocation(ApplicationData appData, ContentHolder holder)
          Gets set of possible locations associated with a file in URL format.
Warning:
This method has a limited scope and will work under most of possible mounting scenarios, but not all of them (different physical folders, abandoned mount, etc).
static String getFileLocation(ApplicationData appData, String delimiter)
          Gets a set of possible locations associated with a file in URL format.
Warning:
This method has a limited scope and will work under most of possible mounting scenarios, but not all of them (different physical folders, abandoned mount, etc).
static WTKeyedMap getFileURLs(WTKeyedMap holders, WTValuedHashMap fvItems)
          Gets a set of possible locations associated with a file in URL format.
Warning:
This method has a limited scope and will work under most of possible mounting scenarios, but not all of them (different physical folders, abandoned mount, etc).
static FileFolder getFolderById(long folderId)
           
private static FvMount getFvMountFromCache(FileFolder folder, FvHost host)
           
private static Vector getFvMountsFromCache(FileFolder folder)
           
private  Enumeration getHolderItems(ContentHolder holder)
           
protected static StandardFvService.HostCache getHostCache()
           
 Vector getHostMounts(FvHost host)
           
private  Vector getHostMounts(FvHost host, boolean lock)
           
 Enumeration getLocalFolders(Site site, Vault vault)
          Returns all the FvFolders given a site and a vault.
static FvMount getLocalMount(FvFolder fvFolder)
           
 Vector getLocalVaults(Site site)
          Gets all the FvVaults for the given site object

Supported API: false
private static Vector getMountsToFolder(FileFolder folder)
          Gets Vector with FvMounts associated to specific folder.
(package private) static FvHost getMyFvHost()
           
private static int getNumberFilesInFolder(FileFolder folder)
           
 FvPolicyItem getPolicyItem(Selector sel)
          

Supported API: false
protected static FvPolicyItemCache getPolicyItemCache()
          

Supported API: false
 FvPolicyItem[] getPolicyItems()
          Returns all of the policy items.
 FvPolicyRule getPolicyRule(Selector sel)
          Returns a policy rule for a given selector.
private  Selector[] getSelectors(Selector sel)
          Get all selectors belonged to the same administrative domain as "sel".
 Vector getSiteMounts(Site site)
          Gets all the FvMounts for a given site.
static Streamed getStreamedObject(ContentHolder holder)
          Returns an object implementing Streamed interface for streaming content file to.
protected static Vault getVault(ContentHolder holder, Site site, String vaultClassTypeName)
          Get a file vault.
(package private)  FvVault getVault(Streamed item)
           
protected static Vault getVaultFromCache(FileFolder folder)
           
private  FvVault getVaultFromDB(Selector sel, Selector[] selectors)
          Find a file vault policy rule whose selector is in the set of "selectors" and is most closely related to "sel".
private static boolean hasActiveFolders(FvVault vault)
           
private  void initSiteCacheVault(Site localSite)
           
private  void invalidateMountSet(QueryResult qrm)
           
private  void invalidateMountSet(QueryResult qrm, boolean isArraySet)
           
private  boolean isAbortRevaulting(RevaultingSession revSession)
           
private  boolean isHolderClassASubClassOf(String holderClassName, Vector allHolderClassNames)
           
(package private) static boolean isSpecialContent(Object obj)
           
(package private) static boolean isSpecialContentClass(Class theClass)
           
(package private) static boolean lockFilesExist(FvFolder folder)
           
private  void markMountInvalid(FvMount theMount)
           
 FvMount mountFolder(FvHost host, FileFolder folder, String path, boolean local)
          Mounts a folder to a given host.
 FvFolder moveFolder(FvFolder folder, FvVault newVault)
          Moves a folder to another vault.
static StandardFvService newStandardFvService()
          

Supported API: false
protected  void onSaveFailure(Object object)
          

Supported API: false
protected  void performStartupProcess()
          Initialization tasks performed by the engine service.
private static void PP(String message)
           
private  void prepareDBForRevaulting()
           
static void purgeUnreferencedFvItems()
           
protected static void putActiveFolderInCache(Vault v, FileFolder f)
           
protected static boolean putHostArrayToHostCache()
           
 void registerEvents(ManagerService manager)
          Overrides the registration of all applicable lifecycle service events with the service manager.
protected static void remHostArrayFromHostCache()
           
protected static void removeActiveFolderFromCache(FileFolder f)
           
private static void removeFileFolderFromCache(FileFolder folder)
           
private static void removeFileFolderFromCache(ObjectIdentifier key)
           
private static void removeFvMountFromCache(FvMount mount)
           
private static void removeFvMountFromCache(ObjectIdentifier key)
           
private  void resetPreferredSiteToMaster(String replicaSiteName)
           
 void revault(FvVault vault)
          This method synchronizes the given vault with the vaulting rules which are in place.
private  void reVault(FvVault vault, RevaultingSession curRevSession)
           
static void revaultCachedHolderContent(ObjectIdentifier holderId, ObjectIdentifier contentId)
           
 void revaultHolderContent(ContentHolder holder)
           
 void revaultHolderContent(ContentHolder holder, Streamed item, FvVault toVault)
           
static void reVaulting(FvVault vault, RevaultingSession curRevSession)
          

Supported API: false
private  int revaultStep(StandardFvService.RevaultFinderAction finder, long currCounterId, String methodName, int numPrevQueued, RevaultingSession curRevSession)
           
static void revaultURLContent(RevaultUrlSession session)
          

Supported API: false
private  void spawnUnreferencedFvItemsPurging()
          Spawns process for running Unreferenced FvItems Purging.
It can be through threading or direct call (see commented options in the code).
private  void stopRevaulting()
           
 void unmountFolder(FvHost host, FileFolder folder)
          Unmount the specified folder from a given host.
 void updateFolderSeqNumbers(Vault vault, Vector folders)
          This function is used to reorder the sequence numbers within a vault.
private  RevaultingSession updateNumElemInRevSession(RevaultingSession session, int elemNum)
           
protected  void updatePolicyItems(Selector sel)
          Updates the item for the given selector and all items whose selector is more specific than the given one.
private  void updatePreferredSiteName(String oldName, String newName)
           
private  void updateUserCacheSitePreference(Site theSite, String evtType)
          Update User's preferred content cache site when site is changed (PREFER_MODIFY) or deleted (PRE_DELETE)
private  boolean validateFvMountPath(FvMount the_mount)
           
private  boolean validateHostName(String hostName)
           
private  void validateMount(FvMount mount)
           
 int validateRelatedFvMounts(FileFolder folder, boolean disabled, boolean ronly)
          Validate the mounts for the given folder.
 int validateRelatedFvMounts(FvHost host, boolean disabled, boolean ronly)
          Validate the mounts for the given host.
 int validateRelatedFvMounts(FvMount mount, boolean disabled, boolean ronly)
          Validate the given mount

Supported API: false
 int validateRelatedFvMounts(Vault vault, boolean disabled, boolean ronly)
          Validate the mounts for the given vault

Supported API: false
 int validateRelMounts(Vector target, boolean disabled, boolean ronly)
          

Supported API: false
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, 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

policyItemCache

private static FvPolicyItemCache policyItemCache

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

needRefresh

private boolean needRefresh

surrogate

private static FvSurrogate surrogate

policyHelper

private static FvPolicyRuleHelper policyHelper

forceOneVault

private static boolean forceOneVault

FvRESOURCE

private static final String FvRESOURCE
See Also:
Constant Field Values

FvHOSTCACHEKEY

private static final String FvHOSTCACHEKEY
See Also:
Constant Field Values

g_scheduledUnreferencedFvItemsPurging

private static ScheduleItem g_scheduledUnreferencedFvItemsPurging

PURGE_UNREFERENCED_FVITEM_QUEUE_NAME

private static final String PURGE_UNREFERENCED_FVITEM_QUEUE_NAME
See Also:
Constant Field Values

PURGE_UNREFERENCED_FVITEM_METHOD_NAME

private static final String PURGE_UNREFERENCED_FVITEM_METHOD_NAME
See Also:
Constant Field Values

SLEEP_PURGING_THREAD

private static final long SLEEP_PURGING_THREAD
See Also:
Constant Field Values

_fvFolderCache

private static StandardFvService.FvFolderCache _fvFolderCache

_fvMountCache

private static StandardFvService.FvMountCache _fvMountCache

_activeFolderCache

private static StandardFvService.ActiveFolderCache _activeFolderCache

_hostCache

private static StandardFvService.HostCache _hostCache
Constructor Detail

StandardFvService

public StandardFvService()
Method Detail

stopRevaulting

private void stopRevaulting()
                     throws WTException
Throws:
WTException

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

newStandardFvService

public static StandardFvService newStandardFvService()
                                              throws WTException


Supported API: false

Returns:
StandardFvService
Throws:
WTException

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

registerEvents

public void registerEvents(ManagerService manager)
Overrides the registration of all applicable lifecycle service events with the service manager.

Supported API: false

Specified by:
registerEvents in interface Manager
Overrides:
registerEvents in class StandardManager
Parameters:
manager - the ManagerService object used to override the registration of applicable events with the service manager

getStreamedObject

public static Streamed getStreamedObject(ContentHolder holder)
                                  throws WTException
Returns an object implementing Streamed interface for streaming content file to.

Supported API: false

Parameters:
holder -
Returns:
Streamed
Throws:
WTException

updatePolicyItems

protected void updatePolicyItems(Selector sel)
                          throws WTException
Updates the item for the given selector and all items whose selector is more specific than the given one. This method should be used after a rule is updated or deleted so that the items are kept in synch with the rules.

Supported API: false

Parameters:
sel -
Throws:
WTException

getPolicyItemCache

protected static FvPolicyItemCache getPolicyItemCache()


Supported API: false

Returns:
FvPolicyItemCache

getVault

protected static Vault getVault(ContentHolder holder,
                                Site site,
                                String vaultClassTypeName)
                         throws WTException
Get a file vault.

Supported API: false

Parameters:
holder -
site -
vaultClassTypeName -
Returns:
Vault
Throws:
WTException

onSaveFailure

protected void onSaveFailure(Object object)
                      throws WTException,
                             WTPropertyVetoException


Supported API: false

Parameters:
object -
Throws:
WTException
WTPropertyVetoException

reVaulting

public static void reVaulting(FvVault vault,
                              RevaultingSession curRevSession)
                       throws WTException


Supported API: false

Parameters:
vault -
curRevSession -
Throws:
WTException

doLocalCleanUp

public static void doLocalCleanUp(FvVault vault,
                                  CountedHistory history)
                           throws WTException
Deletes unreferenced contents.

Supported API: false

Parameters:
vault -
history -
Throws:
WTException

revaultURLContent

public static void revaultURLContent(RevaultUrlSession session)
                              throws WTException


Supported API: false

Parameters:
session -
Throws:
WTException

addFolder

public FvFolder addFolder(FvVault vault,
                          FvFolder folder)
                   throws WTException
Add a folder to a given vault. The specified folder's number will define an order in which the folder is going to be used in a vault.

Specifying a number that already exists for a given vault results in shifting vaults to make a room for a new one.

Specifying -1 results in adding a folder to the end of the list.

Supported API: false

Specified by:
addFolder in interface FvService
Parameters:
vault -
folder -
Returns:
FvFolder
Throws:
WTException

mountFolder

public FvMount mountFolder(FvHost host,
                           FileFolder folder,
                           String path,
                           boolean local)
                    throws WTPropertyVetoException,
                           WTException
Mounts a folder to a given host. A folder can be mounted as local to no more than one host.

Supported API: false

Specified by:
mountFolder in interface FvService
Parameters:
host -
folder -
path -
local -
Returns:
FvMount
Throws:
WTPropertyVetoException
WTException

unmountFolder

public void unmountFolder(FvHost host,
                          FileFolder folder)
                   throws WTException
Unmount the specified folder from a given host.

Supported API: false

Specified by:
unmountFolder in interface FvService
Parameters:
host -
folder -
Throws:
WTException

cleanUpFolder

public DeletedFilesStatistics cleanUpFolder(FvFolder folder)
                                     throws WTException
Clean up a folder by removing unreferenced files from it.

Supported API: false

Specified by:
cleanUpFolder in interface FvService
Parameters:
folder -
Returns:
DeletedFilesStatistics
Throws:
WTException

cleanUpFolders

public DeletedFilesStatistics cleanUpFolders(FvVault vault)
                                      throws WTException
Clean up all the folders from the given FvVault. This method will fail if all folders in the vault are not mounted.

Supported API: false

Specified by:
cleanUpFolders in interface FvService
Parameters:
vault -
Returns:
DeletedFilesStatistics
Throws:
WTException

addPolicyRule

public FvPolicyRule addPolicyRule(FvPolicyRule rule)
                           throws WTException
Adds a policy rule. A policy rule will not be added if a different policy rule exists for a given selector.

Supported API: false

Specified by:
addPolicyRule in interface FvService
Parameters:
rule -
Returns:
FvPolicyRule
Throws:
WTException

getPolicyRule

public FvPolicyRule getPolicyRule(Selector sel)
                           throws WTException
Returns a policy rule for a given selector.

Supported API: false

Specified by:
getPolicyRule in interface FvService
Parameters:
sel -
Returns:
FvPolicyRule
Throws:
WTException

getAllPolicyRules

public FvPolicyRule[] getAllPolicyRules(String domainName)
                                 throws WTException
Returns all of the policy rules

Supported API: false

Specified by:
getAllPolicyRules in interface FvService
Parameters:
domainName -
Returns:
FvPolicyRule[]
Throws:
WTException

getPolicyItem

public FvPolicyItem getPolicyItem(Selector sel)
                           throws WTException


Supported API: false

Specified by:
getPolicyItem in interface FvService
Parameters:
sel -
Returns:
FvPolicyItem
Throws:
WTException

getPolicyItems

public FvPolicyItem[] getPolicyItems()
                              throws WTException
Returns all of the policy items.

Supported API: false

Specified by:
getPolicyItems in interface FvService
Returns:
FvPolicyItem[]
Throws:
WTException

moveFolder

public FvFolder moveFolder(FvFolder folder,
                           FvVault newVault)
                    throws WTException,
                           WTPropertyVetoException
Moves a folder to another vault.

Supported API: false

Specified by:
moveFolder in interface FvService
Parameters:
folder - the folder to be moved.
newVault - the vault that the folder is to be moved to.
Returns:
FvFolder
Throws:
WTException
WTPropertyVetoException

updateFolderSeqNumbers

public void updateFolderSeqNumbers(Vault vault,
                                   Vector folders)
                            throws WTException,
                                   WTPropertyVetoException
This function is used to reorder the sequence numbers within a vault.

Supported API: false

Specified by:
updateFolderSeqNumbers in interface FvService
Parameters:
vault - The vault whose folder sequence numbers are to be updated.
folders - the vector of FvFolders with the desired sequence number attributes.
Throws:
WTException
WTPropertyVetoException

dumpBackupInfo

public void dumpBackupInfo()
                    throws WTException


Supported API: false

Specified by:
dumpBackupInfo in interface FvService
Throws:
WTException

revault

public void revault(FvVault vault)
             throws WTException
This method synchronizes the given vault with the vaulting rules which are in place. This is typically a scheduled occurrence although it can be forced by scheduling the method as immediate/once.

Supported API: false

Specified by:
revault in interface FvService
Parameters:
vault -
Throws:
WTException

validateRelatedFvMounts

public int validateRelatedFvMounts(Vault vault,
                                   boolean disabled,
                                   boolean ronly)
                            throws WTException
Validate the mounts for the given vault

Supported API: false

Specified by:
validateRelatedFvMounts in interface FvService
Parameters:
vault -
disabled -
ronly -
Returns:
int
Throws:
WTException

validateRelatedFvMounts

public int validateRelatedFvMounts(FileFolder folder,
                                   boolean disabled,
                                   boolean ronly)
                            throws WTException
Validate the mounts for the given folder.

Supported API: false

Specified by:
validateRelatedFvMounts in interface FvService
Parameters:
folder -
disabled -
ronly -
Returns:
int
Throws:
WTException

validateRelatedFvMounts

public int validateRelatedFvMounts(FvHost host,
                                   boolean disabled,
                                   boolean ronly)
                            throws WTException
Validate the mounts for the given host.

Supported API: false

Specified by:
validateRelatedFvMounts in interface FvService
Parameters:
host -
disabled -
ronly -
Returns:
int
Throws:
WTException

validateRelatedFvMounts

public int validateRelatedFvMounts(FvMount mount,
                                   boolean disabled,
                                   boolean ronly)
                            throws WTException
Validate the given mount

Supported API: false

Specified by:
validateRelatedFvMounts in interface FvService
Parameters:
mount -
disabled -
ronly -
Returns:
int
Throws:
WTException

validateRelMounts

public int validateRelMounts(Vector target,
                             boolean disabled,
                             boolean ronly)
                      throws WTException


Supported API: false

Specified by:
validateRelMounts in interface FvService
Parameters:
target -
disabled -
ronly -
Returns:
int
Throws:
WTException

getAllHosts

public Enumeration getAllHosts(Site site)
                        throws WTException
For the given Site, returns all the hosts in the system as an Enumaration of FvHost objects.

Supported API: false

Specified by:
getAllHosts in interface FvService
Parameters:
site -
Returns:
Enumeration
Throws:
WTException

getLocalVaults

public Vector getLocalVaults(Site site)
                      throws WTException
Gets all the FvVaults for the given site object

Supported API: false

Specified by:
getLocalVaults in interface FvService
Parameters:
site - : Site the site object to find the FvVautls from
Returns:
Vector
Throws:
WTException

getAllFolders

public Vector getAllFolders(Site site,
                            Vault vault)
                     throws WTException
Gets all the folders for a given site and FvVault

Supported API: false

Specified by:
getAllFolders in interface FvService
Parameters:
site -
vault -
Returns:
Vector
Throws:
WTException

addHostToSite

public FvHost addHostToSite(Site site,
                            FvHost host)
                     throws WTException
Adds the given host to the give site.

Supported API: false

Specified by:
addHostToSite in interface FvService
Parameters:
site -
host -
Returns:
FvHost
Throws:
WTException

addVaultToSite

public Vault addVaultToSite(Site site,
                            Vault vault)
                     throws WTException
Adds the given vault to the given site.

Supported API: false

Specified by:
addVaultToSite in interface FvService
Parameters:
site -
vault -
Returns:
Vault
Throws:
WTException

getLocalFolders

public Enumeration getLocalFolders(Site site,
                                   Vault vault)
                            throws WTException
Returns all the FvFolders given a site and a vault. If vault is null, all FvFolders for the given site are returned.

Supported API: false

Specified by:
getLocalFolders in interface FvService
Parameters:
site -
vault -
Returns:
Enumeration
Throws:
WTException

getSiteMounts

public Vector getSiteMounts(Site site)
                     throws WTException
Gets all the FvMounts for a given site.

Supported API: false

Specified by:
getSiteMounts in interface FvService
Returns:
Vector of FvMounts belonging to the given site.
Throws:
WTException

getAllRevaultableItems

public Vector getAllRevaultableItems(Vault vault,
                                     Vector queryInfo,
                                     int pageSize)
                              throws WTException,
                                     WTPropertyVetoException
Get all revaultable items from the given vault with streamId is at least "startingStreamId". The "pageSize" is the maximum number of items to be sent to client per RMI request, which is configurable at client's side.

Supported API: false

Specified by:
getAllRevaultableItems in interface FvService
Parameters:
vault -
queryInfo - The information about the query information passed and updated between client and server. The first entry is Long, representing only the Streamed objects whose streamId is at least this number for the content holder class as in the last element of the Vector.
pageSize -
Returns:
Vector
Throws:
WTException
WTPropertyVetoException

getFileLists

public String[] getFileLists(FvMount mount)
                      throws WTException
Get the list of all files in the directory as identified by the "mount"

Supported API: false

Specified by:
getFileLists in interface FvService
Parameters:
mount -
Returns:
String[]
Throws:
WTException

getActiveFolderFromCache

protected static FileFolder getActiveFolderFromCache(Vault vault)

getVaultFromCache

protected static Vault getVaultFromCache(FileFolder folder)

putActiveFolderInCache

protected static void putActiveFolderInCache(Vault v,
                                             FileFolder f)

removeActiveFolderFromCache

protected static void removeActiveFolderFromCache(FileFolder f)

getActiveFolder

public static FileFolder getActiveFolder(Vault vault)
                                  throws FvFileCanNotBeStored
Throws:
FvFileCanNotBeStored

getActiveFolderFromDatabase

private static FileFolder getActiveFolderFromDatabase(Vault vault)
                                               throws FvFileCanNotBeStored
Throws:
FvFileCanNotBeStored

getNumberFilesInFolder

private static int getNumberFilesInFolder(FileFolder folder)
                                   throws WTException
Throws:
WTException

hasActiveFolders

private static boolean hasActiveFolders(FvVault vault)

getMyFvHost

static FvHost getMyFvHost()
                   throws WTException
Throws:
WTException

getLocalMount

public static FvMount getLocalMount(FvFolder fvFolder)
                             throws WTException
Throws:
WTException

getSelectors

private Selector[] getSelectors(Selector sel)
                         throws WTException
Get all selectors belonged to the same administrative domain as "sel".

Throws:
WTException

getVaultFromDB

private FvVault getVaultFromDB(Selector sel,
                               Selector[] selectors)
Find a file vault policy rule whose selector is in the set of "selectors" and is most closely related to "sel". A selector is most closely related to "sel" if it has the same class name and state name as "sel", or if it has the same class name as "sel" and state name "ALL_STATES", or if the class specified by its class name is a super class of the class as specified by the class name of "sel" and its state name is either the same as that of "sel" or "All_STATES".


lockFilesExist

static boolean lockFilesExist(FvFolder folder)
                       throws WTException
Throws:
WTException

cleanUpFolder

private DeletedFilesStatistics cleanUpFolder(File dir,
                                             FvFolder folder)
                                      throws WTException
Throws:
WTException

cleanUpFilesInFolder

private DeletedFilesStatistics cleanUpFilesInFolder(File dir,
                                                    Vector fileNumbersV,
                                                    FvFolder folder)
                                             throws WTException
Throws:
WTException

checkFileName

private long checkFileName(String name)

deleteFile

private boolean deleteFile(String path,
                           String name)

validateMount

private void validateMount(FvMount mount)
                    throws WTException
Throws:
WTException

downloadMountInfo

private void downloadMountInfo(FvHost host,
                               BufferedWriter out)
                        throws WTException,
                               IOException
Throws:
WTException
IOException

revaultCachedHolderContent

public static void revaultCachedHolderContent(ObjectIdentifier holderId,
                                              ObjectIdentifier contentId)
                                       throws WTException
Throws:
WTException

revaultHolderContent

public void revaultHolderContent(ContentHolder holder)
                          throws WTException
Throws:
WTException

revaultHolderContent

public void revaultHolderContent(ContentHolder holder,
                                 Streamed item,
                                 FvVault toVault)
                          throws WTException
Throws:
WTException

getHolderItems

private Enumeration getHolderItems(ContentHolder holder)
                            throws WTException
Throws:
WTException

getVault

FvVault getVault(Streamed item)
           throws WTException
Throws:
WTException

isAbortRevaulting

private boolean isAbortRevaulting(RevaultingSession revSession)

reVault

private void reVault(FvVault vault,
                     RevaultingSession curRevSession)
              throws WTException
Throws:
WTException

updateNumElemInRevSession

private RevaultingSession updateNumElemInRevSession(RevaultingSession session,
                                                    int elemNum)
                                             throws WTException
Throws:
WTException

prepareDBForRevaulting

private void prepareDBForRevaulting()
                             throws WTException
Throws:
WTException

markMountInvalid

private void markMountInvalid(FvMount theMount)
                       throws WTException
Throws:
WTException

invalidateMountSet

private void invalidateMountSet(QueryResult qrm)
                         throws WTException
Throws:
WTException

invalidateMountSet

private void invalidateMountSet(QueryResult qrm,
                                boolean isArraySet)
                         throws WTException
Throws:
WTException

validateFvMountPath

private boolean validateFvMountPath(FvMount the_mount)

validateHostName

private boolean validateHostName(String hostName)

getHostMounts

private Vector getHostMounts(FvHost host,
                             boolean lock)
                      throws WTException
Throws:
WTException

getHostMounts

public Vector getHostMounts(FvHost host)
                     throws WTException
Throws:
WTException

getHostCache

protected static StandardFvService.HostCache getHostCache()
                                                   throws MethodServerException
Throws:
MethodServerException

remHostArrayFromHostCache

protected static void remHostArrayFromHostCache()
                                         throws WTException
Throws:
WTException

putHostArrayToHostCache

protected static boolean putHostArrayToHostCache()
                                          throws WTException
Throws:
WTException

checkMasterAttr

private void checkMasterAttr()
                      throws ManagerException
Throws:
ManagerException

getFolderById

public static FileFolder getFolderById(long folderId)
                                throws WTException
Throws:
WTException

PP

private static void PP(String message)

getFileLocation

public static Vector getFileLocation(ApplicationData appData)
Gets set of possible locations associated with a file in URL format.
Warning:
This method has a limited scope and will work under most of possible mounting scenarios, but not all of them (different physical folders, abandoned mount, etc).

Parameters:
appData - ApplicationData info associated with the file to look for
Returns:
Vector of Strings containing all possible paths of the file.

Supported API: true

Extendable: false
Since:
Windchill R6 - build ?

getFileLocation

public static Vector getFileLocation(ApplicationData appData,
                                     ContentHolder holder)
Gets set of possible locations associated with a file in URL format.
Warning:
This method has a limited scope and will work under most of possible mounting scenarios, but not all of them (different physical folders, abandoned mount, etc).

Parameters:
appData - ApplicationData info associated with the file to look for
holder - ContentHolder owner of appData
Returns:
Vector of Strings containing all possible paths of the file.

Supported API: true

Extendable: false
Since:
Windchill R6.2.6 DSU 5

getFileLocation

public static String getFileLocation(ApplicationData appData,
                                     String delimiter)
Gets a set of possible locations associated with a file in URL format.
Warning:
This method has a limited scope and will work under most of possible mounting scenarios, but not all of them (different physical folders, abandoned mount, etc).

Parameters:
appData - ApplicationData info associated with the file to look for
delimiter - String to serve as a delimiter among the possible paths.
if null or empty, assumes semicolon (;)
Returns:
string containing all possible paths of the file.
It can return an empty string due to initialization problems with the passed parameter or when the file resides in the DB, not in a vault.

Supported API: true

Extendable: false
Since:
Windchill R6 - build ?

getContentHolder

private static ContentHolder getContentHolder(ApplicationData appData)
Gets the ContentHolder associated with a specific ApplicationData.

Parameters:
appData - ApplicationData to look for ContentHolder
Returns:
ContentHolder associated with it

getMountsToFolder

private static Vector getMountsToFolder(FileFolder folder)
Gets Vector with FvMounts associated to specific folder.

Parameters:
folder - folder to look for associated mounted hosts
Returns:
Vector with associated FvMounts
Since:
Windchill R6 - build ?

getFileURLs

public static WTKeyedMap getFileURLs(WTKeyedMap holders,
                                     WTValuedHashMap fvItems)
                              throws WTException
Gets a set of possible locations associated with a file in URL format.
Warning:
This method has a limited scope and will work under most of possible mounting scenarios, but not all of them (different physical folders, abandoned mount, etc).

Parameters:
holders - WTKeyedMap between ContentHolder and List of its ApplicationData
Returns:
WTKeyedMap between ContentItem and a List containing all possible paths of the file associated with ApplicationData object.
The List may be empty due to initialization problems with the passed parameter or when the file resides in the DB, not in a vault.

Supported API: true

Extendable: false
Throws:
WTException
Since:
Windchill R6 - build ?

spawnUnreferencedFvItemsPurging

private void spawnUnreferencedFvItemsPurging()
Spawns process for running Unreferenced FvItems Purging.
It can be through threading or direct call (see commented options in the code).

Since:
Windchill R6.2 - build

activateUnreferencedFvItemsPurging

private static ScheduleItem activateUnreferencedFvItemsPurging()
Adds the Unreferenced Fvitems purging process to the queue.

Returns:
the added Schedule Item
Since:
Windchill R6.2 - build

cancelUnreferencedFvItemsPurging

private boolean cancelUnreferencedFvItemsPurging()
Cancels Unreferenced FvItems Purging process.

Returns:
true   if found and cancelled the item
false   otherwise
Since:
Windchill R6.2 - build

purgeUnreferencedFvItems

public static void purgeUnreferencedFvItems()
                                     throws WTException
Throws:
WTException

initSiteCacheVault

private void initSiteCacheVault(Site localSite)
                         throws WTException
Throws:
WTException

updateUserCacheSitePreference

private void updateUserCacheSitePreference(Site theSite,
                                           String evtType)
                                    throws WTException
Update User's preferred content cache site when site is changed (PREFER_MODIFY) or deleted (PRE_DELETE)

Throws:
WTException

resetPreferredSiteToMaster

private void resetPreferredSiteToMaster(String replicaSiteName)
                                 throws WTException
Throws:
WTException

updatePreferredSiteName

private void updatePreferredSiteName(String oldName,
                                     String newName)
                              throws WTException
Throws:
WTException

checkForceContentToVaultConditions

private void checkForceContentToVaultConditions()
                                         throws WTException
Throws:
WTException

isSpecialContent

static boolean isSpecialContent(Object obj)

isSpecialContentClass

static boolean isSpecialContentClass(Class theClass)

getAllRevaultableItems

private void getAllRevaultableItems(Vault vault,
                                    Class holderClass,
                                    Vector queryInfo,
                                    Vector resultItems,
                                    String StreamedClass,
                                    int pageSize,
                                    int numElemToReturn)
                             throws WTException,
                                    WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

findAllContHolderClasses

private Vector findAllContHolderClasses(Vault vault)
                                 throws WTException
Throws:
WTException

accumulateAllConcreteHolders

private void accumulateAllConcreteHolders(String className,
                                          Vector res)
                                   throws WTException
Throws:
WTException

isHolderClassASubClassOf

private boolean isHolderClassASubClassOf(String holderClassName,
                                         Vector allHolderClassNames)
                                  throws WTException
Throws:
WTException

getAllContentHolderClassesInfo

private Vector getAllContentHolderClassesInfo()
                                       throws Exception
Throws:
Exception

revaultStep

private int revaultStep(StandardFvService.RevaultFinderAction finder,
                        long currCounterId,
                        String methodName,
                        int numPrevQueued,
                        RevaultingSession curRevSession)
                 throws WTException,
                        WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

getAppData

private ApplicationData getAppData(ContentHolder holder,
                                   Streamed item)
                            throws WTException
Throws:
WTException

getFvMountFromCache

private static FvMount getFvMountFromCache(FileFolder folder,
                                           FvHost host)
                                    throws WTException
Throws:
WTException

removeFvMountFromCache

private static void removeFvMountFromCache(FvMount mount)
                                    throws WTException
Throws:
WTException

removeFvMountFromCache

private static void removeFvMountFromCache(ObjectIdentifier key)
                                    throws WTException
Throws:
WTException

getFvMountsFromCache

private static Vector getFvMountsFromCache(FileFolder folder)
                                    throws WTException
Throws:
WTException

getFileFolderFromCache

public static FileFolder getFileFolderFromCache(ObjectIdentifier folderKey)
                                         throws WTException
Throws:
WTException

removeFileFolderFromCache

private static void removeFileFolderFromCache(FileFolder folder)
                                       throws WTException
Throws:
WTException

removeFileFolderFromCache

private static void removeFileFolderFromCache(ObjectIdentifier key)
                                       throws WTException
Throws:
WTException