uk.ac.rdg.resc.jstyx.server
Class StyxServerProtocolHandler

java.lang.Object
  extended by uk.ac.rdg.resc.jstyx.server.StyxServerProtocolHandler
All Implemented Interfaces:
org.apache.mina.protocol.ProtocolHandler

public class StyxServerProtocolHandler
extends java.lang.Object
implements org.apache.mina.protocol.ProtocolHandler

ProtocolHandler listener for a StyxServer (replaces StyxServerSessionListener from Netty).

Author:
Jon Blower $Revision: 604 $ $Date: 2006-03-21 14:58:42 +0000 (Tue, 21 Mar 2006) $ $Log$ Revision 1.16 2006/03/21 14:58:42 jonblower Implemented clear-text password-based authentication and did some simple tests Revision 1.15 2006/03/21 09:06:15 jonblower Still implementing authentication Revision 1.14 2006/03/20 17:51:50 jonblower Adding authentication to base JStyx system Revision 1.13 2005/12/01 08:21:56 jonblower Fixed javadoc comments Revision 1.12 2005/11/03 17:09:27 jonblower Created more efficient RreadMessage that involves less copying of buffers (still reliable) Revision 1.11 2005/09/08 07:08:59 jonblower Removed "String user" from list of parameters to StyxFile.write() Revision 1.10 2005/05/19 14:46:51 jonblower Changed behaviour of StyxDirectory.createChild(): no longer adds file to namespace in this method Revision 1.9 2005/05/10 19:19:44 jonblower Added call to StyxMessage.dispose() in messageSent() callback Revision 1.8 2005/05/05 16:57:38 jonblower Updated MINA library to revision 168337 and changed code accordingly Revision 1.7 2005/04/28 08:11:15 jonblower Modified permissions handling in documentation directory of SGS Revision 1.6 2005/03/19 21:47:02 jonblower Further fixes relating to releasing ByteBuffers Revision 1.5 2005/03/16 22:16:43 jonblower Added Styx Grid Service classes to core module Revision 1.4 2005/03/16 17:56:24 jonblower Replaced use of java.nio.ByteBuffer with MINA's ByteBuffer to minimise copying of buffers Revision 1.3 2005/03/15 15:51:41 jonblower Removed hard limit on maximum message size Revision 1.2 2005/03/11 14:02:16 jonblower Merged MINA-Test_20059309 into main line of development Revision 1.1.2.4 2005/03/11 08:30:30 jonblower Moved to log4j logging system (from apache commons logging) Revision 1.1.2.3 2005/03/10 20:55:40 jonblower Removed references to Netty Revision 1.1.2.2 2005/03/10 11:55:00 jonblower Replaced StyxFile with StyxDirectory for root of server Revision 1.1.2.1 2005/03/10 08:10:41 jonblower Initial import

Constructor Summary
StyxServerProtocolHandler(StyxDirectory fileTreeRoot, StyxSecurityContext securityContext)
           
 
Method Summary
 void exceptionCaught(org.apache.mina.protocol.ProtocolSession session, java.lang.Throwable cause)
           
 void messageReceived(org.apache.mina.protocol.ProtocolSession session, java.lang.Object message)
           
 void messageSent(org.apache.mina.protocol.ProtocolSession session, java.lang.Object message)
           
static void reply(org.apache.mina.protocol.ProtocolSession session, StyxMessage message, int tag)
          Convenience method for sending a message back to the client.
 void sessionClosed(org.apache.mina.protocol.ProtocolSession session)
           
 void sessionCreated(org.apache.mina.protocol.ProtocolSession session)
          Invoked when the session is created.
 void sessionIdle(org.apache.mina.protocol.ProtocolSession session, org.apache.mina.common.IdleStatus status)
           
 void sessionOpened(org.apache.mina.protocol.ProtocolSession session)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyxServerProtocolHandler

public StyxServerProtocolHandler(StyxDirectory fileTreeRoot,
                                 StyxSecurityContext securityContext)
Method Detail

sessionCreated

public void sessionCreated(org.apache.mina.protocol.ProtocolSession session)
                    throws java.lang.Exception
Invoked when the session is created. Initialize default socket parameters and user-defined attributes here.

Specified by:
sessionCreated in interface org.apache.mina.protocol.ProtocolHandler
Throws:
java.lang.Exception

sessionOpened

public void sessionOpened(org.apache.mina.protocol.ProtocolSession session)
Specified by:
sessionOpened in interface org.apache.mina.protocol.ProtocolHandler

sessionClosed

public void sessionClosed(org.apache.mina.protocol.ProtocolSession session)
Specified by:
sessionClosed in interface org.apache.mina.protocol.ProtocolHandler

messageReceived

public void messageReceived(org.apache.mina.protocol.ProtocolSession session,
                            java.lang.Object message)
Specified by:
messageReceived in interface org.apache.mina.protocol.ProtocolHandler

messageSent

public void messageSent(org.apache.mina.protocol.ProtocolSession session,
                        java.lang.Object message)
Specified by:
messageSent in interface org.apache.mina.protocol.ProtocolHandler

sessionIdle

public void sessionIdle(org.apache.mina.protocol.ProtocolSession session,
                        org.apache.mina.common.IdleStatus status)
Specified by:
sessionIdle in interface org.apache.mina.protocol.ProtocolHandler

exceptionCaught

public void exceptionCaught(org.apache.mina.protocol.ProtocolSession session,
                            java.lang.Throwable cause)
Specified by:
exceptionCaught in interface org.apache.mina.protocol.ProtocolHandler

reply

public static void reply(org.apache.mina.protocol.ProtocolSession session,
                         StyxMessage message,
                         int tag)
Convenience method for sending a message back to the client.



Copyright © 2004-2006 Reading e-Science Centre. All Rights Reserved.