org.cloudi
public class API extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
API.ForwardAsyncException |
static class |
API.ForwardSyncException |
static class |
API.InvalidInputException |
static class |
API.MessageDecodingException |
class |
API.Response |
static class |
API.ReturnAsyncException |
static class |
API.ReturnSyncException |
class |
API.TransId |
| Modifier and Type | Field and Description |
|---|---|
static int |
ASYNC |
static PrintStream |
err |
static PrintStream |
out |
static int |
SYNC |
static byte[] |
TransIdNull |
| Constructor and Description |
|---|
API(int thread_index) |
| Modifier and Type | Method and Description |
|---|---|
void |
forward_(Integer command,
String name,
byte[] request_info,
byte[] request,
Integer timeout,
Byte priority,
byte[] transId,
com.ericsson.otp.erlang.OtpErlangPid pid)
Forward a message to another service
subscribed that matches the destination service
name. |
void |
forward_async(String name,
byte[] request_info,
byte[] request,
Integer timeout,
Byte priority,
byte[] transId,
com.ericsson.otp.erlang.OtpErlangPid pid)
Asynchronously forward a message to another service
subscribed that matches the destination service
name. |
void |
forward_sync(String name,
byte[] request_info,
byte[] request,
Integer timeout,
Byte priority,
byte[] transId,
com.ericsson.otp.erlang.OtpErlangPid pid)
Synchronously forward a message to another service
subscribed that matches the destination service
name. |
HashMap<String,List<String>> |
info_key_value_parse(byte[] info) |
List<API.TransId> |
mcast_async(String name,
byte[] request)
Asynchronous point-multicast communication to services
subscribed that matches the destination service
name. |
List<API.TransId> |
mcast_async(String name,
byte[] request_info,
byte[] request,
Integer timeout,
Byte priority)
Asynchronous point-multicast communication to services
subscribed that matches the destination service
name. |
Object |
poll() |
String |
prefix() |
int |
process_count_max() |
int |
process_count_min() |
int |
process_count() |
int |
process_index() |
API.Response |
recv_async()
Asynchronously receive a response.
|
API.Response |
recv_async(boolean consume)
Asynchronously receive a response.
|
API.Response |
recv_async(byte[] transId)
Asynchronously receive a response.
|
API.Response |
recv_async(byte[] transId,
boolean consume)
Asynchronously receive a response.
|
API.Response |
recv_async(Integer timeout)
Asynchronously receive a response.
|
API.Response |
recv_async(Integer timeout,
boolean consume)
Asynchronously receive a response.
|
API.Response |
recv_async(Integer timeout,
byte[] transId)
Asynchronously receive a response.
|
API.Response |
recv_async(Integer timeout,
byte[] transId,
boolean consume)
Asynchronously receive a response.
|
HashMap<String,List<String>> |
request_http_qs_parse(byte[] request) |
void |
return_(Integer command,
String name,
String pattern,
byte[] response_info,
byte[] response,
Integer timeout,
byte[] transId,
com.ericsson.otp.erlang.OtpErlangPid pid)
Returns a response from a service request.
|
void |
return_async(String name,
String pattern,
byte[] response_info,
byte[] response,
Integer timeout,
byte[] transId,
com.ericsson.otp.erlang.OtpErlangPid pid)
Asynchronously returns a response from a service request.
|
void |
return_sync(String name,
String pattern,
byte[] response_info,
byte[] response,
Integer timeout,
byte[] transId,
com.ericsson.otp.erlang.OtpErlangPid pid)
Synchronously returns a response from a service request.
|
API.TransId |
send_async(String name,
byte[] request)
Asynchronous point-to-point communication to a service
subscribed that matches the destination service
name. |
API.TransId |
send_async(String name,
byte[] request_info,
byte[] request,
Integer timeout,
Byte priority)
Asynchronous point-to-point communication to a service
subscribed that matches the destination service
name. |
API.Response |
send_sync(String name,
byte[] request)
Synchronous point-to-point communication to a service
subscribed that matches the destination service
name. |
API.Response |
send_sync(String name,
byte[] request_info,
byte[] request,
Integer timeout,
Byte priority)
Synchronous point-to-point communication to a service
subscribed that matches the destination service
name. |
void |
subscribe(String pattern,
Object instance,
String methodName)
Subscribes an object method to a service name pattern.
|
static int |
thread_count() |
int |
timeout_async() |
int |
timeout_sync() |
void |
unsubscribe(String pattern)
Unsubscribes from a service name pattern.
|
public static final PrintStream out
public static final PrintStream err
public static final int ASYNC
public static final int SYNC
public static final byte[] TransIdNull
public API(int thread_index)
throws API.InvalidInputException,
API.MessageDecodingException
public static int thread_count()
throws API.InvalidInputException
API.InvalidInputExceptionpublic void subscribe(String pattern, Object instance, String methodName)
pattern - the service name patterninstance - the object instancemethodName - the object method to handle matching requestspublic void unsubscribe(String pattern) throws API.InvalidInputException
pattern - the service name patternAPI.InvalidInputExceptionpublic API.TransId send_async(String name, byte[] request) throws API.MessageDecodingException
name.name - the destination service namerequest - the request dataAPI.MessageDecodingExceptionpublic API.TransId send_async(String name, byte[] request_info, byte[] request, Integer timeout, Byte priority) throws API.MessageDecodingException
name.name - the destination service namerequest_info - any request metadatarequest - the request datatimeout - the request timeout in millisecondspriority - the request priorityAPI.MessageDecodingExceptionpublic API.Response send_sync(String name, byte[] request) throws API.MessageDecodingException
name.name - the destination service namerequest - the request dataAPI.MessageDecodingExceptionpublic API.Response send_sync(String name, byte[] request_info, byte[] request, Integer timeout, Byte priority) throws API.MessageDecodingException
name.name - the destination service namerequest_info - any request metadatarequest - the request datatimeout - the request timeout in millisecondspriority - the request priorityAPI.MessageDecodingExceptionpublic List<API.TransId> mcast_async(String name, byte[] request) throws API.MessageDecodingException
name.name - the destination service namerequest - the request dataAPI.MessageDecodingExceptionpublic List<API.TransId> mcast_async(String name, byte[] request_info, byte[] request, Integer timeout, Byte priority) throws API.MessageDecodingException
name.name - the destination service namerequest_info - any request metadatarequest - the request datatimeout - the request timeout in millisecondspriority - the priority of this requestAPI.MessageDecodingExceptionpublic void forward_(Integer command, String name, byte[] request_info, byte[] request, Integer timeout, Byte priority, byte[] transId, com.ericsson.otp.erlang.OtpErlangPid pid) throws API.ForwardAsyncException, API.ForwardSyncException, API.InvalidInputException
name.command - constant API.SYNC or API.ASYNCname - the destination service namerequest_info - any request metadatarequest - the request datatimeout - the request timeout in millisecondspriority - the priority of this requesttransId - the transaction IDpid - the request's source process IDAPI.ForwardAsyncExceptionAPI.ForwardSyncExceptionAPI.InvalidInputExceptionpublic void forward_async(String name, byte[] request_info, byte[] request, Integer timeout, Byte priority, byte[] transId, com.ericsson.otp.erlang.OtpErlangPid pid) throws API.ForwardAsyncException
name.name - the destination service namerequest_info - any request metadatarequest - the request datatimeout - the request timeout in millisecondspriority - the priority of this requesttransId - the transaction IDpid - the request's source process IDAPI.ForwardAsyncExceptionpublic void forward_sync(String name, byte[] request_info, byte[] request, Integer timeout, Byte priority, byte[] transId, com.ericsson.otp.erlang.OtpErlangPid pid) throws API.ForwardSyncException
name.name - the destination service namerequest_info - any request metadatarequest - the request datatimeout - the request timeout in millisecondspriority - the priority of this requesttransId - the transaction IDpid - the request's source process IDAPI.ForwardSyncExceptionpublic void return_(Integer command, String name, String pattern, byte[] response_info, byte[] response, Integer timeout, byte[] transId, com.ericsson.otp.erlang.OtpErlangPid pid) throws API.ReturnAsyncException, API.ReturnSyncException, API.InvalidInputException
command - constant API.SYNC or API.SYNCname - the service namepattern - the service name patternresponse_info - any response metadataresponse - the response datatimeout - the request timeout in millisecondstransId - the transaction IDpid - the request's source process IDAPI.ReturnAsyncExceptionAPI.ReturnSyncExceptionAPI.InvalidInputExceptionpublic void return_async(String name, String pattern, byte[] response_info, byte[] response, Integer timeout, byte[] transId, com.ericsson.otp.erlang.OtpErlangPid pid) throws API.ReturnAsyncException
name - the service namepattern - the service name patternresponse_info - any response metadataresponse - the response datatimeout - the request timeout in millisecondstransId - the transaction IDpid - the request's source process IDAPI.ReturnAsyncExceptionpublic void return_sync(String name, String pattern, byte[] response_info, byte[] response, Integer timeout, byte[] transId, com.ericsson.otp.erlang.OtpErlangPid pid) throws API.ReturnSyncException
name - the service namepattern - the service name patternresponse_info - any response metadataresponse - the response datatimeout - the request timeout in millisecondstransId - the transaction IDpid - the request's source process IDAPI.ReturnSyncExceptionpublic API.Response recv_async() throws API.MessageDecodingException
API.MessageDecodingExceptionpublic API.Response recv_async(Integer timeout) throws API.MessageDecodingException
timeout - the receive timeout in millisecondsAPI.MessageDecodingExceptionpublic API.Response recv_async(byte[] transId) throws API.MessageDecodingException
transId - the transaction ID to receiveAPI.MessageDecodingExceptionpublic API.Response recv_async(boolean consume) throws API.MessageDecodingException
consume - if true, will consume the service request
so it is not accessible with the same function call in
the futureAPI.MessageDecodingExceptionpublic API.Response recv_async(Integer timeout, byte[] transId) throws API.MessageDecodingException
timeout - the receive timeout in millisecondstransId - the transaction ID to receiveAPI.MessageDecodingExceptionpublic API.Response recv_async(Integer timeout, boolean consume) throws API.MessageDecodingException
timeout - the receive timeout in millisecondsconsume - if true, will consume the service request
so it is not accessible with the same function call in
the futureAPI.MessageDecodingExceptionpublic API.Response recv_async(byte[] transId, boolean consume) throws API.MessageDecodingException
transId - the transaction ID to receiveconsume - if true, will consume the service request
so it is not accessible with the same function call in
the futureAPI.MessageDecodingExceptionpublic API.Response recv_async(Integer timeout, byte[] transId, boolean consume) throws API.MessageDecodingException
timeout - the receive timeout in millisecondstransId - the transaction ID to receiveconsume - if true, will consume the service request
so it is not accessible with the same function call in
the futureAPI.MessageDecodingExceptionpublic int process_index()
public int process_count()
public int process_count_max()
public int process_count_min()
public String prefix()
public int timeout_async()
public int timeout_sync()
public Object poll() throws API.MessageDecodingException
API.MessageDecodingExceptionCopyright © 2014. All Rights Reserved.