org.openiec61850.scsm.mms.server
Class MmsServerSAP

java.lang.Object
  extended by org.openiec61850.scsm.mms.server.MmsServerSAP
All Implemented Interfaces:
org.openiec61850.jmms.iso.acse.AcseAssociationListener, SCSMServerSAP

public class MmsServerSAP
extends java.lang.Object
implements SCSMServerSAP, org.openiec61850.jmms.iso.acse.AcseAssociationListener


Constructor Summary
MmsServerSAP()
           
MmsServerSAP(int port, int backlog, java.net.InetAddress bindAddr, AccessPoint accessPoint, SAPStopListener sapStopListener)
          Create a simple MMSServerSAP.
MmsServerSAP(int port, int backlog, java.net.InetAddress bindAddr, AccessPoint accessPoint, javax.net.ServerSocketFactory serverSocketFactory, SAPStopListener sapStopListener)
          Create an MMSServerSAP with a ServerSocketFactory.
 
Method Summary
 void connectionIndication(org.openiec61850.jmms.iso.acse.AcseAssociation pConnection, java.nio.ByteBuffer psdu)
           
 void init(AccessPoint accessPoint, SAPStopListener sapStopListener, java.util.Properties properties, java.lang.String sapPropName)
           
 void serverStoppedListeningIndication(java.io.IOException e)
           
 void setMaxConnections(int maxConnections)
          Set the maximum number of connections that are allowed in parallel by the Server SAP.
 void setMaxTPDUSizeParam(int maxTPDUSizeParam)
          Set the maxTPDUSize.
 void setMessageFragmentTimeout(int messageFragmentTimeout)
          Set the TConnection timeout for receiving data once the beginning of a message has been received.
 void setMessageTimeout(int messageTimeout)
          Set the TConnection timeout for waiting for the first byte of a new message.
 void startListening()
           
 void stopListening()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MmsServerSAP

public MmsServerSAP(int port,
                    int backlog,
                    java.net.InetAddress bindAddr,
                    AccessPoint accessPoint,
                    javax.net.ServerSocketFactory serverSocketFactory,
                    SAPStopListener sapStopListener)
Create an MMSServerSAP with a ServerSocketFactory. The ServerSocketFactory could be used to create SSLServerSockets.

Parameters:
port - local port
backlog - when 0 default value is used
bindAddr - local ip address to bind to, pass null to bind to all
accessPoint - the associated AccessPoint (implementing ServerACSI)
serverSocketFactory - the factory class to generate the ServerSocket

MmsServerSAP

public MmsServerSAP()

MmsServerSAP

public MmsServerSAP(int port,
                    int backlog,
                    java.net.InetAddress bindAddr,
                    AccessPoint accessPoint,
                    SAPStopListener sapStopListener)
Create a simple MMSServerSAP.

Parameters:
port - local port
backlog - when 0 default value is used
bindAddr - local ip address to bind to, pass null to bind to all
accessPoint - the associated AccessPoint (implementing ServerACSI)
Method Detail

init

public void init(AccessPoint accessPoint,
                 SAPStopListener sapStopListener,
                 java.util.Properties properties,
                 java.lang.String sapPropName)
          throws ConfigurationException
Specified by:
init in interface SCSMServerSAP
Throws:
ConfigurationException

setMaxTPDUSizeParam

public void setMaxTPDUSizeParam(int maxTPDUSizeParam)
Set the maxTPDUSize. The default maxTPDUSize is 65531 (see RFC 1006). Only use this function if you want to change this.

Parameters:
maxTPDUSizeParam - The maximum length is equal to 2^(maxTPDUSizeParam) octets. Note that the actual TSDU size that can be transfered is equal to TPDUSize-3. Default is 65531 octets (see RFC 1006), 7 <= maxTPDUSizeParam <= 16, needs to be set before listening or connecting

setMaxConnections

public void setMaxConnections(int maxConnections)
Set the maximum number of connections that are allowed in parallel by the Server SAP.

Parameters:
maxConnections - the number of connections allowed (default is 100)

setMessageTimeout

public void setMessageTimeout(int messageTimeout)
                       throws java.net.SocketException
Set the TConnection timeout for waiting for the first byte of a new message. Default is 0 (unlimited)

Parameters:
messageTimeout - in milliseconds
Throws:
java.net.SocketException

setMessageFragmentTimeout

public void setMessageFragmentTimeout(int messageFragmentTimeout)
                               throws java.net.SocketException
Set the TConnection timeout for receiving data once the beginning of a message has been received. Default is 2000 (2seconds)

Parameters:
messageFragmentTimeout - in milliseconds
Throws:
java.net.SocketException

startListening

public void startListening()
                    throws java.io.IOException
Specified by:
startListening in interface SCSMServerSAP
Throws:
java.io.IOException

stopListening

public void stopListening()
Specified by:
stopListening in interface SCSMServerSAP

connectionIndication

public void connectionIndication(org.openiec61850.jmms.iso.acse.AcseAssociation pConnection,
                                 java.nio.ByteBuffer psdu)
Specified by:
connectionIndication in interface org.openiec61850.jmms.iso.acse.AcseAssociationListener

serverStoppedListeningIndication

public void serverStoppedListeningIndication(java.io.IOException e)
Specified by:
serverStoppedListeningIndication in interface org.openiec61850.jmms.iso.acse.AcseAssociationListener