public final class ServerSap
extends java.lang.Object
ServerSap
class represents the IEC 61850 service access point for server
applications. It corresponds to the AccessPoint defined in the ICD/SCL file. A server application
that is to listen for client connections should first get an instance of ServerSap
using the static function ServerSap.getSapsFromSclFile(). Next all the necessary configuration
parameters can be set. Finally the startListening
function is called to listen for
client associations. Changing properties of a ServerSap after starting to listen is not
recommended and has unknown effects.Constructor | Description |
---|---|
ServerSap(int port,
int backlog,
java.net.InetAddress bindAddr,
ServerModel serverModel,
javax.net.ServerSocketFactory serverSocketFactory) |
Creates a ServerSap.
|
Modifier and Type | Method | Description |
---|---|---|
int |
getBacklog() |
|
java.net.InetAddress |
getBindAddress() |
|
int |
getMaxMmsPduSize() |
Gets the maximum MMS PDU size.
|
ServerModel |
getModelCopy() |
|
int |
getPort() |
|
int |
getProposedDataStructureNestingLevel() |
Gets the ProposedDataStructureNestingLevel parameter.
|
int |
getProposedMaxServOutstandingCalled() |
Gets the ProposedMaxServOutstandingCalled parameter.
|
int |
getProposedMaxServOutstandingCalling() |
Gets the ProposedMaxServOutstandingCalling parameter.
|
byte[] |
getServicesSupportedCalled() |
Gets the ServicesSupportedCalled parameter.
|
void |
setBacklog(int backlog) |
Sets the maximum queue length for incoming connection indications (a request to connect) is set
to the backlog parameter.
|
void |
setBindAddress(java.net.InetAddress bindAddr) |
Sets the local IP address to bind to, pass null to bind to all
|
void |
setMaxAssociations(int maxAssociations) |
Set the maximum number of associations that are allowed in parallel by the server.
|
void |
setMaxMmsPduSize(int size) |
Sets the maximum MMS PDU size in bytes that the server will support.
|
void |
setMessageFragmentTimeout(int timeout) |
Sets the message fragment timeout.
|
void |
setPort(int port) |
Sets local port to listen on for new connections.
|
void |
setProposedDataStructureNestingLevel(int nestingLevel) |
Sets the ProposedDataStructureNestingLevel parameter.
|
void |
setProposedMaxServOutstandingCalled(int maxCalled) |
Sets the ProposedMaxServOutstandingCalled parameter.The given parameter has no affect on the
functionality of this server.
|
void |
setProposedMaxServOutstandingCalling(int maxCalling) |
Sets the ProposedMaxServOutstandingCalling parameter.
|
void |
setServerSocketFactory(javax.net.ServerSocketFactory serverSocketFactory) |
Sets the factory class to generate the ServerSocket.
|
void |
setServicesSupportedCalled(byte[] services) |
Sets the SevicesSupportedCalled parameter.
|
void |
setValues(java.util.List<BasicDataAttribute> bdas) |
|
void |
startListening(ServerEventListener serverEventListener) |
Creates a server socket waiting on the configured port for incoming association requests.
|
void |
stop() |
Stops listening for new connections and closes all existing connections/associations.
|
public ServerSap(int port, int backlog, java.net.InetAddress bindAddr, ServerModel serverModel, javax.net.ServerSocketFactory serverSocketFactory)
port
- local port to listen on for new connectionsbacklog
- The maximum queue length for incoming connection indications (a request to
connect) is set to the backlog parameter. If a connection indication arrives when the queue
is full, the connection is refused. Set to 0 or less for the default value.bindAddr
- local IP address to bind to, pass null to bind to allserverModel
- the server modelserverSocketFactory
- the factory class to generate the ServerSocket. Could be used to
create SSLServerSockets. null = defaultpublic int getPort()
public void setPort(int port)
port
- local port to listen on for new connectionspublic int getBacklog()
public void setBacklog(int backlog)
backlog
- the maximum queue length for incoming connections.public java.net.InetAddress getBindAddress()
public void setBindAddress(java.net.InetAddress bindAddr)
bindAddr
- the local IP address to bind topublic void setServerSocketFactory(javax.net.ServerSocketFactory serverSocketFactory)
null
to use ServerSocketFactory.getDefault()
.serverSocketFactory
- the factory class to generate the ServerSocket.public int getMaxMmsPduSize()
public void setMaxMmsPduSize(int size)
size
- cannot be less than 64. The upper limit is 65000 so that segmentation at the lower
transport layer is avoided. The Transport Layer's maximum PDU size is 65531.public void setMaxAssociations(int maxAssociations)
maxAssociations
- the number of associations allowed (default is 100)public void setMessageFragmentTimeout(int timeout)
timeout
- the message fragment timeout in milliseconds. The default is 60000.public int getProposedMaxServOutstandingCalling()
public void setProposedMaxServOutstandingCalling(int maxCalling)
maxCalling
- the ProposedMaxServOutstandingCalling parameter. The default is 5.public int getProposedMaxServOutstandingCalled()
public void setProposedMaxServOutstandingCalled(int maxCalled)
maxCalled
- the ProposedMaxServOutstandingCalled parameter. The default is 5.public int getProposedDataStructureNestingLevel()
public void setProposedDataStructureNestingLevel(int nestingLevel)
nestingLevel
- the ProposedDataStructureNestingLevel parameter. The default is 10.public byte[] getServicesSupportedCalled()
public void setServicesSupportedCalled(byte[] services)
services
- the ServicesSupportedCalled parameterpublic void startListening(ServerEventListener serverEventListener) throws java.io.IOException
serverEventListener
- the listener that is notified of incoming writes and when the server
stopped listening for new connections.java.io.IOException
- if an error occurs binding to the port.public void stop()
public ServerModel getModelCopy()
public void setValues(java.util.List<BasicDataAttribute> bdas)