62 lines
1.8 KiB
Java
62 lines
1.8 KiB
Java
/*
|
|
* Copyright (c) 2011 Tony Garnock-Jones. All rights reserved.
|
|
*/
|
|
|
|
package hop;
|
|
|
|
/**
|
|
*/
|
|
public class SexpMessage {
|
|
public static SexpBytes _post = new SexpBytes("post".getBytes());
|
|
public static SexpBytes _subscribe = new SexpBytes("subscribe".getBytes());
|
|
public static SexpBytes _unsubscribe = new SexpBytes("unsubscribe".getBytes());
|
|
public static SexpBytes _subscribe_ok = new SexpBytes("subscribe-ok".getBytes());
|
|
public static SexpBytes _create = new SexpBytes("create".getBytes());
|
|
public static SexpBytes _create_ok = new SexpBytes("create-ok".getBytes());
|
|
public static SexpBytes _create_failed = new SexpBytes("create-failed".getBytes());
|
|
|
|
public static SexpList post(Object name, Object message, Object token) {
|
|
SexpList m = new SexpList();
|
|
m.add(_post);
|
|
m.add(name);
|
|
m.add(message);
|
|
m.add(token);
|
|
return m;
|
|
}
|
|
|
|
public static SexpList subscribe(Object filter, String sink, Object name, String replySink, Object replyName) {
|
|
SexpList m = new SexpList();
|
|
m.add(_subscribe);
|
|
m.add(filter);
|
|
m.add(sink);
|
|
m.add(name);
|
|
m.add(replySink);
|
|
m.add(replyName);
|
|
return m;
|
|
}
|
|
|
|
public static SexpList subscribe_ok(Object token) {
|
|
SexpList m = new SexpList();
|
|
m.add(_subscribe_ok);
|
|
m.add(token);
|
|
return m;
|
|
}
|
|
|
|
public static SexpList unsubscribe(Object token) {
|
|
SexpList m = new SexpList();
|
|
m.add(_unsubscribe);
|
|
m.add(token);
|
|
return m;
|
|
}
|
|
|
|
public static SexpList create(String nodeClassName, Object arg, String replySink, Object replyName) {
|
|
SexpList m = new SexpList();
|
|
m.add(_create);
|
|
m.add(nodeClassName);
|
|
m.add(arg);
|
|
m.add(replySink);
|
|
m.add(replyName);
|
|
return m;
|
|
}
|
|
}
|