com.enderak.procol.server.net
Class ProColServer

java.lang.Object
  |
  +--java.util.Observable
        |
        +--com.enderak.procol.common.util.EnhancedObservable
              |
              +--com.enderak.procol.server.net.ProColServer
All Implemented Interfaces:
java.lang.Runnable

public final class ProColServer
extends EnhancedObservable
implements java.lang.Runnable

The main ProCol server class. Accepts connections and creates ServerConnections to maintain them. Keeps track of the project and connection lists, server properties, etc.

Author:
Justin Dieters

Constructor Summary
ProColServer()
           
 
Method Summary
 int authenticateUser(java.lang.String usernameIn, java.lang.String passwordIn)
          Description of the Method
 void closeAllConnections()
          Description of the Method
 void closeConnection(ServerConnection connectionIn)
          Description of the Method
protected  void finalize()
           
 java.util.Vector getAllowedProjects(ProColUser userIn)
          Gets the allowedProjects attribute of the ProColServer class
 int getPort()
          Gets the port attribute of the ProColServer class
 ProColServerProject getProject(java.lang.String projectName)
          Gets the project attribute of the ProColServer object
 java.util.Vector getProjectList()
          Gets the projectList attribute of the ProColServer class
 java.lang.String getProperty(java.lang.String propertyIn)
          Gets the property attribute of the ProColServer class
 java.lang.String getProperty(java.lang.String propertyIn, java.lang.String defaultIn)
          Gets the property attribute of the ProColServer class
 java.lang.String getUserProperty(java.lang.String propertyIn)
          Gets the userProperty attribute of the ProColServer class
 java.lang.String getUserProperty(java.lang.String propertyIn, java.lang.String defaultIn)
          Gets the userProperty attribute of the ProColServer class
 boolean isRunning()
          Gets the running attribute of the ProColServer class
 boolean isUserLoggedIn(java.lang.String usernameIn)
          Gets the userLoggedIn attribute of the ProColServer class
 boolean isWithinJEdit()
          Gets the withinJEdit attribute of the ProColServer class
static void printErr(java.lang.String errIn)
          Prints an error message.
static void printInfo(java.lang.String infoIn)
          Prints an informational message.
 void run()
          Main processing method for the ProColServer object
 java.lang.Object setProperty(java.lang.String keyIn, java.lang.String propertyIn)
          Gets the property attribute of the ProColServer class
 void setWithinJEdit(boolean withinJEditIn)
          Sets the withinJEdit attribute of the ProColServer class
 void stopServer()
          Description of the Method
 
Methods inherited from class com.enderak.procol.common.util.EnhancedObservable
forceNotify, forceNotify
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProColServer

public ProColServer()
Method Detail

printErr

public static void printErr(java.lang.String errIn)
Prints an error message. If within jEdit, displays error in Server Control Panel. If standalone, prints to System.err.

Parameters:
errIn - Description of the Parameter

printInfo

public static void printInfo(java.lang.String infoIn)
Prints an informational message. If within jEdit, displays message in Server Control Panel. If standalone, prints to System.out.

Parameters:
infoIn - Description of the Parameter

run

public void run()
Main processing method for the ProColServer object

Specified by:
run in interface java.lang.Runnable

stopServer

public void stopServer()
Description of the Method


closeConnection

public void closeConnection(ServerConnection connectionIn)
Description of the Method

Parameters:
connectionIn - Description of the Parameter

closeAllConnections

public void closeAllConnections()
Description of the Method


setProperty

public java.lang.Object setProperty(java.lang.String keyIn,
                                    java.lang.String propertyIn)
Gets the property attribute of the ProColServer class

Parameters:
propertyIn - Description of the Parameter
keyIn -
Returns:
The property value

getProperty

public java.lang.String getProperty(java.lang.String propertyIn)
Gets the property attribute of the ProColServer class

Parameters:
propertyIn - Description of the Parameter
Returns:
The property value

getProperty

public java.lang.String getProperty(java.lang.String propertyIn,
                                    java.lang.String defaultIn)
Gets the property attribute of the ProColServer class

Parameters:
propertyIn - Description of the Parameter
defaultIn - Description of the Parameter
Returns:
The property value

getUserProperty

public java.lang.String getUserProperty(java.lang.String propertyIn)
Gets the userProperty attribute of the ProColServer class

Parameters:
propertyIn - Description of the Parameter
Returns:
The userProperty value

getUserProperty

public java.lang.String getUserProperty(java.lang.String propertyIn,
                                        java.lang.String defaultIn)
Gets the userProperty attribute of the ProColServer class

Parameters:
propertyIn - Description of the Parameter
defaultIn - Description of the Parameter
Returns:
The userProperty value

isWithinJEdit

public boolean isWithinJEdit()
Gets the withinJEdit attribute of the ProColServer class

Returns:
The withinJEdit value

isRunning

public boolean isRunning()
Gets the running attribute of the ProColServer class

Returns:
The running value

getPort

public int getPort()
Gets the port attribute of the ProColServer class

Returns:
The port value

authenticateUser

public int authenticateUser(java.lang.String usernameIn,
                            java.lang.String passwordIn)
Description of the Method

Parameters:
usernameIn - Description of the Parameter
passwordIn - Description of the Parameter
Returns:
Description of the Return Value

isUserLoggedIn

public boolean isUserLoggedIn(java.lang.String usernameIn)
Gets the userLoggedIn attribute of the ProColServer class

Parameters:
usernameIn - Description of the Parameter
Returns:
The userLoggedIn value

getProjectList

public java.util.Vector getProjectList()
Gets the projectList attribute of the ProColServer class

Returns:
The projectList value

getAllowedProjects

public java.util.Vector getAllowedProjects(ProColUser userIn)
Gets the allowedProjects attribute of the ProColServer class

Parameters:
userIn - Description of the Parameter
Returns:
The allowedProjects value

getProject

public ProColServerProject getProject(java.lang.String projectName)
Gets the project attribute of the ProColServer object

Parameters:
projectName - Description of the Parameter
Returns:
The project value

setWithinJEdit

public void setWithinJEdit(boolean withinJEditIn)
Sets the withinJEdit attribute of the ProColServer class

Parameters:
withinJEditIn - The new withinJEdit value

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object