proper.remote
Class Server

java.lang.Object
  extended by proper.core.ProperObject
      extended by proper.core.ArgumentObject
          extended by proper.app.Application
              extended by proper.remote.Server
All Implemented Interfaces:
CommandLineInterface, ProperInterface, XMLAccessInterface
Direct Known Subclasses:
JobClient, JobServer

public abstract class Server
extends Application

This abstract class contains some basic functionality for a server.

For a complete list of commandline parameters just run it with the option "-help".

Version:
$Revision: 1.2 $
Author:
FracPete

Field Summary
static int ALIVE_CHECK
          the interval in msec to check the alive status of the clients
static int LIST_CLIENTS
          the identifier for the clients
static java.lang.String REQUEST_ISALIVE
          with this request the we just send an empty message to the server (this can be used as a notification message)
static java.lang.String REQUEST_NOP
          with this request the we just send an empty message to the server (this can be used as a notification message)
 
Fields inherited from interface proper.core.ProperInterface
VERSION
 
Constructor Summary
Server()
          initializes the object
 
Method Summary
 void addToAccessLog(java.lang.String msg)
          adds the message to the access log
 void addToErrorLog(java.lang.String msg)
          adds the message to the error log
 void checkClients()
          checks all the clients in the list whether they are still alive, if not they are removed from the list
 Message createMessage()
          creates a new Message with the IP and Port of the server
 Message createMessage(java.lang.String request)
          creates a new Message with the IP and Port of the server and with the given Request
 ClientList getClientList(int type)
          returns the specified clientlist
 java.lang.String getHostName()
          returns the hostname of the server
 int getPort()
          returns the port the server is listening to
 boolean isOperational()
          this method determines whether the server should continue accepting connections or not
 
Methods inherited from class proper.app.Application
checkCommandLine, createInstance, fromXML, parameterError, printDescription, printUsage, run, run, setArgs, setArgs, toString, toXML
 
Methods inherited from class proper.core.ArgumentObject
fixAdditionalArg
 
Methods inherited from class proper.core.ProperObject
addListener, addOutput, classInVerbose, debugprint, debugprint, debugprint, debugprint, debugprintln, debugprintln, debugprintln, debugprintln, debugprintln, getListeners, getRuntime, getVerbose, getVerboseLevel, getVerboseLevelForClass, getVerboseString, getVerboseStringForClass, notifyListener, notifyListeners, print, print, print, print, println, println, println, println, println, printMemory, removeListener, setOutput, setVerbose, setVerboseLevel, setVerboseString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REQUEST_NOP

public static final java.lang.String REQUEST_NOP
with this request the we just send an empty message to the server (this can be used as a notification message)

See Also:
Constant Field Values

REQUEST_ISALIVE

public static final java.lang.String REQUEST_ISALIVE
with this request the we just send an empty message to the server (this can be used as a notification message)

See Also:
Constant Field Values

LIST_CLIENTS

public static final int LIST_CLIENTS
the identifier for the clients

See Also:
Constant Field Values

ALIVE_CHECK

public static final int ALIVE_CHECK
the interval in msec to check the alive status of the clients

See Also:
Constant Field Values
Constructor Detail

Server

public Server()
initializes the object

Method Detail

getPort

public int getPort()
returns the port the server is listening to


getHostName

public java.lang.String getHostName()
returns the hostname of the server


addToErrorLog

public void addToErrorLog(java.lang.String msg)
adds the message to the error log


addToAccessLog

public void addToAccessLog(java.lang.String msg)
adds the message to the access log


createMessage

public Message createMessage()
creates a new Message with the IP and Port of the server


createMessage

public Message createMessage(java.lang.String request)
creates a new Message with the IP and Port of the server and with the given Request


checkClients

public void checkClients()
checks all the clients in the list whether they are still alive, if not they are removed from the list


getClientList

public ClientList getClientList(int type)
returns the specified clientlist


isOperational

public boolean isOperational()
this method determines whether the server should continue accepting connections or not