SourceJammer 1.3.0 November 20, 2002
Copyright (c) 2001, 2002 Robert MacGrogan

org.sourcejammer.client.simpletools
Class SimpleInterface

java.lang.Object
  |
  +--org.sourcejammer.client.simpletools.SimpleInterface

public class SimpleInterface
extends java.lang.Object

This singleton class provides a simplified interface into the SourceJammer client functionality for the purpose of building plugins to integrate SourceJammer into 3rd party development tools such as JBuilder and Eclipse.

To use this class, get the singleton instance, call the setConfDirectory() method to set the configuration, call the connect() method to connect to an archive, and then call the provided methods as needed.


Method Summary
 void addFile(long projectID, java.lang.String fileName, java.io.File localPath, int historyType, int fileType, java.lang.String description)
          Add specified file to specified project in SourceJammer archive.
 void addFile(long projectID, java.lang.String fileName, java.io.File localPath, int historyType, int fileType, java.lang.String description, java.lang.String afterAddAction)
          Add specified file to specified project in SourceJammer archive.
 void addFile(long projectID, java.lang.String fileName, java.io.File localPath, java.lang.String description)
          Add specified file to specified project in SourceJammer archive.
 void addFile(long projectID, java.lang.String fileName, java.io.File localPath, java.lang.String description, java.lang.String afterAddAction)
          Add specified file to specified project in SourceJammer archive.
 void addProject(long parentProjectID, java.lang.String projectName)
          Add a new project to the archive.
 void checkInFile(long fileID, java.lang.String fileName, java.io.File targetDir, java.lang.String comment)
          Check in the file.
 void checkInFile(long fileID, java.lang.String fileName, java.io.File targetDir, java.lang.String comment, java.lang.String afterCheckInAction)
          Check in the file.
 void checkOutFile(long fileID, java.lang.String fileName, java.io.File targetDir)
          Check out the file.
 Project connect(java.lang.String archiveName, java.lang.String url, java.lang.String userName, java.lang.String password)
          Connects the SimpleInterface to the specified archive.
 void disconnect()
          Disconnect.
 File getFileObj(long fileID)
          Get File object for the specified file.
 long getFileUniqueID(java.lang.String sjPath)
          Returns unique id of File based on full sourcejammer path.
static SimpleInterface getInstance()
          Returns the singleton instance.
 void getLabel(long labelID, java.io.File targetDir)
          Gets the specified label to the content directory.
 void getLabel(long labelID, int verNumber, java.io.File targetDir, boolean buildSubDirs, int eolType)
          Gets the specified label to the content directory.
 void getLabel(long labelID, int verNumber, java.io.File targetDir, boolean buildSubDirs, int eolType, boolean setReadOnly)
           
 void getProject(java.io.File targetDir, Project proj, boolean bRecursive, boolean bBuildSubDirs, int iEOLType, boolean makeReadOnly, boolean verifyCheckIn)
          Retrieves all files in the specified Project to the specified targetDirectory.
 Project getProjectObj(long projectID)
          Returns the Project object for the specified project.
 long getProjectUniqueID(java.lang.String sjPath)
          Returns unique id of Project based on full sourcejammer path.
 void setConfDirectory(java.io.File confDir)
          Sets the configuration directory.
 void setOut(java.io.PrintStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static SimpleInterface getInstance()
Returns the singleton instance.

setConfDirectory

public void setConfDirectory(java.io.File confDir)
                      throws java.io.IOException
Sets the configuration directory. Should be the directory that contains the conf.xml and other sourcejammer configuration files. This method must be called before any of the other methods of this class can be used.

connect

public Project connect(java.lang.String archiveName,
                       java.lang.String url,
                       java.lang.String userName,
                       java.lang.String password)
                throws java.net.MalformedURLException,
                       java.io.IOException,
                       SourceJammerConnectionException,
                       GUICommandException,
                       NoSessionException
Connects the SimpleInterface to the specified archive. Returns the root project for the archive.
Parameters:
archiveName - -- Name of archive to connect to.
url - -- URL of SourceJammer server.
userName - -- name of user to use when connecting.
password - -- user's password.

getProjectObj

public Project getProjectObj(long projectID)
                      throws SourceJammerConnectionException,
                             GUICommandException
Returns the Project object for the specified project.

getFileObj

public File getFileObj(long fileID)
                throws SourceJammerConnectionException,
                       GUICommandException
Get File object for the specified file.

checkInFile

public void checkInFile(long fileID,
                        java.lang.String fileName,
                        java.io.File targetDir,
                        java.lang.String comment)
                 throws java.io.IOException,
                        SourceJammerConnectionException,
                        GUICommandException
Check in the file. Uses default after checkin action from SourceJammerClient (clientconf.xml).

checkInFile

public void checkInFile(long fileID,
                        java.lang.String fileName,
                        java.io.File targetDir,
                        java.lang.String comment,
                        java.lang.String afterCheckInAction)
                 throws java.io.IOException,
                        SourceJammerConnectionException,
                        GUICommandException
Check in the file. afterCheckInAction specifies action to perform on local copy of file after it is checked in. Possible options are the same as after add action options on addFile().

checkOutFile

public void checkOutFile(long fileID,
                         java.lang.String fileName,
                         java.io.File targetDir)
                  throws SourceJammerConnectionException,
                         GUICommandException,
                         java.io.IOException
Check out the file.

addFile

public void addFile(long projectID,
                    java.lang.String fileName,
                    java.io.File localPath,
                    int historyType,
                    int fileType,
                    java.lang.String description)
             throws SourceJammerConnectionException,
                    GUICommandException,
                    java.io.IOException
Add specified file to specified project in SourceJammer archive.
Parameters:
projectID - -- id of parent project for file being added.
fileName - -- full name of file.
localPath - -- java.io.File object pointing file to be added.
historyType - -- History type. Must be a value in AppConfig.FileHistoryStorageTypes.
fileType - -- File type. Must be a value in AppConfig.FileTypes, but not LABEL.
description - -- a description of the file.

addFile

public void addFile(long projectID,
                    java.lang.String fileName,
                    java.io.File localPath,
                    int historyType,
                    int fileType,
                    java.lang.String description,
                    java.lang.String afterAddAction)
             throws SourceJammerConnectionException,
                    GUICommandException,
                    java.io.IOException
Add specified file to specified project in SourceJammer archive.
Parameters:
projectID - -- id of parent project for file being added.
fileName - -- full name of file.
localPath - -- java.io.File object pointing file to be added.
historyType - -- History type. Must be a value in AppConfig.FileHistoryStorageTypes.
fileType - -- File type. Must be a value in AppConfig.FileTypes, but not LABEL.
description - -- a description of the file.
afterAddAction - -- Action to take on local file after it has been added. Choices are in SourceJammerClient--lfa_DELETE, lfa_NO_SPECIAL_ACTION, and lfa_SET_READ_ONLY.

addFile

public void addFile(long projectID,
                    java.lang.String fileName,
                    java.io.File localPath,
                    java.lang.String description)
             throws SourceJammerConnectionException,
                    GUICommandException,
                    java.io.IOException
Add specified file to specified project in SourceJammer archive. File type and history type will be set automatically using HistoryTypeMapper.
Parameters:
projectID - -- id of parent project for file being added.
fileName - -- full name of file.
localPath - -- java.io.File object pointing file to be added.
description - -- a description of the file.

addFile

public void addFile(long projectID,
                    java.lang.String fileName,
                    java.io.File localPath,
                    java.lang.String description,
                    java.lang.String afterAddAction)
             throws SourceJammerConnectionException,
                    GUICommandException,
                    java.io.IOException
Add specified file to specified project in SourceJammer archive. File type and history type will be set automatically using HistoryTypeMapper.
Parameters:
projectID - -- id of parent project for file being added.
fileName - -- full name of file.
localPath - -- java.io.File object pointing file to be added.
description - -- a description of the file.
afterAddAction - -- Action to take on local file after it has been added. Choices are in SourceJammerClient--lfa_DELETE, lfa_NO_SPECIAL_ACTION, and lfa_SET_READ_ONLY.

addProject

public void addProject(long parentProjectID,
                       java.lang.String projectName)
                throws SourceJammerConnectionException,
                       GUICommandException
Add a new project to the archive.

getLabel

public void getLabel(long labelID,
                     int verNumber,
                     java.io.File targetDir,
                     boolean buildSubDirs,
                     int eolType)
              throws GUICommandException,
                     SourceJammerConnectionException,
                     java.io.IOException
Gets the specified label to the content directory.
Parameters:
labelID - -- id of the label.
verNumber - -- version number of the label that you want to get. Use -1 to use the latest version of the label.
targetDir - -- directory where the files will be downloaded to.
buildSubDires - -- if true, builds all needed subdirectories. If false, does not download files that need to go into sub directories that do not already exist.
eolType - -- the eol type to apply to all text files. This value must be in AppConfig.EndOfLineType.

getLabel

public void getLabel(long labelID,
                     int verNumber,
                     java.io.File targetDir,
                     boolean buildSubDirs,
                     int eolType,
                     boolean setReadOnly)
              throws GUICommandException,
                     SourceJammerConnectionException,
                     java.io.IOException

getLabel

public void getLabel(long labelID,
                     java.io.File targetDir)
              throws GUICommandException,
                     SourceJammerConnectionException,
                     java.io.IOException
Gets the specified label to the content directory. All required subdirectories will be created if they do not already exist. All text files will be returned with the default EOL type specified in the clientconf.xml file. The latest version of the label will be used.

getFileUniqueID

public long getFileUniqueID(java.lang.String sjPath)
                     throws GUICommandException,
                            SourceJammerConnectionException
Returns unique id of File based on full sourcejammer path.

getProjectUniqueID

public long getProjectUniqueID(java.lang.String sjPath)
                        throws GUICommandException,
                               SourceJammerConnectionException
Returns unique id of Project based on full sourcejammer path.

disconnect

public void disconnect()
                throws GUICommandException,
                       SourceJammerConnectionException
Disconnect.

setOut

public void setOut(java.io.PrintStream out)

getProject

public void getProject(java.io.File targetDir,
                       Project proj,
                       boolean bRecursive,
                       boolean bBuildSubDirs,
                       int iEOLType,
                       boolean makeReadOnly,
                       boolean verifyCheckIn)
                throws GUICommandException,
                       SourceJammerConnectionException,
                       java.io.IOException
Retrieves all files in the specified Project to the specified targetDirectory.

SourceJammer 1.3.0 November 20, 2002
Copyright (c) 2001, 2002 Robert MacGrogan