001: /*
002: * The contents of this file are subject to the
003: * Mozilla Public License Version 1.1 (the "License");
004: * you may not use this file except in compliance with the License.
005: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006: *
007: * Software distributed under the License is distributed on an "AS IS"
008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
009: * See the License for the specific language governing rights and
010: * limitations under the License.
011: *
012: * The Initial Developer of the Original Code is Simulacra Media Ltd.
013: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014: *
015: * All Rights Reserved.
016: *
017: * Contributor(s):
018: */
019: package org.openharmonise.vfs;
020:
021: import java.net.URI;
022:
023: import org.openharmonise.vfs.authentication.*;
024: import org.openharmonise.vfs.status.*;
025:
026: /**
027: * This is the abstract class from which all Virtual File Systems which
028: * implement versioning features should extend.
029: *
030: * @author Matthew Large
031: * @version $Revision: 1.1 $
032: *
033: */
034: public abstract class AbstractVersioningVFS extends
035: AbstractVirtualFileSystem {
036:
037: /**
038: * @param uri URI to locate the file system to be connected to
039: */
040: public AbstractVersioningVFS(URI uri) {
041: super (uri);
042: }
043:
044: /**
045: * @param uri URI to locate the file system to be connected to
046: * @param authInfo Authentication information for the file system to be connected to
047: */
048: public AbstractVersioningVFS(URI uri, AuthInfo authInfo) {
049: super (uri, authInfo);
050: }
051:
052: /**
053: * @param uri URI to locate the file system to be connected to
054: * @param authStore Authentication store to use to lookup authentication information for the file system to be connected to
055: */
056: public AbstractVersioningVFS(URI uri,
057: AbstractAuthenticationStore authStore) {
058: super (uri, authStore);
059: }
060:
061: /**
062: * Checks out a new version of the virtual file
063: *
064: * @param sFullPath Full path to the file to be checked out
065: * @return true if the method was successful
066: */
067: public abstract StatusData checkoutVirtualFile(String sFullPath);
068:
069: /**
070: * Unchecks out the virtual file
071: *
072: * @param sFullPath Full path to the file to be unchecked out
073: * @return true if the method was successful
074: */
075: public abstract StatusData uncheckoutVirtualFile(String sFullPath);
076:
077: /**
078: * Checks in the virtual file making this the current version
079: *
080: * @param sFullPath Full path to the file to be checked in
081: * @return true if the method was successful
082: */
083: public abstract StatusData checkinVirtualFile(String sFullPath);
084:
085: /**
086: * Tags a virtual file
087: *
088: * @param sFullPath Full path to the file to be tagged
089: * @param sTag Tag to put in file
090: * @return true if the method was successful
091: */
092: public abstract StatusData tagVirtualFile(String sFullPath,
093: String sTag);
094:
095: /**
096: * Reactives a version of a virtual file to be the current checked out virtual file.
097: * This will fail if there is already a checked out version.
098: *
099: * @param sFullPath Full path to the version to be reactived
100: * @return true if the method was successful
101: */
102: public abstract StatusData reactivateVersion(String sFullPath);
103:
104: /**
105: * Populates the list of historical versions for a virtual file. These
106: * are typically not populated when a virtual file is first fetched.
107: *
108: * @param vfFile Virtual file to have its history populated
109: */
110: protected abstract void fullyPopulateFileHistory(
111: VersionedVirtualFile vfFile);
112:
113: /**
114: * Provides access to the {@link VersionedVirtualFile#setHistoryPopulated(boolean)} method.
115: *
116: * @param vfFile Virtual file to be used
117: * @param bHistoryPopulated true to set the virtual file's history as populated
118: */
119: protected void setFileHistoryPopulated(VersionedVirtualFile vfFile,
120: boolean bHistoryPopulated) {
121: vfFile.setHistoryPopulated(bHistoryPopulated);
122: }
123:
124: /**
125: * Provides access to the {@link VersionedVirtualFile#addHistoricalVersion(String)} method.
126: *
127: * @param vfFile Virtual file to be used
128: * @param sPath Path to add to history
129: */
130: protected void addHistoricalVersionPath(
131: VersionedVirtualFile vfFile, String sPath) {
132: vfFile.addHistoricalVersion(sPath);
133: }
134:
135: /**
136: * Provides access to the {@link VersionedVirtualFile#setPendingVersionPath(String)} method.
137: *
138: * @param vfFile Virtual file to be used
139: * @param sPath Path to be set as the pending version path
140: */
141: protected void setFilePendingVersionPath(
142: VersionedVirtualFile vfFile, String sPath) {
143: vfFile.setPendingVersionPath(sPath);
144: }
145:
146: /**
147: * Provides access to the {@link VersionedVirtualFile#setLiveVersionPath(String)} method.
148: *
149: * @param vfFile Virtual file to be used
150: * @param sPath Path to be set as the live version path
151: */
152: protected void setFileLiveVersionPath(VersionedVirtualFile vfFile,
153: String sPath) {
154: vfFile.setLiveVersionPath(sPath);
155: }
156: }
|