org.openmuc.josistack

## Class ServerAcseSap

- java.lang.Object
- - org.openmuc.josistack.ServerAcseSap

All Implemented Interfaces:
  org.openmuc.jositransport.TConnectionListener

    public final class ServerAcseSap
    extends java.lang.Object
    implements org.openmuc.jositransport.TConnectionListener

This class implements the server Service Access Point (SAP) for the Application Control Service Element (ACSE) protocol as defined by ISO 8650 or ITU X.217/X.227. The ACSE provides services for establishing and releasing application-associations. The class also realizes the lower ISO Presentation Layer as defined by ISO 8823/ITU X226 and the ISO Session Layer as defined by 8327/ITU X.225.

### Field Summary

Fields
`byte[]` `pSelLocal`
`org.openmuc.jositransport.ServerTSap` `serverTSap`

### Constructor Summary

Constructors
Constructor and Description
`ServerAcseSap(int port, int backlog, java.net.InetAddress bindAddr, AcseAssociationListener associationListener)` Use this constructor to create a server ACSE SAP that listens on a fixed port.
`ServerAcseSap(int port, int backlog, java.net.InetAddress bindAddr, AcseAssociationListener associationListener, javax.net.ServerSocketFactory serverSocketFactory)` Use this constructor to create a server ACSE SAP that listens on a fixed port.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `connectionIndication(org.openmuc.jositransport.TConnection tConnection)` This function is internal and should not be called by users of this class.
`void` `serverStoppedListeningIndication(java.io.IOException e)` This function is internal and should not be called by users of this class.
`void` `startListening()` Start listening for incoming connections.
`void` `stopListening()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### serverTSap

    public org.openmuc.jositransport.ServerTSap serverTSap

#### pSelLocal

    public byte[] pSelLocal

### Constructor Detail

#### ServerAcseSap

    public ServerAcseSap(int port,
                         int backlog,
                         java.net.InetAddress bindAddr,
                         AcseAssociationListener associationListener)

Use this constructor to create a server ACSE SAP that listens on a fixed port.

Parameters:
  `port` - the local port listen on
  `backlog` - the backlog
  `bindAddr` - the InetAddress to bind to
  `associationListener` - the AssociationListener that will be notified when remote clients have associated. Once constructed the AcseSAP contains a public TSAP that can be accessed to set its configuration.

#### ServerAcseSap

    public ServerAcseSap(int port,
                         int backlog,
                         java.net.InetAddress bindAddr,
                         AcseAssociationListener associationListener,
                         javax.net.ServerSocketFactory serverSocketFactory)

Use this constructor to create a server ACSE SAP that listens on a fixed port. The server socket is created with the given socket factory.

Parameters:
  `port` - the local port listen on
  `backlog` - the backlog
  `bindAddr` - the InetAddress to bind to
  `associationListener` - the AssociationListener that will be notified when remote clients have associated. Once constructed the AcseSAP contains a public TSAP that can be accessed to set its configuration.
  `serverSocketFactory` - the server socket factory to create the socket

### Method Detail

#### startListening

    public void startListening()
                        throws java.io.IOException

Start listening for incoming connections. Only for server SAPs.

Throws:
  `java.io.IOException` - if an error occures starting to listen

#### stopListening

    public void stopListening()

#### serverStoppedListeningIndication

    public void serverStoppedListeningIndication(java.io.IOException e)

This function is internal and should not be called by users of this class.

Specified by:
  `serverStoppedListeningIndication` in interface `org.openmuc.jositransport.TConnectionListener`

#### connectionIndication

    public void connectionIndication(org.openmuc.jositransport.TConnection tConnection)

This function is internal and should not be called by users of this class.

Specified by:
  `connectionIndication` in interface `org.openmuc.jositransport.TConnectionListener`