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

java.lang.Object
  extended by uk.ac.rdg.resc.jstyx.server.StyxServer

public class StyxServer
extends java.lang.Object

A Styx server.

Author:
Jon Blower $Revision: 604 $ $Date: 2006-03-21 14:58:42 +0000 (Tue, 21 Mar 2006) $ $Log$ Revision 1.10 2006/03/21 14:58:42 jonblower Implemented clear-text password-based authentication and did some simple tests Revision 1.9 2006/03/21 09:06:15 jonblower Still implementing authentication Revision 1.8 2006/03/20 17:51:50 jonblower Adding authentication to base JStyx system Revision 1.7 2005/08/30 16:28:23 jonblower Subsumed TestServer program into StyxServer class Revision 1.6 2005/05/05 16:57:38 jonblower Updated MINA library to revision 168337 and changed code accordingly Revision 1.5 2005/03/24 07:57:41 jonblower Improved code for reading SSL info from SGSconfig file and included parameter information for the Grid Services in the config file Revision 1.4 2005/03/14 16:40:02 jonblower Modifications for using SSL Revision 1.3 2005/03/11 14:02:16 jonblower Merged MINA-Test_20059309 into main line of development Revision 1.2.2.6 2005/03/11 08:30:30 jonblower Moved to log4j logging system (from apache commons logging) Revision 1.2.2.5 2005/03/10 18:32:18 jonblower Minor change to layout Revision 1.2.2.3 and 1.2.2.4 2005/03/10 14:38:10 jonblower Modified for MINA framework Revision 1.2.2.1 2005/03/09 19:44:18 jonblower Changes concerned with migration to MINA Revision 1.1.1.1 2005/02/16 18:58:33 jonblower Initial import

Constructor Summary
StyxServer(int port, org.apache.mina.protocol.ProtocolProvider provider)
          Creates a Styx server that listens on the given port and uses the given protocol provider (This is used by the Styx interloper class) Connections are anonymous and unsecured.
StyxServer(int port, StyxDirectory root)
          Creates a Styx server that exposes the given directory under the given port.
StyxServer(int port, StyxDirectory root, java.lang.String securityConfigFile)
          Creates a Styx server.
 
Method Summary
static void main(java.lang.String[] args)
          Simple test Styx server that exposes the contents of a local directory.
 void start()
          Starts the Styx server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyxServer

public StyxServer(int port,
                  StyxDirectory root)
           throws StyxSecurityException
Creates a Styx server that exposes the given directory under the given port. No security information is used: server will allow anonymous access and no traffic will be encrypted.

Throws:
java.lang.IllegalArgumentException - if the port number is invalid or the root is null.
StyxSecurityException - if there was an error setting up the security context (should never happen since this will be an unsecured server).

StyxServer

public StyxServer(int port,
                  org.apache.mina.protocol.ProtocolProvider provider)
Creates a Styx server that listens on the given port and uses the given protocol provider (This is used by the Styx interloper class) Connections are anonymous and unsecured.

Throws:
java.lang.IllegalArgumentException - if the port number is invalid or the provider is null.

StyxServer

public StyxServer(int port,
                  StyxDirectory root,
                  java.lang.String securityConfigFile)
           throws StyxSecurityException
Creates a Styx server.

Parameters:
port - The port number on which the server will listen
root - The root of the Styx filesystem to serve
securityConfigFile - The file containing security information (user details, SSL setup etc). If this is null, the server will allow anonymous access and no traffic will be encrypted.
Throws:
java.lang.IllegalArgumentException - if the port number is invalid or root == null.
StyxSecurityException - if there was an error reading security configuration from securityConfigFile.
Method Detail

start

public void start()
           throws java.io.IOException
Starts the Styx server.

Throws:
java.io.IOException - if an error occurred

main

public static void main(java.lang.String[] args)
                 throws java.lang.Throwable
Simple test Styx server that exposes the contents of a local directory. The TestServer takes two arguments, both optional. The first is the port number under which the server will listen (defaults to 8080 if not set). The second is the directory in the host filesystem which will be at the root of the Styx server. This defaults to the user's home directory (i.e. the output of System.getProperty("user.home")) if not set.

Throws:
java.lang.Throwable


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