org.openmuc.openiec61850
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.Modifier and Type | Method and Description |
---|---|
int |
getBacklog() |
java.net.InetAddress |
getBindAddress() |
int |
getMaxMmsPduSize()
Gets the maximum MMS PDU size.
|
ServerModel |
getModelCopy() |
java.lang.String |
getName()
Returns the name of the ServerSap / AccessPoint as specified in the SCL file.
|
int |
getPort() |
int |
getProposedDataStructureNestingLevel()
Gets the ProposedDataStructureNestingLevel parameter.
|
int |
getProposedMaxServOutstandingCalled()
Gets the ProposedMaxServOutstandingCalled parameter.
|
int |
getProposedMaxServOutstandingCalling()
Gets the ProposedMaxServOutstandingCalling parameter.
|
static java.util.List<ServerSap> |
getSapsFromSclFile(java.lang.String sclFilePath) |
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 static java.util.List<ServerSap> getSapsFromSclFile(java.lang.String sclFilePath) throws SclParseException
SclParseException
public void setPort(int port)
port
- local port to listen on for new connectionspublic int getPort()
public void setBacklog(int backlog)
backlog
- the maximum queue length for incoming connections.public int getBacklog()
public void setBindAddress(java.net.InetAddress bindAddr)
bindAddr
- the local IP address to bind topublic java.net.InetAddress getBindAddress()
public java.lang.String getName()
public void setServerSocketFactory(javax.net.ServerSocketFactory serverSocketFactory)
null
to use ServerSocketFactory.getDefault()
.serverSocketFactory
- the factory class to generate the ServerSocket.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 int getMaxMmsPduSize()
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 void setProposedMaxServOutstandingCalling(int maxCalling)
maxCalling
- the ProposedMaxServOutstandingCalling parameter. The default is 5.public int getProposedMaxServOutstandingCalling()
public void setProposedMaxServOutstandingCalled(int maxCalled)
maxCalled
- the ProposedMaxServOutstandingCalled parameter. The default is 5.public int getProposedMaxServOutstandingCalled()
public void setProposedDataStructureNestingLevel(int nestingLevel)
nestingLevel
- the ProposedDataStructureNestingLevel parameter. The default is 10.public int getProposedDataStructureNestingLevel()
public void setServicesSupportedCalled(byte[] services)
services
- the ServicesSupportedCalled parameterpublic byte[] getServicesSupportedCalled()
public 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)