uk.org.iscream.cms.util
Class ACLServerSocket

java.lang.Object
  extended byjava.net.ServerSocket
      extended byuk.org.iscream.cms.util.ACLServerSocket

public class ACLServerSocket
extends ServerSocket

Access Control List ServerSocket wrapper. Used to wrap a ServerSocket with an ACL, whilst extending ServerSocket to make integration into code easier. Once the ACL has been set, accept() can be used exactly as it would be with a ServerSocket.

Version:
$Id: ACLServerSocket.java,v 1.4 2003/02/05 14:27:58 tdb Exp $
Author:
$Author: tdb $

Field Summary
private  ACL _acl
          The ACL used by this ACLServerSocket.
private  String _name
          This is the friendly identifier of the component this class is running in.
static String REVISION
          The current CVS revision of this class
 
Fields inherited from class java.net.ServerSocket
 
Constructor Summary
ACLServerSocket(ACL acl, int port)
          See relevant ServerSocket constructor, and sets the default acl.
ACLServerSocket(ACL acl, int port, int backlog)
          See relevant ServerSocket constructor, and sets the default acl.
ACLServerSocket(ACL acl, int port, int backlog, InetAddress bindAddr)
          See relevant ServerSocket constructor, and sets the default acl.
ACLServerSocket(int port)
          See relevant ServerSocket constructor.
ACLServerSocket(int port, int backlog)
          See relevant ServerSocket constructor.
ACLServerSocket(int port, int backlog, InetAddress bindAddr)
          See relevant ServerSocket constructor.
 
Method Summary
 Socket accept()
          Essentially has the same behaviour as the ServerSocket.accept() method, except won't return a Socket unless it is permitted by the ACL.
 void setACL(ACL acl)
          Set the ACL at any point in the operation of the ServerSocket.
 String toString()
          Overrides the Object.toString() method to provide clean logging (every class should have this).
 
Methods inherited from class java.net.ServerSocket
bind, bind, close, getChannel, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setReceiveBufferSize, setReuseAddress, setSocketFactory, setSoTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
The current CVS revision of this class

See Also:
Constant Field Values

_name

private String _name
This is the friendly identifier of the component this class is running in. eg, a Filter may be called "filter1", If this class does not have an owning component, a name from the configuration can be placed here. This name could also be changed to null for utility classes.


_acl

private ACL _acl
The ACL used by this ACLServerSocket.

Constructor Detail

ACLServerSocket

public ACLServerSocket(int port)
                throws IOException
See relevant ServerSocket constructor.


ACLServerSocket

public ACLServerSocket(int port,
                       int backlog)
                throws IOException
See relevant ServerSocket constructor.


ACLServerSocket

public ACLServerSocket(int port,
                       int backlog,
                       InetAddress bindAddr)
                throws IOException
See relevant ServerSocket constructor.


ACLServerSocket

public ACLServerSocket(ACL acl,
                       int port)
                throws IOException
See relevant ServerSocket constructor, and sets the default acl.


ACLServerSocket

public ACLServerSocket(ACL acl,
                       int port,
                       int backlog)
                throws IOException
See relevant ServerSocket constructor, and sets the default acl.


ACLServerSocket

public ACLServerSocket(ACL acl,
                       int port,
                       int backlog,
                       InetAddress bindAddr)
                throws IOException
See relevant ServerSocket constructor, and sets the default acl.

Method Detail

accept

public Socket accept()
              throws IOException
Essentially has the same behaviour as the ServerSocket.accept() method, except won't return a Socket unless it is permitted by the ACL. Closes Socket's immediately that aren't permitted by the ACL.

Throws:
IOException

setACL

public void setACL(ACL acl)
Set the ACL at any point in the operation of the ServerSocket.

Parameters:
acl - the new ACL to apply

toString

public String toString()
Overrides the Object.toString() method to provide clean logging (every class should have this). This uses the uk.org.iscream.cms.server.util.FormatName class to format the toString()

Returns:
the name of this class and its CVS revision


Copyright © 2000-2003 i-scream. All Rights Reserved.