public final class PushStream extends Object implements CommandStream
| Modifier and Type | Class and Description |
|---|---|
static class |
PushStream.StreamMessage |
| Constructor and Description |
|---|
PushStream() |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(CommandHandler handler)
Registers a listening
CommandHandler to the stream. |
void |
close()
Closes this stream.
|
List<Command> |
getCommands()
Returns the
List of commands that were written into this stream. |
List<PushStream.StreamMessage> |
getWarnings() |
void |
signalError(String message)
Signal an error to the attached
CommandHandler. |
void |
warn(PushStream.StreamMessage warning) |
void |
write(Command command) |
public void addHandler(CommandHandler handler)
CommandStreamCommandHandler to the stream. The CommandHandler will be notified for every new Command
pushed to this stream.addHandler in interface CommandStreamhandler - the handler to attach to this streampublic List<Command> getCommands()
CommandStreamList of commands that were written into this stream.getCommands in interface CommandStreampublic List<PushStream.StreamMessage> getWarnings()
public void write(Command command)
public void signalError(String message)
CommandHandler.message - the error messageUnsupportedOperationException - if the stream has been closedpublic void close()
UnsupportedOperationException - if the stream has already been closedpublic void warn(PushStream.StreamMessage warning)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.