Package jade.lang.acl
Interface ACLCodec
-
- All Known Implementing Classes:
LEAPACLCodec,StringACLCodec
public interface ACLCodecAbstract interface for converting ACL messages back and forth between Java objects and raw byte sequences, according to a FIPA ACL message representation.- Version:
- $Date$ $Revision$
- Author:
- Giovanni Rimassa - Universita` di Parma
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classACLCodec.CodecExceptionThis exception is thrown when some problem occurs in the concrete parsing subsystem accessed through this interface.
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_CHARSET
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ACLMessagedecode(byte[] data, String charset)Recovers anACLMessageobject back from raw data, using the specific message representation to interpret the byte sequence.byte[]encode(ACLMessage msg, String charset)Encodes anACLMessageobject into a byte sequence, according to the specific message representation.StringgetName()Query the name of the message representation handled by thisCodecobject.
-
-
-
Field Detail
-
DEFAULT_CHARSET
static final String DEFAULT_CHARSET
- See Also:
- Constant Field Values
-
-
Method Detail
-
encode
byte[] encode(ACLMessage msg, String charset)
Encodes anACLMessageobject into a byte sequence, according to the specific message representation.- Parameters:
msg- The ACL message to encode.charset- Charset encoding to use (e.g. US_ASCII, UTF-8, etc)- Returns:
- a byte array, containing the encoded message.
-
decode
ACLMessage decode(byte[] data, String charset) throws ACLCodec.CodecException
Recovers anACLMessageobject back from raw data, using the specific message representation to interpret the byte sequence.- Parameters:
data- The byte sequence containing the encoded message.charset- Charset encoding to use (e.g. US_ASCII, UTF-8, etc)- Returns:
- A new
ACLMessageobject, built from the raw data. - Throws:
ACLCodec.CodecException- If some kind of syntax error occurs.
-
getName
String getName()
Query the name of the message representation handled by thisCodecobject. The FIPA standard representations have a name starting with"fipa.acl.rep.".- Returns:
- The name of the handled ACL message representation.
-
-