private void declareFileDistributionMethods() { // Legacy method, needs to be the same name as used in filedistributor supervisor.addMethod(new Method("waitFor", "s", "s", this, "getFile") .methodDesc("get path to file reference") .paramDesc(0, "file reference", "file reference") .returnDesc(0, "path", "path to file")); supervisor.addMethod(new Method("filedistribution.getFile", "s", "s", this, "getFile") .methodDesc("get path to file reference") .paramDesc(0, "file reference", "file reference") .returnDesc(0, "path", "path to file")); supervisor.addMethod(new Method("filedistribution.getActiveFileReferencesStatus", "", "SD", this, "getActiveFileReferencesStatus") .methodDesc("download status for file references") .returnDesc(0, "file references", "array of file references") .returnDesc(1, "download status", "percentage downloaded of each file reference in above array")); supervisor.addMethod(new Method("filedistribution.setFileReferencesToDownload", "S", "i", this, "setFileReferencesToDownload") .methodDesc("set which file references to download") .paramDesc(0, "file references", "file reference to download") .returnDesc(0, "ret", "0 if success, 1 otherwise")); }
m.methodDesc("Method that may be used to " + "check if the server is online"); parent.addMethod(m); m.methodDesc("Obtain a list of all available methods"); m.returnDesc(0, "names", "Method names"); m.returnDesc(1, "params", "Method parameter types"); m.methodDesc("Obtain detailed information about a single method"); m.paramDesc (0, "methodName", "The method we want information about"); m.returnDesc(0, "desc", "Description of what the method does");
.methodDesc("List rpcserver names") .returnDesc(0, "names", "The rpcserver names this server wants to serve"); .methodDesc("Notify a server about removed registration") .paramDesc(0, "name", "RpcServer name"); orb.addMethod(m_unreg);
.methodDesc("Register a rpcserver") .paramDesc(0, "name", "RpcServer name") .paramDesc(1, "spec", "The connection specification")); .methodDesc("Unregister a rpcserver") .paramDesc(0, "name", "RpcServer name") .paramDesc(1, "spec", "The connection specification")); .methodDesc("Fetch or update mirror of name to spec map") .paramDesc(0, "gencnt", "generation already known by client") .paramDesc(1, "timeout", "How many milliseconds to wait for changes"
@Override protected Method buildMethod() { Method method = new Method(METHOD_NAME, METHOD_PARAMS, METHOD_RETURN, this); method.methodDesc("Send a message bus request and get a reply back."); method.paramDesc(0, "header_encoding", "Encoding type of header.") .paramDesc(1, "header_decodedSize", "Number of bytes after header decoding.") .paramDesc(2, "header_payload", "Slime encoded header payload.") .paramDesc(3, "body_encoding", "Encoding type of body.") .paramDesc(4, "body_decoded_ize", "Number of bytes after body decoding.") .paramDesc(5, "body_payload", "Slime encoded body payload."); method.returnDesc(0, "header_encoding", "Encoding type of header.") .returnDesc(1, "header_decoded_size", "Number of bytes after header decoding.") .returnDesc(2, "header_payload", "Slime encoded header payload.") .returnDesc(3, "body_encoding", "Encoding type of body.") .returnDesc(4, "body_encoded_size", "Number of bytes after body decoding.") .returnDesc(5, "body_payload", "Slime encoded body payload."); return method; } private static final String VERSION_F = new String("version");
public void getMethodInfo(Request req) { Method method = parent.methodMap().get(req.parameters().get(0).asString()); if (method == null) { req.setError(ErrorCode.METHOD_FAILED, "No Such Method"); return; } req.returnValues().add(new StringValue(method.methodDesc())); req.returnValues().add(new StringValue(method.paramTypes())); req.returnValues().add(new StringValue(method.returnTypes())); int paramCnt = method.paramTypes().length(); int returnCnt = method.returnTypes().length(); String[] ret3_paramName = new String[paramCnt]; String[] ret4_paramDesc = new String[paramCnt]; String[] ret5_returnName = new String[returnCnt]; String[] ret6_returnDesc = new String[returnCnt]; for (int i = 0; i < paramCnt; i++) { ret3_paramName[i] = method.paramName(i); ret4_paramDesc[i] = method.paramDesc(i); } for (int i = 0; i < returnCnt; i++) { ret5_returnName[i] = method.returnName(i); ret6_returnDesc[i] = method.returnDesc(i); } req.returnValues().add(new StringArray(ret3_paramName)); req.returnValues().add(new StringArray(ret4_paramDesc)); req.returnValues().add(new StringArray(ret5_returnName)); req.returnValues().add(new StringArray(ret6_returnDesc)); } }
@Override protected Method buildMethod() { Method method = new Method(METHOD_NAME, METHOD_PARAMS, METHOD_RETURN, this); method.methodDesc("Send a message bus request and get a reply back."); method.paramDesc(0, "version", "The version of the message.") .paramDesc(1, "route", "Names of additional hops to visit.") .paramDesc(2, "session", "The local session that should receive this message.") .paramDesc(3, "retryEnabled", "Whether or not this message can be resent.") .paramDesc(4, "retry", "The number of times the sending of this message has been retried.") .paramDesc(5, "timeRemaining", "The number of milliseconds until timeout.") .paramDesc(6, "protocol", "The name of the protocol that knows how to decode this message.") .paramDesc(7, "payload", "The protocol specific message payload.") .paramDesc(8, "level", "The trace level of the message."); method.returnDesc(0, "version", "The lowest version the message was serialized as.") .returnDesc(1, "retryDelay", "The retry request of the reply.") .returnDesc(2, "errorCodes", "The reply error codes.") .returnDesc(3, "errorMessages", "The reply error messages.") .returnDesc(4, "errorServices", "The reply error service names.") .returnDesc(5, "protocol", "The name of the protocol that knows how to decode this reply.") .returnDesc(6, "payload", "The protocol specific reply payload.") .returnDesc(7, "trace", "A string representation of the trace."); return method; } @Override
method.methodDesc("Retrieves the message bus version."); method.returnDesc(0, "version", "The message bus version."); orb.addMethod(method);