public final class ClientSap
extends java.lang.Object
ClientSap
class represents the IEC 61850 service access point for client
applications. A client application that wants to connect to a server should first create an
instance of ClientSap
. Next all the necessary configuration parameters can be set.
Finally the associate
function is called to connect to the server. An instance of
ClientSap
can be used to create an unlimited number of associations. Changing the
parameters of a ClientSap has no affect on associations that have already been created.Constructor | Description |
---|---|
ClientSap() |
Use this constructor to create a default client SAP.
|
ClientSap(javax.net.SocketFactory socketFactory) |
Use this constructor to create a client SAP that uses the given
SocketFactory to
connect to servers. |
Modifier and Type | Method | Description |
---|---|---|
ClientAssociation |
associate(java.net.InetAddress address,
int port,
java.lang.String authenticationParameter,
ClientEventListener reportListener) |
Connects to the IEC 61850 MMS server at the given address and port and returns the resulting
association object.
|
ClientAssociation |
associate(java.net.InetAddress address,
int port,
java.lang.String authenticationParameter,
java.net.InetAddress localAddr,
int localPort,
ClientEventListener reportListener) |
Connects to the IEC 61850 MMS server at the given address and port and returns the resulting
association object.
|
int |
getMaxMmsPduSize() |
Gets the maximum MMS PDU size.
|
byte[] |
getServicesSupportedCalling() |
Gets the ServicesSupportedCalling parameter.
|
void |
setAeQualifierCalled(int qualifier) |
Sets the remote/called Application Entity Qualifier.
|
void |
setAeQualifierCalling(int qualifier) |
Sets the local/calling Application Entity Qualifier.
|
void |
setApTitleCalled(int[] title) |
Sets the remote/called Application Process Title.
|
void |
setApTitleCalling(int[] title) |
Sets the local/calling Application Process Title.
|
void |
setMaxMmsPduSize(int size) |
Sets the maximum MMS PDU size in bytes that the client association will support.
|
void |
setMaxTPduSizeParameter(int maxTPduSizeParam) |
Set the maxTPDUSize.
|
void |
setMessageFragmentTimeout(int timeout) |
Sets the message fragment timeout.
|
void |
setPSelLocal(byte[] pSelLocal) |
Sets the local/calling Presentation-Selector (P-SEL).
|
void |
setPSelRemote(byte[] pSelRemote) |
Sets the remote/called Presentation-Selector (P-SEL).
|
void |
setResponseTimeout(int timeout) |
Sets the default response timeout of the
ClientAssociation that is created using
this ClientSap. |
void |
setServicesSupportedCalling(byte[] services) |
Sets the SevicesSupportedCalling parameter.
|
void |
setSSelLocal(byte[] sSelLocal) |
Sets the local/calling Session-Selector (S-SEL).
|
void |
setSSelRemote(byte[] sSelRemote) |
Sets the remote/called Session-Selector (S-SEL).
|
void |
setTSelLocal(byte[] tSelLocal) |
Sets the local/calling Transport-Selector (T-SEL).
|
void |
setTSelRemote(byte[] tSelRemote) |
Sets the remote/called Transport-Selector (T-SEL).
|
public ClientSap()
public ClientSap(javax.net.SocketFactory socketFactory)
SocketFactory
to
connect to servers. You could pass an SSLSocketFactory to enable SSL.socketFactory
- the socket factory to construct the socketpublic 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 byte[] getServicesSupportedCalling()
public void setServicesSupportedCalling(byte[] services)
services
- the ServicesSupportedCalling parameterpublic void setSSelRemote(byte[] sSelRemote)
sSelRemote
- the remote/called S-SEL.public void setSSelLocal(byte[] sSelLocal)
sSelLocal
- the local/calling S-SEL.public void setPSelRemote(byte[] pSelRemote)
pSelRemote
- the remote/called P-SEL.public void setPSelLocal(byte[] pSelLocal)
pSelLocal
- the local/calling P-SEL.public void setTSelRemote(byte[] tSelRemote)
tSelRemote
- the remote/called T-SEL. If null the T-SEL will be omitted. No maximum size
is defined by the standard.public void setTSelLocal(byte[] tSelLocal)
tSelLocal
- the local/calling T-SEL. If null the T-SEL will be omitted. No maximum size is
defined by the standard.public void setMaxTPduSizeParameter(int maxTPduSizeParam)
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
connectingpublic void setApTitleCalled(int[] title)
title
- the remote/called AP title.public void setApTitleCalling(int[] title)
title
- the local/calling AP title.public void setAeQualifierCalled(int qualifier)
qualifier
- the remote/called AE Qualifierpublic void setAeQualifierCalling(int qualifier)
qualifier
- the local/calling AE Qualifierpublic void setResponseTimeout(int timeout)
ClientAssociation
that is created using
this ClientSap.timeout
- the response timeout in milliseconds. The default is 20000.public void setMessageFragmentTimeout(int timeout)
timeout
- the timeout in milliseconds. The default is 10000.public ClientAssociation associate(java.net.InetAddress address, int port, java.lang.String authenticationParameter, ClientEventListener reportListener) throws java.io.IOException
address
- the address to connect to.port
- the port to connect to. Usually the MMS port is 102.authenticationParameter
- an optional authentication parameters that is transmitted. It
will be omitted if equal to null.reportListener
- the listener to be notified of incoming reportsjava.io.IOException
- if any kind of error occurs trying build up the associationpublic ClientAssociation associate(java.net.InetAddress address, int port, java.lang.String authenticationParameter, java.net.InetAddress localAddr, int localPort, ClientEventListener reportListener) throws java.io.IOException
address
- the address to connect toport
- the port to connect to. Usually the MMS port is 102.authenticationParameter
- an optional authentication parameters that is transmitted. It
will be omitted if equal to null.localAddr
- the local address to uselocalPort
- the local port to usereportListener
- the listener to be notified of incoming reportsjava.io.IOException
- if any kind of error occurs trying build up the association