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")); }
private List<Method> receiveFileMethod(Object handler) { List<Method> methods = new ArrayList<>(); methods.add(new Method(RECEIVE_META_METHOD, "sssl", "ii", handler,"receiveFileMeta") .paramDesc(0, "filereference", "file reference to download") .paramDesc(1, "filename", "filename") .paramDesc(2, "type", "'file' or 'compressed'") .paramDesc(3, "filelength", "length in bytes of file") .returnDesc(0, "ret", "0 if success, 1 otherwise") .returnDesc(1, "session-id", "Session id to be used for this transfer")); methods.add(new Method(RECEIVE_PART_METHOD, "siix", "i", handler,"receiveFilePart") .paramDesc(0, "filereference", "file reference to download") .paramDesc(1, "session-id", "Session id to be used for this transfer") .paramDesc(2, "partid", "relative part number starting at zero") .paramDesc(3, "data", "bytes in this part") .returnDesc(0, "ret", "0 if success, 1 otherwise")); methods.add(new Method(RECEIVE_EOF_METHOD, "silis", "i", handler,"receiveFileEof") .paramDesc(0, "filereference", "file reference to download") .paramDesc(1, "session-id", "Session id to be used for this transfer") .paramDesc(2, "crc-code", "crc code (xxhash64)") .paramDesc(3, "error-code", "Error code. 0 if none") .paramDesc(4, "error-description", "Error description.") .returnDesc(0, "ret", "0 if success, 1 if crc mismatch, 2 otherwise")); return methods; }
m = new Method("frt.rpc.ping", "", "", this, "ping"); m.methodDesc("Method that may be used to " + "check if the server is online"); parent.addMethod(m); m = new Method("frt.rpc.getMethodList", "", "SSS", this, "getMethodList"); m.methodDesc("Obtain a list of all available methods"); parent.addMethod(m); m = new Method("frt.rpc.getMethodInfo", "s", "sssSSSS", this, "getMethodInfo"); m.methodDesc("Obtain detailed information about a single method");
private void registerMethods() { orb.addMethod(new Method("slobrok.registerRpcServer", "ss", "", new MethodHandler() { public void invoke(Request req) { .paramDesc(0, "name", "RpcServer name") .paramDesc(1, "spec", "The connection specification")); orb.addMethod(new Method("slobrok.unregisterRpcServer", "ss", "", new MethodHandler() { public void invoke(Request req) { .paramDesc(1, "spec", "The connection specification")); orb.addMethod(new Method("slobrok.incremental.fetch", "ii", "iSSSi", new MethodHandler() { public void invoke(Request req) {
m_list = new Method("slobrok.callback.listNamesServed", "", "S", new MethodHandler() { public void invoke(Request req) { "The rpcserver names this server wants to serve"); orb.addMethod(m_list); m_unreg = new Method("slobrok.callback.notifyUnregistered", "s", "", new MethodHandler() { public void invoke(Request req) {
@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");
@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
servicePool = new RPCServicePool(this, 4096); Method method = new Method("mbus.getVersion", "", "s", this); method.methodDesc("Retrieves the message bus version."); method.returnDesc(0, "version", "The message bus version.");
addMethod(new Method("vespa.persistence.connect", "s", "", this, "RPC_connect") .paramDesc(0, "buildId", "Id to make sure client and server come from the same build")); addMethod(new PersistenceProviderMethod("initialize", this));