public interface Publisher extends DispatchableEntity<PublisherEvent.Type,PublisherEvent>
Publisher instance is used to publish data to a projects. This can be retrieved directly from
the SDK or from a Project that is connected.SDK#createPublisher(com.sybase.esp.sdk.Uri, com.sybase.esp.sdk.Credentials, PublisherOptions),
Project.createPublisher(PublisherOptions)| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
closeNow() |
void |
commit()
Issues a commit to the project which causes the project to process all its queued data and store it
in its logs.
|
void |
connect()
Connect to the project.
|
void |
disconnect()
Disconnect the publisher.
|
MessageWriter |
getMessageWriter(Stream stream)
Retrieve a
MessageWriter that can be used to format messages to publish to the
specified stream. |
MessageWriter |
getMessageWriter(java.lang.String streamName)
Retrieve a
MessageWriter that can be used to format messages to publish to the
specified stream. |
PublisherOptions |
getOptions() |
Project |
getProject()
Retrieve the
Project instance for the project this publisher is connected to. |
RawMessageWriter |
getRawMessageWriter()
Retrieve a
RawMessageWriter that can be used to publish preformatted
binary data to the project |
boolean |
isClosed() |
void |
publish(Publishable publishable)
If there is no internal publishing thread running, this call publishes all data queued in the
MessageWriter to the socket.
|
void |
sendHeartbeat()
Sends a heartbeat message to the connected engine on this publishers socket.
|
deregisterSelection, dispatch, removeCallback, selectWith, setCallback, updatevoid connect()
throws java.io.IOException,
javax.security.auth.login.LoginException
PublisherEvent.Type.CONNECTED event is sent.java.io.IOExceptionjavax.security.auth.login.LoginExceptionvoid disconnect()
throws java.io.IOException
PublisherEvent.Type.DISCONNECTED event is sent.java.io.IOExceptionjavax.security.auth.login.LoginExceptionvoid close()
throws java.io.IOException
java.io.IOExceptionvoid closeNow()
throws java.io.IOException
java.io.IOExceptionboolean isClosed()
Project getProject()
Project instance for the project this publisher is connected to.ProjectPublisherOptions getOptions()
MessageWriter getMessageWriter(Stream stream) throws java.io.IOException
MessageWriter that can be used to format messages to publish to the
specified stream.stream - java.io.IOExceptionMessageWriter getMessageWriter(java.lang.String streamName) throws java.io.IOException
MessageWriter that can be used to format messages to publish to the
specified stream. Note this method internally retrieves a Stream object which
is a costly operation. If possible use the alternate method getMessageWriter(Stream).streamName - java.io.IOExceptionRawMessageWriter getRawMessageWriter()
RawMessageWriter that can be used to publish preformatted
binary data to the projectRawMessageWritervoid publish(Publishable publishable) throws java.io.IOException
publishable - java.io.IOExceptionvoid commit()
throws java.io.IOException
java.io.IOExceptionvoid sendHeartbeat()
throws java.io.IOException
java.io.IOException