Package jade.lang.acl

Interface ACLCodec

  • All Known Implementing Classes:
    LEAPACLCodec, StringACLCodec

    public interface ACLCodec
    Abstract 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 class  ACLCodec.CodecException
      This exception is thrown when some problem occurs in the concrete parsing subsystem accessed through this interface.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      ACLMessage decode​(byte[] data, String charset)
      Recovers an ACLMessage object back from raw data, using the specific message representation to interpret the byte sequence.
      byte[] encode​(ACLMessage msg, String charset)
      Encodes an ACLMessage object into a byte sequence, according to the specific message representation.
      String getName()
      Query the name of the message representation handled by this Codec object.
    • Method Detail

      • encode

        byte[] encode​(ACLMessage msg,
                      String charset)
        Encodes an ACLMessage object 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 an ACLMessage object 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 ACLMessage object, 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 this Codec object. The FIPA standard representations have a name starting with "fipa.acl.rep.".
        Returns:
        The name of the handled ACL message representation.