|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.core.clients.versioncontrol.Workstation
public class Workstation
Method Summary | |
---|---|
void |
addWorkstationEventListener(VersionControlClient client)
Adds a VersionControlClient whose
VersionControlEventEngine will receive events from this
Workstation class. |
void |
checkForLocalItemExclusionUpdates(VersionControlClient client,
boolean force)
Checks to see if the default local item exclusions have changed on the server. |
void |
ensureUpdateWorkspaceInfoCache(VersionControlClient client,
java.lang.String ownerName)
If updateWorkspaceInfoCache() has not yet been called for the specified server and owner, this method will call it. |
void |
ensureUpdateWorkspaceInfoCache(VersionControlClient client,
java.lang.String ownerName,
long maxAgeMillis)
If updateWorkspaceInfoCache() has not yet been called for the specified server and owner within the specified time, this method will call it. |
WorkspaceInfo[] |
getAllLocalWorkspaceInfo()
Get a list of all cached local workspace info objects. |
com.microsoft.tfs.core.clients.versioncontrol.workspacecache.internal.InternalCache |
getCache()
Internal method to get the InternalCache . |
static java.io.File |
getConfigurationDirectory(PersistenceStoreProvider provider)
Gets the directory where Workstation stores its non-cache
configuration files. |
static Workstation |
getCurrent(PersistenceStoreProvider persistenceProvider)
Gets the "current" (for this computer) Workstation that uses the
specified PersistenceStoreProvider to read and write its cache
and config files. |
java.lang.String[] |
getLocalItemExclusions(VersionControlClient client)
Returns the set of local item exclusions for this user on this machine. |
WorkspaceInfo |
getLocalWorkspaceInfo(com.microsoft.tfs.util.GUID repositoryGuid,
java.lang.String workspaceName,
java.lang.String workspaceOwner)
Get the cached local workspace info for the specified workspace. |
WorkspaceInfo |
getLocalWorkspaceInfo(java.lang.String path)
Get the cached local workspace info for the workspace that contains the specified path. |
WorkspaceInfo |
getLocalWorkspaceInfo(VersionControlClient client,
java.lang.String workspaceName,
java.lang.String workspaceOwner)
Get the cached local workspace info for the specified workspace. |
WorkspaceInfo[] |
getLocalWorkspaceInfoRecursively(java.lang.String path)
Gets the workspace at or workspaces below the path. |
java.lang.String |
getName()
|
NotificationManager |
getNotificationManager()
|
static java.io.File |
getOfflineMetadataFileRoot(PersistenceStoreProvider provider)
Returns the directory location where workspace local version metadata files are stored. |
WorkspaceInfo |
insertWorkspaceIntoCache(Workspace localWorkspace)
This helper method inserts a workspace into the Workstation cache. |
boolean |
isCacheEnabled()
When true, the cache directory exists and will be used. |
boolean |
isConfigurationEnabled()
When true, the configuration directory exists and will be used. |
boolean |
isExplicitlyMapped(java.lang.String path)
Returns true if the specified local path is explicitly mapped in a workspace (i.e., it is a root mapping). |
boolean |
isMapped(java.lang.String path)
Returns true if the specified local path is mapped in a workspace. |
void |
notifyForChangesetReconciled(VersionControlClient client,
int changesetID)
Send a cross-process notification through the current NotificationManager that a changeset was reconciled after a gated
check-in. |
void |
notifyForFolderContentChanged(VersionControlClient client)
Send a cross-process notification through the current NotificationManager that server data changed without a new
changeset being created (from destroy, branch objects, etc.). |
void |
notifyForFolderContentChanged(VersionControlClient client,
int changesetID)
Send a cross-process notification through the current NotificationManager that server data changed with a new changeset
created. |
void |
notifyForWorkspace(Workspace workspace,
Notification notification)
Send a cross-process notification through the current NotificationManager for an event that happened in the specified
workspace. |
WorkspaceInfo[] |
queryLocalWorkspaceInfo(VersionControlClient client,
java.lang.String workspaceName,
java.lang.String workspaceOwner)
Get a list of cached local workspace info. |
void |
reloadCache()
Call Workstation.Current.ReloadCache() to force a reload of the cache file from disk. |
WorkspaceInfo[] |
removeCachedWorkspaceInfo(java.net.URI serverUri,
java.lang.String workspaceName,
java.lang.String workspaceOwner)
Removes from the cache the workspace specified. |
WorkspaceInfo[] |
removeCachedWorkspaceInfo(VersionControlClient client)
Removes from the cache the workspaces for the specified source control repository. |
WorkspaceInfo[] |
removeCachedWorkspaceInfo(VersionControlClient client,
java.lang.String ownerName)
Removes from the cache the workspaces for the specified source control repository. |
void |
removeLocalItemExclusion(VersionControlClient client,
java.lang.String exclusion)
Removes an exclusion from the local item exclusion list. |
void |
removeWorkstationEventListener(VersionControlClient client)
Removes a listener previously added with addWorkstationEventListener(VersionControlClient) . |
void |
saveConfigIfDirty()
Internal method to save the cache if it has been modified. |
void |
setLocalItemExclusions(VersionControlClient client,
java.lang.String[] exclusions)
Overwrites the list of local item exclusions with the list passed in. |
NotificationManager |
setNotificationManager(NotificationManager newManager)
Sets the NotificationManager this workstation uses to send and
receive intra- and inter-process notifications about things like changes
to mappings, new pending changes, merge completion. |
void |
updateServerURIReferences(VersionControlClient client,
java.net.URI uri)
Updates the cache to reference the specified source control repository using the specified URI, if different. |
void |
updateWorkspaceInfoCache(VersionControlClient client,
java.lang.String ownerName)
Loads into the cache the workspaces residing in the specified source control repository and having the specified owner. |
void |
updateWorkspaceInfoCache(VersionControlClient client,
java.lang.String ownerName,
java.util.concurrent.atomic.AtomicReference<Workspace[]> workspaces)
Loads into the cache the workspaces residing in the specified source control repository and having the specified owner. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Workstation getCurrent(PersistenceStoreProvider persistenceProvider)
Workstation
that uses the
specified PersistenceStoreProvider
to read and write its cache
and config files.
persistenceProvider
- the PersistenceStoreProvider
the Workstation
will
use (must not be null
)
Workstation
(never null
)public void addWorkstationEventListener(VersionControlClient client)
VersionControlClient
whose
VersionControlEventEngine
will receive events from this
Workstation
class. This special pattern is used because of the
automatic caching done for Workstation
instances.
client
- the client to add (must not be null
)public void removeWorkstationEventListener(VersionControlClient client)
addWorkstationEventListener(VersionControlClient)
.
client
- the client to remove (must not be null
)public NotificationManager setNotificationManager(NotificationManager newManager)
NotificationManager
this workstation uses to send and
receive intra- and inter-process notifications about things like changes
to mappings, new pending changes, merge completion.
Does not call NotificationManager.close()
on the old manager
being replaced.
newManager
- the notification manager to use or null
to stop
sending and receiving notifications
NotificationManager
or null
if
there wasn't onepublic NotificationManager getNotificationManager()
NotificationManager
this Workstation
is using
or null
if there is no active
NotificationManager
.public void notifyForWorkspace(Workspace workspace, Notification notification)
NotificationManager
for an event that happened in the specified
workspace.
This method may be called on any thread (does not have to be the UI thread).
workspace
- the workspace where the event happened (must not be
null
)notification
- the notification to send (must not be null
)public void notifyForChangesetReconciled(VersionControlClient client, int changesetID)
NotificationManager
that a changeset was reconciled after a gated
check-in.
This method may be called on any thread (does not have to be the UI thread).
client
- the client where the reconcile happened (must not be
null
)changesetID
- of changeset reconciledpublic void notifyForFolderContentChanged(VersionControlClient client)
NotificationManager
that server data changed without a new
changeset being created (from destroy, branch objects, etc.).
This method may be called on any thread (does not have to be the UI thread).
client
- the client where the change happened (must not be
null
)public void notifyForFolderContentChanged(VersionControlClient client, int changesetID)
NotificationManager
that server data changed with a new changeset
created.
This method may be called on any thread (does not have to be the UI thread).
client
- the client where the change happened (must not be
null
)changesetID
- the ID of the committed changesetpublic WorkspaceInfo[] getAllLocalWorkspaceInfo()
public WorkspaceInfo getLocalWorkspaceInfo(VersionControlClient client, java.lang.String workspaceName, java.lang.String workspaceOwner)
sourceControl
- the server associated with the specified workspaceworkspaceName
- the name of the workspaceworkspaceOwner
- the workspace owner
public WorkspaceInfo getLocalWorkspaceInfo(com.microsoft.tfs.util.GUID repositoryGuid, java.lang.String workspaceName, java.lang.String workspaceOwner)
repositoryGuid
- GUID for the associated serverworkspaceName
- the name of the workspace (must not be null
)workspaceOwner
- the workspace owner (must not be null
)
public WorkspaceInfo getLocalWorkspaceInfo(java.lang.String path)
path
- the local path (must not be null
or empty)
public WorkspaceInfo[] getLocalWorkspaceInfoRecursively(java.lang.String path)
path
- the path (must not be null
or empty)
public WorkspaceInfo[] queryLocalWorkspaceInfo(VersionControlClient client, java.lang.String workspaceName, java.lang.String workspaceOwner)
sourceControl
- the source control repository (if null, any repository)workspaceName
- the name of the workspace (if null, all workspaces for this
computer)workspaceOwner
- the workspace owner (if null, any workspace owner)
public boolean isMapped(java.lang.String path)
the
- local path
public boolean isExplicitlyMapped(java.lang.String path)
the
- local path
public void ensureUpdateWorkspaceInfoCache(VersionControlClient client, java.lang.String ownerName)
public void ensureUpdateWorkspaceInfoCache(VersionControlClient client, java.lang.String ownerName, long maxAgeMillis)
client
- the client (must not be null
)ownerName
- the owner of the workspaces (must not be null
or
empty)maxAgeMillis
- the maximum age (not time) of the last request in millisecondspublic void updateServerURIReferences(VersionControlClient client, java.net.URI uri)
client
- the version control client (must not be null
)uri
- the URI for the server to use in the cache (must not be
null
)public void updateWorkspaceInfoCache(VersionControlClient client, java.lang.String ownerName)
client
- the client (must not be null
)ownerName
- the owner of the workspaces (must not be null
or
empty)public void updateWorkspaceInfoCache(VersionControlClient client, java.lang.String ownerName, java.util.concurrent.atomic.AtomicReference<Workspace[]> workspaces)
client
- the client (must not be null
)ownerName
- the owner of the workspaces (must not be null
or
empty)workspaces
- the holder for the workspaces (must not be null
)public WorkspaceInfo insertWorkspaceIntoCache(Workspace localWorkspace)
public WorkspaceInfo[] removeCachedWorkspaceInfo(VersionControlClient client)
client
- the source control repository
WorkspaceInfo
objects that are removed from the cachepublic WorkspaceInfo[] removeCachedWorkspaceInfo(VersionControlClient client, java.lang.String ownerName)
client
- the source control repository (must not be null
)ownerName
- the owner of the workspaces (must not be null
or
empty) the owner of the workspaces
WorkspaceInfo
objects that are removed from the cachepublic WorkspaceInfo[] removeCachedWorkspaceInfo(java.net.URI serverUri, java.lang.String workspaceName, java.lang.String workspaceOwner)
serverUri
- the URI of the server containing the workspaces to remove from the
cache; passing null matches all serversworkspaceName
- the name of the workspace to remove from the cache; passing null
matches all workspacesworkspaceOwner
- the owner of the workspace to remove from the cache; passing null
matches all owners
public void saveConfigIfDirty()
public com.microsoft.tfs.core.clients.versioncontrol.workspacecache.internal.InternalCache getCache()
InternalCache
.
public void reloadCache()
public void removeLocalItemExclusion(VersionControlClient client, java.lang.String exclusion)
The
- exclusion to remove (must not be null
or empty)public java.lang.String[] getLocalItemExclusions(VersionControlClient client)
public void setLocalItemExclusions(VersionControlClient client, java.lang.String[] exclusions)
exclusions
- The new exclusionspublic void checkForLocalItemExclusionUpdates(VersionControlClient client, boolean force)
force
- if true the server is contacted every time, otherwise if enough
time has elapsed since the last checkpublic java.lang.String getName()
Workstation
(aka machine name or
computer name).public boolean isCacheEnabled()
public boolean isConfigurationEnabled()
public static java.io.File getConfigurationDirectory(PersistenceStoreProvider provider)
Workstation
stores its non-cache
configuration files. This may not be the given
PersistenceStoreProvider
's value if certain environment variables
or application config settings are specified.
provider
- the PersistenceStoreProvider
to get the default location
from (must not be null
)
Workstation
will store its
configuration files or null
if the configuration
directory is not availablepublic static java.io.File getOfflineMetadataFileRoot(PersistenceStoreProvider provider)
provider
- the provider to find configuration storage with (must not be
null
)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |