br.shob.server
Class ServerCommLayer

java.lang.Object
  |
  +--br.shob.AbstractCommLayer
        |
        +--br.shob.server.ServerCommLayer

public class ServerCommLayer
extends AbstractCommLayer

Author:
crolmos, dukejeffrie
Created:
September 1, 2002

Field Summary
protected  ServerSocket plainSocket
          Description of the Field
protected  Server server
          Description of the Field
protected  ServerSocket signedSocket
          Description of the Field
 
Fields inherited from class br.shob.AbstractCommLayer
keyPairGeneratorAlgorithm, logger, myId, signatureAlgorithm
 
Constructor Summary
protected ServerCommLayer()
          Creates new ServerCommLayer
  ServerCommLayer(Server server)
          Constructor for the ServerCommLayer object
 
Method Summary
protected  void beginTrans(Socket s, URL client, String globalName)
          The server should block if the object is already locked
protected  void commit(Socket s, URL client, String globalName)
          Description of the Method
 Server getServer()
          Gets the server attribute of the ServerCommLayer object
protected  void identify(Socket s, URL url)
          Description of the Method
 void login(Socket s, HostId client)
          Description of the Method
 void logout(Socket s, URL client)
          Description of the Method
 boolean ping(URL client)
          Description of the Method
protected  void request(Socket s, String globalName)
          Description of the Method
protected  void rollback(Socket s, URL client, String globalName)
          Description of the Method
 void share(Socket s, URL client, String globalName)
          Description of the Method
 void start()
          Description of the Method
protected  void unlock(Socket s, URL client, String globalName, TimeStamp stamp)
          Description of the Method
protected  void unshare(Socket s, URL client, String globalName)
          Description of the Method
protected  void update(String globalName, HostId writer)
          Description of the Method
protected  void validate(Socket s, String globalName, TimeStamp stamp)
          Description of the Method
 
Methods inherited from class br.shob.AbstractCommLayer
connect, connect, getLogger, isOnline, recvMessage, recvMessage, sendMessage, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plainSocket

protected ServerSocket plainSocket
Description of the Field


server

protected Server server
Description of the Field


signedSocket

protected ServerSocket signedSocket
Description of the Field

Constructor Detail

ServerCommLayer

public ServerCommLayer(Server server)
                throws CommLayerException
Constructor for the ServerCommLayer object

Parameters:
server - Description of the Parameter
Throws:
CommLayerException - Description of the Exception

ServerCommLayer

protected ServerCommLayer()
Creates new ServerCommLayer

Method Detail

getServer

public Server getServer()
Gets the server attribute of the ServerCommLayer object

Returns:
The server value

login

public void login(Socket s,
                  HostId client)
           throws CommLayerException
Description of the Method

Parameters:
s - Description of the Parameter
client - Description of the Parameter
Throws:
CommLayerException - Description of the Exception

logout

public void logout(Socket s,
                   URL client)
            throws CommLayerException
Description of the Method

Parameters:
s - Description of the Parameter
client - Description of the Parameter
Throws:
CommLayerException - Description of the Exception

ping

public boolean ping(URL client)
Description of the Method

Parameters:
client - Description of the Parameter
Returns:
Description of the Return Value

share

public void share(Socket s,
                  URL client,
                  String globalName)
           throws CommLayerException
Description of the Method

Parameters:
s - Description of the Parameter
client - Description of the Parameter
globalName - Description of the Parameter
Throws:
CommLayerException - Description of the Exception

start

public void start()
           throws CommLayerException
Description of the Method

Throws:
CommLayerException - Description of the Exception

beginTrans

protected void beginTrans(Socket s,
                          URL client,
                          String globalName)
                   throws CommLayerException
The server should block if the object is already locked

Parameters:
s - Description of the Parameter
client - Description of the Parameter
globalName - Description of the Parameter
Throws:
CommLayerException - Description of the Exception

commit

protected void commit(Socket s,
                      URL client,
                      String globalName)
               throws CommLayerException
Description of the Method

Parameters:
s - Description of the Parameter
client - Description of the Parameter
globalName - Description of the Parameter
Throws:
CommLayerException - Description of the Exception

identify

protected void identify(Socket s,
                        URL url)
                 throws CommLayerException
Description of the Method

Parameters:
s - Description of the Parameter
url - Description of the Parameter
Throws:
CommLayerException - Description of the Exception

request

protected void request(Socket s,
                       String globalName)
                throws CommLayerException
Description of the Method

Parameters:
s - Description of the Parameter
globalName - Description of the Parameter
Throws:
CommLayerException - Description of the Exception

rollback

protected void rollback(Socket s,
                        URL client,
                        String globalName)
                 throws CommLayerException
Description of the Method

Parameters:
s - Description of the Parameter
client - Description of the Parameter
globalName - Description of the Parameter
Throws:
CommLayerException - Description of the Exception

unlock

protected void unlock(Socket s,
                      URL client,
                      String globalName,
                      TimeStamp stamp)
               throws CommLayerException
Description of the Method

Parameters:
s - Description of the Parameter
client - Description of the Parameter
globalName - Description of the Parameter
stamp - Description of the Parameter
Throws:
CommLayerException - Description of the Exception

unshare

protected void unshare(Socket s,
                       URL client,
                       String globalName)
                throws CommLayerException
Description of the Method

Parameters:
s - Description of the Parameter
client - Description of the Parameter
globalName - Description of the Parameter
Throws:
CommLayerException - Description of the Exception

update

protected void update(String globalName,
                      HostId writer)
               throws CommLayerException,
                      NotSharedException
Description of the Method

Parameters:
globalName - Description of the Parameter
writer - Description of the Parameter
Throws:
CommLayerException - Description of the Exception
NotSharedException - Description of the Exception

validate

protected void validate(Socket s,
                        String globalName,
                        TimeStamp stamp)
                 throws CommLayerException
Description of the Method

Parameters:
s - Description of the Parameter
globalName - Description of the Parameter
stamp - Description of the Parameter
Throws:
CommLayerException - Description of the Exception