fwRPC
 All Files Functions Variables
fwRPC_common.ctl File Reference

Functions

string fwRPC_common_makeDpName (string dpt, string id)
 
bool fwRPC_common_isValidHdl (anytype rpcHandle)
 
int fwRPC_common_unpackMessage (string message, string &id, string &type, string &targetProject, string &targetName, string &buffer)
 
string fwRPC_common_cleanProjectName (string name)
 
bool fwRPC_dist_isClient (string name)
 
bool fwRPC_dist_isCore (string name)
 
bool fwRPC_dist_isWorker (string name)
 
bool fwRPC_dist_isBroker (string name)
 
bool fwRPC_dist_nameMatches (string name, string tag)
 
string fwRPC_dist_getIdFromName (string name)
 
string fwRPC_dist_buildClientName (bool local, string typeTag, string id)
 
string fwRPC_dist_buildMessage (string type, string project, string name, anytype payload)
 

Variables

const string fwRPC_RBMBX_DPT = "_FwRPC_RB_MBX"
 
const string fwRPC_DPE_VALUE = ":_original.._value"
 
const string fwRPC_DPE_NO_VALUE_STORAGE = ":_original.._last_value_storage_off"
 
const string fwRPC_DP_SEPARATOR = "/"
 
const string fwRPC_DISTMSG_TYPE_REQUEST = "REQ"
 
const string fwRPC_DISTMSG_TYPE_GET_RESULT = "GRES"
 
const string fwRPC_DISTMSG_TYPE_SET_RESULT = "SRES"
 
const string fwRPC_DISTMSG_TYPE_STATUS = "STAT"
 
const string fwRPC_DISTMSG_TYPE_RECOVER = "RCVR"
 
const string fwRPC_DISTMSG_TYPE_REGISTER = "REG"
 
const string fwRPC_DISTMSG_TYPE_ACKNOWLEDGE = "ACK"
 
const string fwRPC_DISTMSG_TYPE_CANCEL = "CNCL"
 
const string fwRPC_DISTMSG_TYPE_LISTSVC = "SVC"
 
const string fwRPC_DISTMSG_TYPE_CONNECT = "ON"
 
const string fwRPC_DISTMSG_TYPE_DISCONNECT = "OFF"
 
const string fwRPC_DISTMSG_TYPE_WORKER_HEARTBEAT = "W_HB"
 
const string fwRPC_DISTMSG_TYPE_WORKER_STATE = "W_ST"
 
const int fwRPC_DISTMSG_REQUEST_HDL = 1
 
const int fwRPC_DISTMSG_REQUEST_FUNC = 2
 
const int fwRPC_DISTMSG_REQUEST_PARAMS = 3
 
const int fwRPC_DISTMSG_REQUEST_TIMEOUT = 4
 
const int fwRPC_DISTMSG_RESULT_HDL = 1
 
const int fwRPC_DISTMSG_RESULT_STATUS = 2
 
const int fwRPC_DISTMSG_RESULT_OUTPUT = 3
 
const int fwRPC_DISTMSG_STATUS_HDL = 1
 
const int fwRPC_DISTMSG_STATUS_STATUS = 2
 
const int fwRPC_DISTMSG_STATUS_CALLBACK = 3
 
const int fwRPC_DISTMSG_RECOVER_HDL = 1
 
const int fwRPC_DISTMSG_RECOVER_CALLBACK = 2
 
const int fwRPC_DISTMSG_WORKER_STATE_ID = 1
 
const int fwRPC_DISTMSG_WORKER_STATE_STATUS = 2
 
const int fwRPC_DISTMSG_WORKER_STATE_JOBS = 3
 
const int fwRPC_DISTMSG_WORKER_STATE_LOCKED = 4
 
const string fwRPC_DIST_TAG_CLIENT = "clnt"
 
const string fwRPC_DIST_TAG_CORE = "core"
 
const string fwRPC_DIST_TAG_WORKER = "work"
 
const string fwRPC_DIST_TAG_LOCAL = "loc"
 
const string fwRPC_DIST_TAG_REMOTE = "rem"
 
const int fwRPC_DIST_NODE_PROJECT = 1
 
const int fwRPC_DIST_NODE_NAME = 2
 
const string fwRPC_DIST_BRKR = "brokermodule"
 

Detailed Description

This library contains commonly used constants and helper functions.

Author
Victor Rodrigues (CERN, BE-ICS-SDS)

Function Documentation

string fwRPC_common_cleanProjectName ( string  name)

Clean a project name, removing the final ':' char if present.

Parameters
name(IN, string) project name to clean
Returns
clean project name
Exceptions
nothing
bool fwRPC_common_isValidHdl ( anytype  rpcHandle)

Check if the given variable is a valid rpc handle or not.

Parameters
rpcHandle(IN, anytype) variable to check
Returns
true if rpcHandle is valid false otherwise
Exceptions
nothing
string fwRPC_common_makeDpName ( string  dpt,
string  id 
)

build DP name from DPT and model ID. Does not check if the DPT exists.

Parameters
dpt(IN, string) DPT
id(IN, string) model id
Returns
resulting DP name
Exceptions
nothing
int fwRPC_common_unpackMessage ( string  message,
string &  id,
string &  type,
string &  targetProject,
string &  targetName,
string &  buffer 
)

Unpack a packed message string.

Parameters
message(IN, string) message to unpack
id(OUT, string) message id
type(OUT, string) message type
targetProject(OUT, string) message targetProject
targetName(OUT, string) message targetName
buffer(OUT, string) message buffer
Returns
0 on success -1 otherwise
Exceptions
nothing
string fwRPC_dist_buildMessage ( string  type,
string  project,
string  name,
anytype  payload 
)

Build a message string to be sent by a client or broker module. Can be used for request or response messages.

Type must be one of the defined fwRPC_DISTMSG_TYPE_*

Parameters
type(IN, string) message type
project(IN, string) message project
name(IN, string) message name
payload(IN, anytype) payload
Returns
formatted message string
Exceptions
nothing
string fwRPC_dist_getIdFromName ( string  name)

Strip the name string to just the unique identifier.

Parameters
name(IN) name to strip
Returns
the unique identifier
Exceptions
nothing
bool fwRPC_dist_isBroker ( string  name)

Check if a given name belongs to a broker.

Parameters
name(IN) name to check
Returns
true if name represents broker false otherwise
Exceptions
nothing
bool fwRPC_dist_isClient ( string  name)

Check if a given name belongs to a client.

Parameters
name(IN, string) name to check
Returns
true if name represents client false otherwise
Exceptions
nothing
bool fwRPC_dist_isCore ( string  name)

Check if a given name belongs to a core.

Parameters
name(IN, string) name to check
Returns
true if name represents core false otherwise
Exceptions
nothing
bool fwRPC_dist_isWorker ( string  name)

Check if a given name belongs to a worker.

Parameters
name(IN, string) name to check
Returns
true if name represents worker false otherwise
Exceptions
nothing
bool fwRPC_dist_nameMatches ( string  name,
string  tag 
)

Check if a given name matches against a given tag.

Parameters
name(IN, string) name to check
tag(IN, string) tag to check
Returns
true if name coincides with the tag false otherwise
Exceptions
nothing

Variable Documentation

const string fwRPC_DIST_BRKR = "brokermodule"

Messages targeted towards brokers should have this as dest. info.

const int fwRPC_DIST_NODE_NAME = 2

Endpoint node information

const int fwRPC_DIST_NODE_PROJECT = 1

Endpoint node information

const string fwRPC_DIST_TAG_CLIENT = "clnt"

Possible client types

const string fwRPC_DIST_TAG_CORE = "core"

Possible client types

const string fwRPC_DIST_TAG_LOCAL = "loc"

Possible locality types

const string fwRPC_DIST_TAG_REMOTE = "rem"

Possible locality types

const string fwRPC_DIST_TAG_WORKER = "work"

Possible client types

const int fwRPC_DISTMSG_RECOVER_CALLBACK = 2

Recover message parameters

const int fwRPC_DISTMSG_RECOVER_HDL = 1

Recover message parameters

const int fwRPC_DISTMSG_REQUEST_FUNC = 2

Request message parameters

const int fwRPC_DISTMSG_REQUEST_HDL = 1

Request message parameters

const int fwRPC_DISTMSG_REQUEST_PARAMS = 3

Request message parameters

const int fwRPC_DISTMSG_REQUEST_TIMEOUT = 4

Request message parameters

const int fwRPC_DISTMSG_RESULT_HDL = 1

Result message parameters

const int fwRPC_DISTMSG_RESULT_OUTPUT = 3

Result message parameters

const int fwRPC_DISTMSG_RESULT_STATUS = 2

Result message parameters

const int fwRPC_DISTMSG_STATUS_CALLBACK = 3

Status message parameters

const int fwRPC_DISTMSG_STATUS_HDL = 1

Status message parameters

const int fwRPC_DISTMSG_STATUS_STATUS = 2

Status message parameters

const string fwRPC_DISTMSG_TYPE_ACKNOWLEDGE = "ACK"

Valid message types

const string fwRPC_DISTMSG_TYPE_CANCEL = "CNCL"

Valid message types

const string fwRPC_DISTMSG_TYPE_CONNECT = "ON"

Valid message types

const string fwRPC_DISTMSG_TYPE_DISCONNECT = "OFF"

Valid message types

const string fwRPC_DISTMSG_TYPE_GET_RESULT = "GRES"

Valid message types

const string fwRPC_DISTMSG_TYPE_LISTSVC = "SVC"

Valid message types

const string fwRPC_DISTMSG_TYPE_RECOVER = "RCVR"

Valid message types

const string fwRPC_DISTMSG_TYPE_REGISTER = "REG"

Valid message types

const string fwRPC_DISTMSG_TYPE_REQUEST = "REQ"

Valid message types

const string fwRPC_DISTMSG_TYPE_SET_RESULT = "SRES"

Valid message types

const string fwRPC_DISTMSG_TYPE_STATUS = "STAT"

Valid message types

const string fwRPC_DISTMSG_TYPE_WORKER_HEARTBEAT = "W_HB"

Valid message types

const string fwRPC_DISTMSG_TYPE_WORKER_STATE = "W_ST"

Valid message types

const int fwRPC_DISTMSG_WORKER_STATE_ID = 1

Worker state message parameters

const int fwRPC_DISTMSG_WORKER_STATE_JOBS = 3

Worker state message parameters

const int fwRPC_DISTMSG_WORKER_STATE_LOCKED = 4

Worker state message parameters

const int fwRPC_DISTMSG_WORKER_STATE_STATUS = 2

Worker state message parameters

const string fwRPC_DP_SEPARATOR = "/"

DP/DPE consts

const string fwRPC_DPE_NO_VALUE_STORAGE = ":_original.._last_value_storage_off"

DP/DPE consts

const string fwRPC_DPE_VALUE = ":_original.._value"

DP/DPE consts

const string fwRPC_RBMBX_DPT = "_FwRPC_RB_MBX"

DP/DPE consts