Package org.jgroups.demos
Class StompChat
- java.lang.Object
-
- org.jgroups.demos.StompChat
-
- All Implemented Interfaces:
StompConnection.Listener
public class StompChat extends java.lang.Object implements StompConnection.Listener
Chat client using STOMP to talk to other clients
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CLIENT
static java.lang.String
CLIENT_JOINED
static java.lang.String
CLIENT_LEFT
static java.lang.String
CLIENTS
static java.lang.String
CLIENTS_KW
static java.lang.String
DESTINATION
static java.lang.String
ENDPOINTS
static java.lang.String
GET_USERS
static java.lang.String
MESSAGES
protected StompConnection
stomp_client
static java.lang.String
USER
static java.lang.String
USER_JOINED
static java.lang.String
USER_LEFT
protected java.lang.String
username
protected java.util.Set<java.lang.String>
users
static java.lang.String
USERS
static java.lang.String
USERS_KW
static java.lang.String
VIEW
-
Constructor Summary
Constructors Constructor Description StompChat(java.lang.String host, int port, java.lang.String user)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
connect()
static void
main(java.lang.String[] args)
void
onInfo(java.util.Map<java.lang.String,java.lang.String> information)
void
onMessage(java.util.Map<java.lang.String,java.lang.String> headers, byte[] buf, int offset, int length)
protected void
send(java.lang.String msg)
void
sendGetUsers()
protected void
showStatus(java.lang.String msg)
void
start()
-
-
-
Field Detail
-
username
protected java.lang.String username
-
users
protected final java.util.Set<java.lang.String> users
-
stomp_client
protected StompConnection stomp_client
-
MESSAGES
public static final java.lang.String MESSAGES
- See Also:
- Constant Field Values
-
CLIENT_JOINED
public static final java.lang.String CLIENT_JOINED
- See Also:
- Constant Field Values
-
CLIENT_LEFT
public static final java.lang.String CLIENT_LEFT
- See Also:
- Constant Field Values
-
CLIENTS
public static final java.lang.String CLIENTS
- See Also:
- Constant Field Values
-
USER_JOINED
public static final java.lang.String USER_JOINED
- See Also:
- Constant Field Values
-
USER_LEFT
public static final java.lang.String USER_LEFT
- See Also:
- Constant Field Values
-
GET_USERS
public static final java.lang.String GET_USERS
- See Also:
- Constant Field Values
-
USERS
public static final java.lang.String USERS
- See Also:
- Constant Field Values
-
ENDPOINTS
public static final java.lang.String ENDPOINTS
- See Also:
- Constant Field Values
-
VIEW
public static final java.lang.String VIEW
- See Also:
- Constant Field Values
-
CLIENTS_KW
public static final java.lang.String CLIENTS_KW
- See Also:
- Constant Field Values
-
DESTINATION
public static final java.lang.String DESTINATION
- See Also:
- Constant Field Values
-
USER
public static final java.lang.String USER
- See Also:
- Constant Field Values
-
USERS_KW
public static final java.lang.String USERS_KW
- See Also:
- Constant Field Values
-
CLIENT
public static final java.lang.String CLIENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
start
public void start() throws java.lang.Exception
- Throws:
java.lang.Exception
-
connect
protected void connect() throws java.lang.Exception
- Throws:
java.lang.Exception
-
send
protected void send(java.lang.String msg)
-
sendGetUsers
public void sendGetUsers()
-
showStatus
protected void showStatus(java.lang.String msg)
-
onInfo
public void onInfo(java.util.Map<java.lang.String,java.lang.String> information)
- Specified by:
onInfo
in interfaceStompConnection.Listener
-
onMessage
public void onMessage(java.util.Map<java.lang.String,java.lang.String> headers, byte[] buf, int offset, int length)
- Specified by:
onMessage
in interfaceStompConnection.Listener
-
-