net.sf.adf.acl
Interface ACLCodec

All Known Implementing Classes:
SOAPCodec, StringCodec, XMLCodec

public interface ACLCodec

An object implementing ACLCodec has the ability to convert ACLMessages into Strings and Strings into ACLMessages. The way this conversion occurs is not defined by this interface and can be arbitrary as long as the following statement is true:

 ACLMessage m;
 ACLCodec c;
 m.eqals(c.decode(c.encode(m)));
 

This means that a String containing an encoded message can always be decoded by the ACLCodec it was encoded by and the resulting message will be equal to the original one.

It is a desirable property to have the previous statement hold even for different instances of the same class implementing ACLCodec. However, this cannot be enforced by this interface since the output of certain ACLCodec objects can depend on the internal configuration of the instances.

Author:
Catalin Hritcu

Method Summary
 ACLMessage decode(java.lang.String str)
          Decodes .
 java.lang.String encode(ACLMessage message)
          Encodes an ACLMessage and returns the resulting String.
 java.lang.String getMimeType()
           
 

Method Detail

decode

ACLMessage decode(java.lang.String str)
                  throws DecodingException
Decodes .

Parameters:
str - A String representation of an ACLMessage
Returns:
The ACLMessage represented by str
Throws:
DecodingException - For some reason the String could not be decoded.

encode

java.lang.String encode(ACLMessage message)
                        throws EncodingException
Encodes an ACLMessage and returns the resulting String.

Parameters:
message - The ACLMessage to be encoded.
Returns:
A textual representation of the message
Throws:
EncodingException - For some reason the message could not be encoded.

getMimeType

java.lang.String getMimeType()