public final class EtpServer extends Object
Constructor and Description |
---|
EtpServer(URI uri,
String userName,
String password)
Create an ETP server instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addAccessListener(EtpAccessListener accessListener)
Add general listener for messages sent over the web socket.
|
boolean |
equals(Object object) |
String |
generateId(String witsmlType,
String name,
WitsmlObject parent) |
String |
getPassword()
Return password of the web socket session.
|
EtpServerCapabilities |
getServerCapabilities()
Return server capabilities.
|
URI |
getUri()
Return URI of the ETP server.
|
String |
getUserName()
Return user name of the web socket session.
|
int |
hashCode() |
EtpSession |
newReadSession()
Create a new binary ETP communication session.
|
EtpSession |
newReadSession(EtpEncoding encoding)
Create a new ETP communication session.
|
EtpSession |
newWriteSession() |
EtpSession |
newWriteSession(EtpEncoding encoding) |
void |
removeAccessListener(EtpAccessListener accessListener)
Remove ETP access listener.
|
String |
toString() |
public EtpServer(URI uri, String userName, String password)
uri
- URI to ETP server. Non-null.userName
- User name for the session. Non-null.password
- Password for the session. Non-null.IllegalArgumentException
- If any of the arguments are null.public URI getUri()
public String getUserName()
public String getPassword()
public void addAccessListener(EtpAccessListener accessListener)
Listening for access on the web socket is completely optional, but is convenient for logging purposes, statistics etc. The listener will see all messages sent from client or server, and they will contain a time stamp.
accessListener
- Access listener to add. Non-nullIllegalArgumentException
- If accessListener is null.public void removeAccessListener(EtpAccessListener accessListener)
accessListener
- Listener to remove. Non-null.IllegalArgumentException
- If accessListener is null.public EtpServerCapabilities getServerCapabilities() throws IOException
The capabilities are delivered over traditional HTTP/Get so this method is best called in threads to avoid application hang.
IOException
- If the operation failed for some reason.public EtpSession newReadSession(EtpEncoding encoding)
encoding
- Message encoding. JSON or binary.public EtpSession newReadSession()
public EtpSession newWriteSession(EtpEncoding encoding)
public EtpSession newWriteSession()
public String generateId(String witsmlType, String name, WitsmlObject parent)
Copyright © 2023 Petroware AS - https://petroware.no