com.sas.hls.resource.repository
Class SynchronizationInfo

java.lang.Object
  extended by com.sas.hls.resource.repository.SynchronizationInfo
All Implemented Interfaces:
Serializable

public class SynchronizationInfo
extends Object
implements Serializable

Provides information about the synchronization state between the file that resides in the workspace and the file that resides in the repository. Files can live independently in the workspace and repository and be updated in either place at any time. Because of this, this data structure provides information which explains the state of the file. Does it exist only in the workspace or the repository? Does it exist in both places? Was the file synchronized with the repository file at some point? If so, which version of the repository file? Is the file still in sync with the repository file or has the repository file changed? Or has the workspace file changed?

All of these questions can be answered with these details. It provides information about the state of the file in the workspace (if it exists). It provides information about the state of the file in the repository (if it exists). It provides information about the synchronization state between the workspace and the repository to tell the user if the file has been retrieved from the repository. It also provides detailed information about the state of the files in case they are out-of-sync, details are provided to determine if the file in the workspace has changed or the file in the repository has changed, or both.

With this information, end-users can determine if they are out-of-sync with the repository file and decide if they should pull changes from the repository into the workspace or push changes from the workspace into the repository; or decide to do nothing at all and continue working with the file contents they have.

Since:
1.7
See Also:
RepositoryResourceService.getSynchronizationInfo(String), RepositoryResourceService.getSynchronizationInfos(String, boolean), Serialized Form

Nested Class Summary
static class SynchronizationInfo.CheckoutStatus
          Enumeration describing the checkin status of the file.
static class SynchronizationInfo.FileStatus
          Enumeration which describes where the file exists.
static class SynchronizationInfo.SynchronizationStatus
          Enumeration which describes whether the file has been synchronized between the workspace and repository or not.
 
Constructor Summary
SynchronizationInfo(String path, RepositoryFileInfo repositoryFileInfo, SynchronizationFileInfo synchronizationFileInfo, WorkspaceFileInfo workspaceFileInfo, SynchronizationInfo.FileStatus fileStatus, SynchronizationInfo.SynchronizationStatus synchronizationStatus, SynchronizationInfo.CheckoutStatus checkoutStatus)
          Initializing constructor which sets the values of all variables.
 
Method Summary
 boolean equals(Object obj)
          Indicate whether some other object is "equal to" this one.
 SynchronizationInfo.CheckoutStatus getCheckoutStatus()
          Returns the checkout status for this file.
 SynchronizationInfo.FileStatus getFileStatus()
          Returns where the file exists.
 String getPath()
          Returns the file path associated with this synchronization information.
 RepositoryFileInfo getRepositoryFileInfo()
          Return the repository file information if the file exists in the repository, if it does not exist then this returns null.
 SynchronizationFileInfo getSynchronizationFileInfo()
          Returns the synchronization file information if the file was synchronized between the workspace and repository, if it was not synchronized then this returns null.
 SynchronizationInfo.SynchronizationStatus getSynchronizationStatus()
          Returns the synchronization status between the repository and workspace files.
 WorkspaceFileInfo getWorkspaceFileInfo()
          Returns the workspace file information if the file exists in the workspace, if it does not exist then this returns null.
 int hashCode()
          Return a hash code value for the object.
 String toString()
          Return a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SynchronizationInfo

public SynchronizationInfo(String path,
                           RepositoryFileInfo repositoryFileInfo,
                           SynchronizationFileInfo synchronizationFileInfo,
                           WorkspaceFileInfo workspaceFileInfo,
                           SynchronizationInfo.FileStatus fileStatus,
                           SynchronizationInfo.SynchronizationStatus synchronizationStatus,
                           SynchronizationInfo.CheckoutStatus checkoutStatus)
Initializing constructor which sets the values of all variables.

It is not intended or recommended that the consumer of the API construct these objects. They should only be retrieved from service calls such as RepositoryResourceService.getSynchronizationInfo(String).

Parameters:
path - The full path of the file.
repositoryFileInfo - The repository file information if the file exists in the repository.
synchronizationFileInfo - The synchronization details for this file.
workspaceFileInfo - The workspace file information if the file exists in the workspace.
fileStatus - Where the file exists.
synchronizationStatus - The synchronization status for the file.
checkoutStatus - The checkout status for the file.
Method Detail

getPath

public String getPath()
Returns the file path associated with this synchronization information.

Returns:
The file path associated with this synchronization information.

getRepositoryFileInfo

public RepositoryFileInfo getRepositoryFileInfo()
Return the repository file information if the file exists in the repository, if it does not exist then this returns null.

Returns:
The repository file information if the file exists in the repository, if it does not exist then this returns null.

getSynchronizationFileInfo

public SynchronizationFileInfo getSynchronizationFileInfo()
Returns the synchronization file information if the file was synchronized between the workspace and repository, if it was not synchronized then this returns null.

Returns:
The synchronization file information if the file was synchronized between the workspace and repository, if it was not synchronized then this returns null.

getWorkspaceFileInfo

public WorkspaceFileInfo getWorkspaceFileInfo()
Returns the workspace file information if the file exists in the workspace, if it does not exist then this returns null.

Returns:
The workspace file information if the file exists in the workspace, if it does not exist then this returns null.

getFileStatus

public SynchronizationInfo.FileStatus getFileStatus()
Returns where the file exists.

Returns:
Where the file exists.

getSynchronizationStatus

public SynchronizationInfo.SynchronizationStatus getSynchronizationStatus()
Returns the synchronization status between the repository and workspace files.

Returns:
The synchronization status between the repository and workspace files.

getCheckoutStatus

public SynchronizationInfo.CheckoutStatus getCheckoutStatus()
Returns the checkout status for this file.

Returns:
The checkout status for this file.

hashCode

public int hashCode()
Return a hash code value for the object.

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Indicate whether some other object is "equal to" this one.

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()
Return a string representation of the object.

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright (c) 2016, SAS Institute Inc., Cary, NC, USA