Kanzi Connect  3.9.4
Kanzi Connect Java API
MessageUtil Class Reference

Collection of utility functions. More...

Classes

class  ArgumentException
 Exception thrown when invalid message arguments are detected. More...
 

Static Public Member Functions

static boolean addBinaryArg (MessagePackage message, int position, byte [] arg)
 Adds a binary argument to a message. More...
 
static boolean addBinaryVectorArg (MessagePackage message, int position, Vector< byte[]> arg)
 Adds a binary vector argument to message. More...
 
static boolean addBooleanArg (MessagePackage message, int position, boolean arg)
 Adds a boolean argument to a message. More...
 
static boolean addBooleanVectorArg (MessagePackage message, int position, Vector< Boolean > arg)
 Adds a boolean vector argument to message. More...
 
static boolean addFloatArg (MessagePackage message, int position, float arg)
 Adds a Float argument to a message. More...
 
static boolean addFloatVectorArg (MessagePackage message, int position, Vector< Float > arg)
 Adds a float vector argument to message. More...
 
static boolean addIntArg (MessagePackage message, int position, int arg)
 Adds a integer argument to a message. More...
 
static boolean addIntVectorArg (MessagePackage message, int position, Vector< Integer > arg)
 Adds a int vector argument to message. More...
 
static boolean addPackageArg (MessagePackage message, int position, MessagePackage arg)
 Adds a package argument to a message. More...
 
static boolean addPackageVectorArg (MessagePackage message, int position, Vector< MessagePackage > arg)
 Adds a package vector argument to message. More...
 
static boolean addStringArg (MessagePackage message, int position, String arg)
 Adds a string argument to a message. More...
 
static boolean addStringVectorArg (MessagePackage message, int position, Vector< String > arg)
 Adds a string vector argument to message. More...
 
static String eventNameToMessageName (String servicePrefix, String eventName)
 Mangles event name to a message name transferred on wire. More...
 
static byte [] getBinaryArg (MessagePackage message, int position) throws MessageUtil.ArgumentException
 Retrieve binary argument. More...
 
static Vector< byte[]> getBinaryVectorArg (MessagePackage message, int position) throws MessageUtil.ArgumentException
 Retrieve binary vector argument. More...
 
static boolean getBooleanArg (MessagePackage message, int position) throws MessageUtil.ArgumentException
 Retrieve boolean argument. More...
 
static Vector< Boolean > getBooleanVectorArg (MessagePackage message, int position) throws MessageUtil.ArgumentException
 Retrieve boolean vector argument. More...
 
static float getFloatArg (MessagePackage message, int position) throws MessageUtil.ArgumentException
 Retrieve float argument. More...
 
static Vector< Float > getFloatVectorArg (MessagePackage message, int position) throws MessageUtil.ArgumentException
 Retrieve float vector argument. More...
 
static int getIntArg (MessagePackage message, int position) throws MessageUtil.ArgumentException
 Retrieve int argument. More...
 
static Vector< Integer > getIntVectorArg (MessagePackage message, int position) throws MessageUtil.ArgumentException
 Retrieve int vector argument. More...
 
static MessagePackage getPackageArg (MessagePackage message, int position) throws MessageUtil.ArgumentException
 Retrieve package argument. More...
 
static Vector< MessagePackage > getPackageVectorArg (MessagePackage message, int position) throws MessageUtil.ArgumentException
 Retrieve package vector argument. More...
 
static String getStringArg (MessagePackage message, int position) throws MessageUtil.ArgumentException
 Retrieve string argument. More...
 
static Vector< String > getStringVectorArg (MessagePackage message, int position) throws MessageUtil.ArgumentException
 Retrieve string vector argument. More...
 
static String methodNameToMessageName (String servicePrefix, String methodName)
 Mangles method name to a message name to be transfered on wire. More...
 
static String writepropertyMethodNameToMessageName (String servicePrefix, String methodName)
 Mangles a method name used to modify writable runtime data properties. More...
 

Detailed Description

Collection of utility functions.

Member Function Documentation

◆ addBinaryArg()

static boolean addBinaryArg ( MessagePackage  message,
int  position,
byte []  arg 
)
static

Adds a binary argument to a message.

Parameters
messagewhere to add the argument
positionposition to add the argument
argthe value
Returns
true if succeeded

◆ addBinaryVectorArg()

static boolean addBinaryVectorArg ( MessagePackage  message,
int  position,
Vector< byte[]>  arg 
)
static

Adds a binary vector argument to message.

Parameters
messagewhere to add the vector argument
positionposition to add the argument
argthe vector to add
Returns
true if succeeded

◆ addBooleanArg()

static boolean addBooleanArg ( MessagePackage  message,
int  position,
boolean  arg 
)
static

Adds a boolean argument to a message.

Parameters
messagewhere to add the argument
positionposition to add the argument
argthe value
Returns
true if succeeded

◆ addBooleanVectorArg()

static boolean addBooleanVectorArg ( MessagePackage  message,
int  position,
Vector< Boolean >  arg 
)
static

Adds a boolean vector argument to message.

Parameters
messagewhere to add the vector argument
positionposition to add the argument
argthe vector to add
Returns
true if succeeded

◆ addFloatArg()

static boolean addFloatArg ( MessagePackage  message,
int  position,
float  arg 
)
static

Adds a Float argument to a message.

Parameters
messagewhere to add the argument
positionposition to add the argument
argthe value
Returns
true if succeeded

◆ addFloatVectorArg()

static boolean addFloatVectorArg ( MessagePackage  message,
int  position,
Vector< Float >  arg 
)
static

Adds a float vector argument to message.

Parameters
messagewhere to add the vector argument
positionposition to add the argument
argthe vector to add
Returns
true if succeeded

◆ addIntArg()

static boolean addIntArg ( MessagePackage  message,
int  position,
int  arg 
)
static

Adds a integer argument to a message.

Parameters
messagewhere to add the argument
positionposition to add the argument
argthe value
Returns
true if succeeded

◆ addIntVectorArg()

static boolean addIntVectorArg ( MessagePackage  message,
int  position,
Vector< Integer >  arg 
)
static

Adds a int vector argument to message.

Parameters
messagewhere to add the vector argument
positionposition to add the argument
argthe vector to add
Returns
true if succeeded

◆ addPackageArg()

static boolean addPackageArg ( MessagePackage  message,
int  position,
MessagePackage  arg 
)
static

Adds a package argument to a message.

Parameters
messagewhere to add the argument
positionposition to add the argument
argthe value
Returns
true if succeeded

◆ addPackageVectorArg()

static boolean addPackageVectorArg ( MessagePackage  message,
int  position,
Vector< MessagePackage >  arg 
)
static

Adds a package vector argument to message.

Parameters
messagewhere to add the vector argument
positionposition to add the argument
argthe vector to add
Returns
true if succeeded

◆ addStringArg()

static boolean addStringArg ( MessagePackage  message,
int  position,
String  arg 
)
static

Adds a string argument to a message.

Parameters
messagewhere to add the argument
positionposition to add the argument
argthe value
Returns
true if succeeded

◆ addStringVectorArg()

static boolean addStringVectorArg ( MessagePackage  message,
int  position,
Vector< String >  arg 
)
static

Adds a string vector argument to message.

Parameters
messagewhere to add the vector argument
positionposition to add the argument
argthe vector to add
Returns
true if succeeded

◆ eventNameToMessageName()

static String eventNameToMessageName ( String  servicePrefix,
String  eventName 
)
static

Mangles event name to a message name transferred on wire.

Parameters
servicePrefixService name prefix, E.g. Media
eventNamename of the event, E.g. progress
Returns
mangled name, E.g. MediaProgressEvent

◆ getBinaryArg()

static byte [] getBinaryArg ( MessagePackage  message,
int  position 
) throws MessageUtil.ArgumentException
static

Retrieve binary argument.

Parameters
messagewhere to retrieve the value from
positionposition where to retrieve the value
Returns
the value
Exceptions
MessageUtil.ArgumentExceptionif argument type does not match

◆ getBinaryVectorArg()

static Vector<byte[]> getBinaryVectorArg ( MessagePackage  message,
int  position 
) throws MessageUtil.ArgumentException
static

Retrieve binary vector argument.

Parameters
messagewhere to retrieve the vector from
positionposition where to retrieve the vector
Returns
the vector
Exceptions
MessageUtil.ArgumentExceptionif argument type does not match

◆ getBooleanArg()

static boolean getBooleanArg ( MessagePackage  message,
int  position 
) throws MessageUtil.ArgumentException
static

Retrieve boolean argument.

Parameters
messagewhere to retrieve the value from
positionposition where to retrieve the value
Returns
the value
Exceptions
MessageUtil.ArgumentExceptionif argument type does not match

◆ getBooleanVectorArg()

static Vector<Boolean> getBooleanVectorArg ( MessagePackage  message,
int  position 
) throws MessageUtil.ArgumentException
static

Retrieve boolean vector argument.

Parameters
messagewhere to retrieve the vector from
positionposition where to retrieve the vector
Returns
the vector
Exceptions
MessageUtil.ArgumentExceptionif argument type does not match

◆ getFloatArg()

static float getFloatArg ( MessagePackage  message,
int  position 
) throws MessageUtil.ArgumentException
static

Retrieve float argument.

Parameters
messagewhere to retrieve the value from
positionposition where to retrieve the value
Returns
the value
Exceptions
MessageUtil.ArgumentExceptionif argument type does not match

◆ getFloatVectorArg()

static Vector<Float> getFloatVectorArg ( MessagePackage  message,
int  position 
) throws MessageUtil.ArgumentException
static

Retrieve float vector argument.

Parameters
messagewhere to retrieve the vector from
positionposition where to retrieve the vector
Returns
the vector
Exceptions
MessageUtil.ArgumentExceptionif argument type does not match

◆ getIntArg()

static int getIntArg ( MessagePackage  message,
int  position 
) throws MessageUtil.ArgumentException
static

Retrieve int argument.

Parameters
messagewhere to retrieve the value from
positionposition where to retrieve the value
Returns
the value
Exceptions
MessageUtil.ArgumentExceptionif argument type does not match

◆ getIntVectorArg()

static Vector<Integer> getIntVectorArg ( MessagePackage  message,
int  position 
) throws MessageUtil.ArgumentException
static

Retrieve int vector argument.

Parameters
messagewhere to retrieve the vector from
positionposition where to retrieve the vector
Returns
the vector
Exceptions
MessageUtil.ArgumentExceptionif argument type does not match

◆ getPackageArg()

static MessagePackage getPackageArg ( MessagePackage  message,
int  position 
) throws MessageUtil.ArgumentException
static

Retrieve package argument.

Parameters
messagewhere to retrieve the value from
positionposition where to retrieve the value
Returns
the value
Exceptions
MessageUtil.ArgumentExceptionif argument type does not match

◆ getPackageVectorArg()

static Vector<MessagePackage> getPackageVectorArg ( MessagePackage  message,
int  position 
) throws MessageUtil.ArgumentException
static

Retrieve package vector argument.

Parameters
messagewhere to retrieve the vector from
positionposition where to retrieve the vector
Returns
the vector
Exceptions
MessageUtil.ArgumentExceptionif argument type does not match

◆ getStringArg()

static String getStringArg ( MessagePackage  message,
int  position 
) throws MessageUtil.ArgumentException
static

Retrieve string argument.

Parameters
messagewhere to retrieve the value from
positionposition where to retrieve the value
Returns
the value
Exceptions
MessageUtil.ArgumentExceptionif argument type does not match

◆ getStringVectorArg()

static Vector<String> getStringVectorArg ( MessagePackage  message,
int  position 
) throws MessageUtil.ArgumentException
static

Retrieve string vector argument.

Parameters
messagewhere to retrieve the vector from
positionposition where to retrieve the vector
Returns
the vector
Exceptions
MessageUtil.ArgumentExceptionif argument type does not match

◆ methodNameToMessageName()

static String methodNameToMessageName ( String  servicePrefix,
String  methodName 
)
static

Mangles method name to a message name to be transfered on wire.

Parameters
servicePrefixService name, e.g. "Media"
methodNameName of the method to mangle, e.g. "playTrack"
Returns
Wire message name, e.g. "MediaPlayTrackMethod"

◆ writepropertyMethodNameToMessageName()

static String writepropertyMethodNameToMessageName ( String  servicePrefix,
String  methodName 
)
static

Mangles a method name used to modify writable runtime data properties.

Parameters
servicePrefixThe service prefix.
methodNamename of the method.
Returns
mangled name