|
SourceJammer 1.1.0 March 1, 2002 Copyright (c) 2001, 2002 Robert MacGrogan |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sourcejammer.project.controller.ProjectController
ProjectController is responsible for returning objects from the model implementation, and adding and maintaining objects in the model implementation. This class also maintains a cache of the entire project hierarchy of a particular archive. This object does not handle user-level security except to allow checking out and checking in of files. User names and passwords are verified and controlled by the object that calls this object. A ProjectController is created and (hopefully) cached for a single archive.
Field Summary | |
static long |
ROOT_PROJECT_ID
|
Constructor Summary | |
ProjectController()
|
Method Summary | |
long |
addFile(long projectID,
java.lang.String name,
byte[] file,
int fileType,
java.lang.String comment)
Adds a new file to this archive, at the specified location. |
long |
addNewVersion(long fileID,
byte[] newVersion,
Delta oReplaceCurrLatestVer,
java.lang.String comment,
java.lang.String userName)
Adds a new version to an existing file. |
long |
addProject(long parentID,
java.lang.String name)
Adds a new project at the specified location (the NodeName object) to this archive. |
protected Label |
buildLabel(Label label,
long parentProjectID,
java.lang.String baseSJPath)
This method recursively calls itself until it has put all of the latest versions of all the file nodes in parent (and in all ProjectNode children of parent) into label. |
void |
checkInFile(long fileID)
Set status of specified file to checked in. |
void |
checkOutFile(long fileID,
java.lang.String userName,
java.lang.String checkOutLocation)
Set status of specified file to checked out. |
protected NodeInfo |
controllerNodeToNodeInfo(ControllerNode nd)
Builds new NodeInfo object from ControllerNode. |
ArchiveInfo |
getArchiveInfo()
Gives subclasses access to archive info object. |
File |
getFile(long fileID)
Get File object (info about file). |
java.lang.String |
getFileDescription(long fileID)
Gets and returns the description of a file. |
byte[] |
getFileLatestVersion(long fileID,
int requestedEOL)
Get latest version of file source as byte array. |
TextLineReader |
getFileLatestVersionTLR(long fileID)
Get latest version of text file source as TextLineReader. |
FileNode |
getFileNode(long fileID)
Allows "master control" to look at file info to verify check out, check in, file type, etc. |
FileNode |
getFileNode(long fileID,
boolean readOnly)
Allows "master control" to look at file info to verify check out, check in, file type, etc. |
Delta |
getFileVersionDelta(long versionID)
Get specified delta object for file. |
Label |
getLabelContentList(java.lang.String labelName)
Returns the Label object (which contains the sourcejammer path and version number for each object in the labeled version) with the specified name. |
NodeList |
getLabelList()
Returns NodeList of all LabelInfo objects in this archive. |
Project |
getProject(long projectID)
Get Project object (info about project). |
java.util.Vector |
getRemovedNodes(long projectID)
Returns a Vector of NodeInfo objects, one for each node that has been removed (but not permanently deleted) from the parent project. |
Project |
getRootProject()
Returns the view Project for the root node of the archive for this ProjectController. |
long |
getUniqueIDFromPath(long parentID,
java.lang.String path)
Returns unique id based on a path. |
java.lang.String |
getVersionComment(long versionID)
Get the comment for the specified version. |
long |
getVersionFileSizeInBytes(long fileID,
int versionNumber)
Gets the size of the version file in bytes. |
void |
makeLabeledVersion(java.lang.String name,
java.lang.String description,
long parentProjectID)
Create and save a new labeled version with the passed-in name and description and containing all of the latest versions that are children of parent. |
void |
permanentlyDeleteRemovedNode(long projectID,
int index)
Permanently delete specified removed node. |
protected Project |
projectNodeToProject(ProjectNode ndProject)
|
void |
releaseFileNode(FileNode nd)
Release a file node. |
void |
removeFile(long parentID,
long fileID)
Remove specified file from specified project. |
void |
removeProject(long parentID,
long projectID)
Remove specified project from the project hierarchy. |
void |
renameFile(long parentID,
long fileID,
java.lang.String newName)
|
void |
renameProject(long parentID,
long projectID,
java.lang.String newName)
|
void |
restoreRemovedNode(long parentID,
int index)
Restores a project or file node that was previously removed from the archive. |
void |
restoreRemovedNode(long parentID,
java.lang.String newName,
int index)
Restores a project or file node that was previously removed from the archive. |
void |
rollbackToVersion(long fileID,
long versionID,
byte[] newLatestVersion)
Rollback specified file to specified version number. |
void |
setArchiveInfo(ArchiveInfo info)
Sets the ArchiveInfo object for this ProjectController. |
void |
setFileDescription(long fileID,
java.lang.String description)
Changes description of a file. |
void |
setNodeLibrary(NodeLibrary lib)
Set the NodeLibrary object for this archive. |
void |
setVersionComment(long fileID,
int version,
java.lang.String comment)
Set the comment of the specified version. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final long ROOT_PROJECT_ID
Constructor Detail |
public ProjectController()
Method Detail |
public void setArchiveInfo(ArchiveInfo info) throws FileAccessException
public void setNodeLibrary(NodeLibrary lib)
public ArchiveInfo getArchiveInfo()
public Project getRootProject() throws FileAccessException, SecurityException
public long addProject(long parentID, java.lang.String name) throws FileAccessException, ProjectDoesNotExistException, NodeExistsException, SecurityException
public long addFile(long projectID, java.lang.String name, byte[] file, int fileType, java.lang.String comment) throws FileAccessException, ProjectDoesNotExistException, FileAlreadyExistsException, SecurityException, TextFileException
public java.lang.String getFileDescription(long fileID) throws FileAccessException, FileDoesNotExistException, SecurityException
public void setFileDescription(long fileID, java.lang.String description) throws FileAccessException, FileDoesNotExistException, SecurityException
public long addNewVersion(long fileID, byte[] newVersion, Delta oReplaceCurrLatestVer, java.lang.String comment, java.lang.String userName) throws FileAccessException, FileDoesNotExistException, TextFileException, SecurityException
public Project getProject(long projectID) throws FileAccessException, ProjectDoesNotExistException, SecurityException
public File getFile(long fileID) throws FileAccessException, FileDoesNotExistException, SecurityException
public byte[] getFileLatestVersion(long fileID, int requestedEOL) throws FileAccessException, FileDoesNotExistException, TextFileException, SecurityException
public TextLineReader getFileLatestVersionTLR(long fileID) throws FileAccessException, FileDoesNotExistException, TextFileException, SecurityException
public Delta getFileVersionDelta(long versionID) throws FileAccessException, NoSuchVersionException, WrongFileTypeException
public void removeProject(long parentID, long projectID) throws FileAccessException, ProjectDoesNotExistException, SecurityException
public void removeFile(long parentID, long fileID) throws FileAccessException, ProjectDoesNotExistException, FileDoesNotExistException, SecurityException
public void rollbackToVersion(long fileID, long versionID, byte[] newLatestVersion) throws FileAccessException, FileDoesNotExistException, NoSuchVersionException, SecurityException
public void setVersionComment(long fileID, int version, java.lang.String comment) throws FileAccessException, FileDoesNotExistException, NoSuchVersionException, SecurityException
public long getVersionFileSizeInBytes(long fileID, int versionNumber) throws FileAccessException, FileDoesNotExistException, NoSuchVersionException, SecurityException
public java.lang.String getVersionComment(long versionID) throws FileAccessException, ProjectDoesNotExistException, FileDoesNotExistException, NoSuchVersionException
public void checkOutFile(long fileID, java.lang.String userName, java.lang.String checkOutLocation) throws FileAccessException, FileDoesNotExistException, CheckOutException, SecurityException
public void checkInFile(long fileID) throws FileAccessException, FileDoesNotExistException, CheckInException, SecurityException
public long getUniqueIDFromPath(long parentID, java.lang.String path) throws FileAccessException, ProjectDoesNotExistException, NodeDoesNotExistException, SecurityException
public FileNode getFileNode(long fileID) throws FileDoesNotExistException, FileAccessException, SecurityException
public FileNode getFileNode(long fileID, boolean readOnly) throws FileDoesNotExistException, FileAccessException, SecurityException
public void releaseFileNode(FileNode nd) throws FileAccessException
public void restoreRemovedNode(long parentID, int index) throws FileAccessException, ProjectDoesNotExistException, FileDoesNotExistException, NodeDoesNotExistException, NodeExistsException, SecurityException
parent
- -- NodeName of the project from which
the node was removed.index
- -- Index value of the removed node in the
removed nodes list (see getRemovedNodes()).public void restoreRemovedNode(long parentID, java.lang.String newName, int index) throws FileAccessException, ProjectDoesNotExistException, FileDoesNotExistException, NodeDoesNotExistException, NodeExistsException, SecurityException
parentID
- -- ID of the project from which
the node was removed.newName
- -- a new name for the removed node.index
- -- Index value of the removed node in the
removed nodes list (see getRemovedNodes()).public void renameFile(long parentID, long fileID, java.lang.String newName) throws FileAccessException, ProjectDoesNotExistException, FileDoesNotExistException, NodeExistsException, SecurityException
public void renameProject(long parentID, long projectID, java.lang.String newName) throws FileAccessException, ProjectDoesNotExistException, NodeExistsException, SecurityException
public void permanentlyDeleteRemovedNode(long projectID, int index) throws FileAccessException, ProjectDoesNotExistException, NodeDoesNotExistException, SecurityException
public java.util.Vector getRemovedNodes(long projectID) throws FileAccessException, ProjectDoesNotExistException, SecurityException
parent
- -- project NodeName to return a list of removed nodes for.public void makeLabeledVersion(java.lang.String name, java.lang.String description, long parentProjectID) throws NodeExistsException, FileAccessException, ProjectDoesNotExistException, NoSuchVersionException, FileDoesNotExistException, SecurityException
public NodeList getLabelList()
public Label getLabelContentList(java.lang.String labelName) throws NodeDoesNotExistException, FileAccessException
protected Project projectNodeToProject(ProjectNode ndProject) throws SecurityException, ProjectDoesNotExistException, FileAccessException, FileDoesNotExistException, NodeExistsException
protected Label buildLabel(Label label, long parentProjectID, java.lang.String baseSJPath) throws NoSuchVersionException, SecurityException, FileAccessException, ProjectDoesNotExistException, FileDoesNotExistException
protected NodeInfo controllerNodeToNodeInfo(ControllerNode nd) throws NoSuchVersionException
|
SourceJammer 1.1.0 March 1, 2002 Copyright (c) 2001, 2002 Robert MacGrogan |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |