public interface AtmosphereStompAdapter
This interface adapts all the operations sent to atmosphere using the STOMP protocol. The purpose is to map existing Atmosphere features to the actions that could be performed with several STOMP frames.
Any method of this interface should be invoked when a frame has been validated. Consequently, implementation could
assert that all mandatory Strings will be specified in parameter when declared in method signature.
| Modifier and Type | Method and Description |
|---|---|
void |
abort(org.atmosphere.cpr.AtmosphereResource atmosphereResource,
Map<String,String> Strings)
Aborts a transaction began by the given
AtmosphereResource. |
void |
begin(org.atmosphere.cpr.AtmosphereResource atmosphereResource)
Begins a transaction for the given
AtmosphereResource. |
void |
commit(org.atmosphere.cpr.AtmosphereResource atmosphereResource,
Map<String,String> Strings)
Commits a transaction started by the given
AtmosphereResource. |
void |
send(org.atmosphere.cpr.AtmosphereResource atmosphereResource,
Map<String,String> Strings,
String body,
org.atmosphere.cpr.AtmosphereFramework framework)
Invokes the method annotated with
StompService inside any
ManagedService that defines a destination that matched the destination
String inside the specified Strings. |
void |
subscribe(org.atmosphere.cpr.AtmosphereResource atmosphereResource,
Map<String,String> Strings,
org.atmosphere.cpr.AtmosphereFramework framework)
Adds the given
AtmosphereResource to the Broadcaster identified with the path
specified in the given Strings. |
void |
unsubscribe(org.atmosphere.cpr.AtmosphereResource atmosphereResource,
Map<String,String> Strings,
org.atmosphere.cpr.AtmosphereFramework framework)
Removes the given
AtmosphereResource from the Broadcaster identified with the
path specified in the given Strings. |
void subscribe(org.atmosphere.cpr.AtmosphereResource atmosphereResource,
Map<String,String> Strings,
org.atmosphere.cpr.AtmosphereFramework framework)
throws IOException
Adds the given AtmosphereResource to the Broadcaster identified with the path
specified in the given Strings. The AtmosphereResource lifecycle is then delegated
to the Broadcaster used by the Atmosphere framework.
atmosphereResource - the AtmosphereResource that sent the subscription frameStrings - the Strings extracted from the message that contain the destination pathframework - the AtmosphereFrameworkIOException - if request can't be processedBroadcaster.addAtmosphereResource(org.atmosphere.cpr.AtmosphereResource)void unsubscribe(org.atmosphere.cpr.AtmosphereResource atmosphereResource,
Map<String,String> Strings,
org.atmosphere.cpr.AtmosphereFramework framework)
throws IOException
Removes the given AtmosphereResource from the Broadcaster identified with the
path specified in the given Strings.
atmosphereResource - the AtmosphereResource that sent the unsubscription frameStrings - the Strings extracted from the message that contain the destination pathframework - the AtmosphereFrameworkIOException - if request can't be processedBroadcaster.removeAtmosphereResource(org.atmosphere.cpr.AtmosphereResource)void send(org.atmosphere.cpr.AtmosphereResource atmosphereResource,
Map<String,String> Strings,
String body,
org.atmosphere.cpr.AtmosphereFramework framework)
throws IOException
Invokes the method annotated with StompService inside any
ManagedService that defines a destination that matched the destination
String inside the specified Strings.
The result of the method invocation is dispatched by the Broadcaster identified with
the path specified in the given Strings. If no annotated method matches the requested send,
then the body is dispatched. Original body or result are sent in a Action.MESSAGE
frame. Finally, if the method invocation throws an exception, then an Action.ERROR
is sent only to the specified AtmosphereResource that sent the frame.
Note that Broadcaster must not do anything if a transaction has been started by the
AtmosphereResource and if this transaction is referenced in frame's Strings.
atmosphereResource - the atmosphere resource that sent the sendStrings - the Strings extracted from the message that contain the destination path and optionally a transaction IDbody - the body extracted from the frameframework - the AtmosphereFrameworkIOException - if request can't be processedbegin(org.atmosphere.cpr.AtmosphereResource)void begin(org.atmosphere.cpr.AtmosphereResource atmosphereResource)
Begins a transaction for the given AtmosphereResource.
A transaction ID is generated that could be specified in future Action.SEND
to include their result in the transaction.
In that case, all send(org.atmosphere.cpr.AtmosphereResource, java.util.Map, String, AtmosphereFramework)
operation results won't be dispatched by the Broadcaster until the AtmosphereResource
sends a commit frame for the associated transaction ID.
atmosphereResource - the AtmosphereResource that begins the transactionvoid commit(org.atmosphere.cpr.AtmosphereResource atmosphereResource,
Map<String,String> Strings)
Commits a transaction started by the given AtmosphereResource.
All send(org.atmosphere.cpr.AtmosphereResource, java.util.Map, String, AtmosphereFramework) operation results
associated to the transaction ID specified in Strings are dispatched by the Broadcaster.
atmosphereResource - the AtmosphereResource that begins the transactionStrings - the Strings that contain the transaction IDvoid abort(org.atmosphere.cpr.AtmosphereResource atmosphereResource,
Map<String,String> Strings)
Aborts a transaction began by the given AtmosphereResource.
All send(org.atmosphere.cpr.AtmosphereResource, java.util.Map, String, AtmosphereFramework) operations
results associated to the transaction ID specified inside the given Strings are erased.
atmosphereResource - the AtmosphereResource that aborts the transactionStrings - the Strings that contain the transaction IDCopyright © 2014. All Rights Reserved.