SourceJammer 1.2.0.1 May 20, 2002
Copyright (c) 2001, 2002 Robert MacGrogan

org.sourcejammer.client.gui
Class CommandCentral

java.lang.Object
  |
  +--org.sourcejammer.client.gui.CommandCentral

public class CommandCentral
extends java.lang.Object

Central singleton that handles issuing all commands and performing all file system actions for GUI.


Field Summary
static java.lang.String APP_TITLE
           
static java.io.PrintStream out
           
 
Method Summary
 void addFile(long parentUniqueID, java.lang.String newFileName, java.lang.String localFileNameLocation, int fileType, int historyType, java.lang.String description)
           
 void addUserToArchiveControllers(java.lang.String userName)
           
 void addUserToArchiveUsers(java.lang.String userName)
           
 void changePassword(java.lang.String sPassword)
           
 void changePassword(java.lang.String sPassword, java.lang.String userName)
           
 void checkInFile(long fileID, java.lang.String sFileName, java.io.File flTargetDirectory, java.lang.String comment)
           
 void checkOutFile(long fileID, java.lang.String fileName, java.io.File flTargetDirectory)
           
 void checkOutFile(long fileID, java.lang.String fileName, java.io.File flTargetDirectory, int eolType)
           
 Project connectToArchive()
           
 java.lang.String currentURL()
           
 boolean deleteArchive(java.lang.String archiveName)
          Returns true if the archive deleted is the current archive and the user is now disconnected.
 void deleteRemoved(long lParentID, int iItemNumber)
           
 boolean disconnect()
           
 void displayErrorMessage(java.lang.String s)
           
 void displayErrorMessage(java.lang.String[] s)
           
 void displayErrorMessage(java.lang.String[] s, boolean eventThread)
           
 void displayErrorMessage(java.lang.String s, boolean eventThread)
           
 java.lang.String[] getAllCurrentFileNames()
           
 UserInfo[] getArchiveControllerList()
           
 java.lang.String[] getArchiveNameList()
          Returns list of archives available on server user is currently connected to.
 UserInfo[] getArchiveUserList()
           
protected  SourceVersionChecker getChecker(java.io.File flDirectory)
           
 int getClientDefaultEOLType()
          Gets the default EOL type for the client from AppConfig.
 UserInfo[] getCompleteUserList()
           
 ProjectTreeNode getCurrentTreeNode()
           
 java.lang.String getCurrentUserName()
           
 void getFile(long lFileID, java.lang.String sFileName, java.io.File flTargetDirectory)
           
 void getFile(long lFileID, java.lang.String sFileName, java.io.File flTargetDirectory, int eolType)
           
 File getFileInfo(long lFileID)
          Get file info
 long getFileLatestVersionID(long lFileID)
           
 void getFileVersion(long fileID, java.lang.String sName, java.io.File flTargetDirectory, int iVersion, long versionID)
           
 void getFileVersion(long fileID, java.lang.String sName, java.io.File flTargetDirectory, int iVersion, long versionID, boolean printMessages)
           
 void getFileVersion(long fileID, java.lang.String fileName, java.io.File flTargetDirectory, int iVersion, long versionID, int eolType)
           
 void getFileVersion(long fileID, java.lang.String fileName, java.io.File flTargetDirectory, int iVersion, long versionID, int eolType, boolean printMessages)
           
 GuiConf getGuiConf()
           
static CommandCentral getInstance()
           
static CommandCentral getInstance(SJPrimaryWindow rootApplicationFrame)
           
 void getLabel(java.lang.String labelName, java.io.File flToDirectory, boolean bBuildSubDirs)
          Gets all of the file version in the specified label from the server and writes them to the specified directory (building subdirectories if required and allowed).
 void getLabel(java.lang.String labelName, java.io.File flToDirectory, boolean bBuildSubDirs, int eolType)
          Gets all of the file version in the specified label from the server and writes them to the specified directory (building subdirectories if required and allowed).
 NodeList getLabelList()
           
 javax.swing.JTable getPrimaryTable()
           
 javax.swing.table.TableColumnModel getPrimaryTableColumnModel()
           
 javax.swing.JTree getProjectTree()
           
 SJPrimaryWindow getRootAppFrame()
           
 java.lang.String[] getSelectedFileNames()
           
 boolean isAppWindowRendered()
           
 boolean isConnected()
           
 void makeArchive(java.lang.String name, int implementation, java.lang.String path)
           
 void makeArchiveDisconnected(java.lang.String userName, java.lang.String password, java.lang.String url, java.lang.String name, int implementation, java.lang.String path)
           
 void makeLabel(long labelRootProjectID, java.lang.String labelName, java.lang.String description)
           
 long makeProject(long parentProjectID, java.lang.String newProjectName)
          Make a new project on the server.
 void makeUser(java.lang.String sUserName, java.lang.String sPassword, java.lang.String sFullName)
           
 void removeFile(long fileID, long parentID)
           
 void removeProject(long projectID, long parentID)
           
 void removeUser(java.lang.String sUserName)
           
 void removeUserFromArchiveControllers(java.lang.String userName)
           
 void removeUserFromArchiveUsers(java.lang.String userName)
           
 void renameFile(long fileID, long parentID, java.lang.String newName)
           
 void renameProject(long projectID, long parentID, java.lang.String newName)
           
 void resetAppTitle()
           
 void restoreRemoved(long parentID, int iItemNumber, java.lang.String newName)
           
protected  long retrieveFileFromServer(DownloadFileIdentifier id, SJResponse response)
          Returns temp file id.
 Project retrieveProject(long projectID)
          Retrieve info about a project from the server.
 void rollbackToVersion(long fileID, long versionID)
          Rolls back a file in the SourceJammer server to the specified previous version of the file.
 void selectProject(ProjectTreeNode nd)
          Select the specified project in the project tree.
protected  long sendFileToServer(java.io.File fl, SJRequest request)
           
 void setAppWindowRendered(boolean b)
           
 void setArchiveConnectInfo(java.lang.String archive, java.lang.String userName, java.lang.String password)
           
 void setCurrentTreeNode(ProjectTreeNode node)
           
 void setDisconnectedDisplaySettings()
           
 void setPrimaryTableColumnModel(javax.swing.table.TableColumnModel model)
           
 void setServerURL(java.lang.String url)
           
 void setUserAdminStatus(java.lang.String userName, boolean status)
           
 void undoCheckOut(long fileID, java.lang.String sFileName, java.io.File flTargetDirectory)
           
 RemovedItem[] viewRemoved(long projectID)
           
 java.lang.String viewVersionComment(long versionID)
           
protected  byte[] zipByteArrayIfNeeded(byte[] file, SJRequest request, java.lang.String fileName)
          Checks if a byte array about to be sent is larger than the minimum unzipped file size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APP_TITLE

public static final java.lang.String APP_TITLE

out

public static java.io.PrintStream out
Method Detail

setArchiveConnectInfo

public void setArchiveConnectInfo(java.lang.String archive,
                                  java.lang.String userName,
                                  java.lang.String password)
                           throws java.io.IOException

getGuiConf

public GuiConf getGuiConf()

setPrimaryTableColumnModel

public void setPrimaryTableColumnModel(javax.swing.table.TableColumnModel model)

setCurrentTreeNode

public void setCurrentTreeNode(ProjectTreeNode node)

getCurrentTreeNode

public ProjectTreeNode getCurrentTreeNode()

setAppWindowRendered

public void setAppWindowRendered(boolean b)

isAppWindowRendered

public boolean isAppWindowRendered()

getPrimaryTableColumnModel

public javax.swing.table.TableColumnModel getPrimaryTableColumnModel()

getInstance

public static CommandCentral getInstance(SJPrimaryWindow rootApplicationFrame)

setServerURL

public void setServerURL(java.lang.String url)
                  throws java.net.MalformedURLException

getInstance

public static CommandCentral getInstance()

getSelectedFileNames

public java.lang.String[] getSelectedFileNames()

getAllCurrentFileNames

public java.lang.String[] getAllCurrentFileNames()

currentURL

public java.lang.String currentURL()

getArchiveNameList

public java.lang.String[] getArchiveNameList()
                                      throws SourceJammerConnectionException,
                                             GUICommandException
Returns list of archives available on server user is currently connected to.

deleteArchive

public boolean deleteArchive(java.lang.String archiveName)
                      throws SourceJammerConnectionException,
                             GUICommandException
Returns true if the archive deleted is the current archive and the user is now disconnected. Signal to close any open dialog.

connectToArchive

public Project connectToArchive()
                         throws SourceJammerConnectionException,
                                GUICommandException,
                                NoSessionException

resetAppTitle

public void resetAppTitle()

getFileInfo

public File getFileInfo(long lFileID)
                 throws GUICommandException,
                        SourceJammerConnectionException
Get file info

makeProject

public long makeProject(long parentProjectID,
                        java.lang.String newProjectName)
                 throws SourceJammerConnectionException,
                        GUICommandException
Make a new project on the server.

renameProject

public void renameProject(long projectID,
                          long parentID,
                          java.lang.String newName)

renameFile

public void renameFile(long fileID,
                       long parentID,
                       java.lang.String newName)

retrieveProject

public Project retrieveProject(long projectID)
                        throws SourceJammerConnectionException,
                               GUICommandException
Retrieve info about a project from the server. Migrated to 1.1 unique ID approach. --rfm

addFile

public void addFile(long parentUniqueID,
                    java.lang.String newFileName,
                    java.lang.String localFileNameLocation,
                    int fileType,
                    int historyType,
                    java.lang.String description)
             throws GUICommandException,
                    SourceJammerConnectionException,
                    java.io.IOException

disconnect

public boolean disconnect()

setDisconnectedDisplaySettings

public void setDisconnectedDisplaySettings()

getFile

public void getFile(long lFileID,
                    java.lang.String sFileName,
                    java.io.File flTargetDirectory)
             throws SourceJammerConnectionException,
                    GUICommandException,
                    java.io.IOException

getFileLatestVersionID

public long getFileLatestVersionID(long lFileID)

getFile

public void getFile(long lFileID,
                    java.lang.String sFileName,
                    java.io.File flTargetDirectory,
                    int eolType)
             throws SourceJammerConnectionException,
                    GUICommandException,
                    java.io.IOException

getClientDefaultEOLType

public int getClientDefaultEOLType()
Gets the default EOL type for the client from AppConfig.

checkOutFile

public void checkOutFile(long fileID,
                         java.lang.String fileName,
                         java.io.File flTargetDirectory)
                  throws SourceJammerConnectionException,
                         GUICommandException,
                         java.io.IOException

checkOutFile

public void checkOutFile(long fileID,
                         java.lang.String fileName,
                         java.io.File flTargetDirectory,
                         int eolType)
                  throws SourceJammerConnectionException,
                         GUICommandException,
                         java.io.IOException

checkInFile

public void checkInFile(long fileID,
                        java.lang.String sFileName,
                        java.io.File flTargetDirectory,
                        java.lang.String comment)
                 throws SourceJammerConnectionException,
                        GUICommandException,
                        java.io.IOException

undoCheckOut

public void undoCheckOut(long fileID,
                         java.lang.String sFileName,
                         java.io.File flTargetDirectory)
                  throws SourceJammerConnectionException,
                         GUICommandException

viewVersionComment

public java.lang.String viewVersionComment(long versionID)
                                    throws SourceJammerConnectionException,
                                           GUICommandException

getFileVersion

public void getFileVersion(long fileID,
                           java.lang.String sName,
                           java.io.File flTargetDirectory,
                           int iVersion,
                           long versionID)
                    throws SourceJammerConnectionException,
                           GUICommandException,
                           java.io.IOException

getFileVersion

public void getFileVersion(long fileID,
                           java.lang.String sName,
                           java.io.File flTargetDirectory,
                           int iVersion,
                           long versionID,
                           boolean printMessages)
                    throws SourceJammerConnectionException,
                           GUICommandException,
                           java.io.IOException

getFileVersion

public void getFileVersion(long fileID,
                           java.lang.String fileName,
                           java.io.File flTargetDirectory,
                           int iVersion,
                           long versionID,
                           int eolType)
                    throws SourceJammerConnectionException,
                           GUICommandException,
                           java.io.IOException

getFileVersion

public void getFileVersion(long fileID,
                           java.lang.String fileName,
                           java.io.File flTargetDirectory,
                           int iVersion,
                           long versionID,
                           int eolType,
                           boolean printMessages)
                    throws SourceJammerConnectionException,
                           GUICommandException,
                           java.io.IOException

removeProject

public void removeProject(long projectID,
                          long parentID)
                   throws SourceJammerConnectionException,
                          GUICommandException

removeFile

public void removeFile(long fileID,
                       long parentID)
                throws SourceJammerConnectionException,
                       GUICommandException

viewRemoved

public RemovedItem[] viewRemoved(long projectID)
                          throws SourceJammerConnectionException,
                                 GUICommandException

restoreRemoved

public void restoreRemoved(long parentID,
                           int iItemNumber,
                           java.lang.String newName)

deleteRemoved

public void deleteRemoved(long lParentID,
                          int iItemNumber)
                   throws SourceJammerConnectionException,
                          GUICommandException

makeUser

public void makeUser(java.lang.String sUserName,
                     java.lang.String sPassword,
                     java.lang.String sFullName)
              throws GUICommandException,
                     SourceJammerConnectionException

removeUser

public void removeUser(java.lang.String sUserName)
                throws GUICommandException,
                       SourceJammerConnectionException

changePassword

public void changePassword(java.lang.String sPassword)
                    throws SourceJammerConnectionException,
                           GUICommandException

changePassword

public void changePassword(java.lang.String sPassword,
                           java.lang.String userName)
                    throws SourceJammerConnectionException,
                           GUICommandException

makeArchive

public void makeArchive(java.lang.String name,
                        int implementation,
                        java.lang.String path)
                 throws SourceJammerConnectionException,
                        GUICommandException

makeArchiveDisconnected

public void makeArchiveDisconnected(java.lang.String userName,
                                    java.lang.String password,
                                    java.lang.String url,
                                    java.lang.String name,
                                    int implementation,
                                    java.lang.String path)
                             throws SourceJammerConnectionException,
                                    GUICommandException,
                                    java.net.MalformedURLException,
                                    NoSessionException

getLabelList

public NodeList getLabelList()
                      throws SourceJammerConnectionException,
                             GUICommandException,
                             NodeExistsException

makeLabel

public void makeLabel(long labelRootProjectID,
                      java.lang.String labelName,
                      java.lang.String description)
               throws SourceJammerConnectionException,
                      GUICommandException

getLabel

public void getLabel(java.lang.String labelName,
                     java.io.File flToDirectory,
                     boolean bBuildSubDirs)
              throws SourceJammerConnectionException,
                     GUICommandException,
                     java.io.IOException
Gets all of the file version in the specified label from the server and writes them to the specified directory (building subdirectories if required and allowed).

getLabel

public void getLabel(java.lang.String labelName,
                     java.io.File flToDirectory,
                     boolean bBuildSubDirs,
                     int eolType)
              throws SourceJammerConnectionException,
                     GUICommandException,
                     java.io.IOException
Gets all of the file version in the specified label from the server and writes them to the specified directory (building subdirectories if required and allowed).

getCompleteUserList

public UserInfo[] getCompleteUserList()
                               throws SourceJammerConnectionException,
                                      GUICommandException

getArchiveControllerList

public UserInfo[] getArchiveControllerList()
                                    throws SourceJammerConnectionException,
                                           GUICommandException

getArchiveUserList

public UserInfo[] getArchiveUserList()
                              throws SourceJammerConnectionException,
                                     GUICommandException

getCurrentUserName

public java.lang.String getCurrentUserName()

setUserAdminStatus

public void setUserAdminStatus(java.lang.String userName,
                               boolean status)
                        throws SourceJammerConnectionException,
                               GUICommandException

addUserToArchiveControllers

public void addUserToArchiveControllers(java.lang.String userName)
                                 throws SourceJammerConnectionException,
                                        GUICommandException

addUserToArchiveUsers

public void addUserToArchiveUsers(java.lang.String userName)
                           throws SourceJammerConnectionException,
                                  GUICommandException

removeUserFromArchiveControllers

public void removeUserFromArchiveControllers(java.lang.String userName)
                                      throws SourceJammerConnectionException,
                                             GUICommandException

removeUserFromArchiveUsers

public void removeUserFromArchiveUsers(java.lang.String userName)
                                throws SourceJammerConnectionException,
                                       GUICommandException

rollbackToVersion

public void rollbackToVersion(long fileID,
                              long versionID)
                       throws SourceJammerConnectionException,
                              GUICommandException
Rolls back a file in the SourceJammer server to the specified previous version of the file.

isConnected

public boolean isConnected()

getRootAppFrame

public SJPrimaryWindow getRootAppFrame()

getProjectTree

public javax.swing.JTree getProjectTree()

getPrimaryTable

public javax.swing.JTable getPrimaryTable()

displayErrorMessage

public void displayErrorMessage(java.lang.String s,
                                boolean eventThread)

displayErrorMessage

public void displayErrorMessage(java.lang.String[] s,
                                boolean eventThread)

displayErrorMessage

public void displayErrorMessage(java.lang.String[] s)

displayErrorMessage

public void displayErrorMessage(java.lang.String s)

selectProject

public void selectProject(ProjectTreeNode nd)
Select the specified project in the project tree.

zipByteArrayIfNeeded

protected byte[] zipByteArrayIfNeeded(byte[] file,
                                      SJRequest request,
                                      java.lang.String fileName)
                               throws java.io.IOException
Checks if a byte array about to be sent is larger than the minimum unzipped file size. If so, zips the file and sets the flag in the SJRequest.

getChecker

protected SourceVersionChecker getChecker(java.io.File flDirectory)
                                   throws java.io.IOException

retrieveFileFromServer

protected long retrieveFileFromServer(DownloadFileIdentifier id,
                                      SJResponse response)
                               throws java.io.IOException,
                                      SourceJammerConnectionException
Returns temp file id.

sendFileToServer

protected long sendFileToServer(java.io.File fl,
                                SJRequest request)
                         throws java.io.IOException,
                                SourceJammerConnectionException

SourceJammer 1.2.0.1 May 20, 2002
Copyright (c) 2001, 2002 Robert MacGrogan