package org.openas2.message;

import java.io.Serializable;
import java.util.Map;

import javax.mail.internet.InternetHeaders;
import javax.mail.internet.MimeBodyPart;

import org.openas2.OpenAS2Exception;
import org.openas2.partner.Partnership;


public interface Message extends Serializable {
	
    public static final String SMIME_TYPE_COMPRESSED_DATA = "smime-type=compressed-data";
	
	public Map<Object, Object> getOptions();

	public void setOption(Object key, Object value);

    public Object getOption(Object key);
    
    public void setAttribute(String key, String value);

    public String getAttribute(String key);

    public void setAttributes(Map<String, String> attributes);

    public Map<String, String> getAttributes();

    public void setContentType(String contentType);

    public String getContentType();

    public String getCompressionType();

    public void setCompressionType(String compressionType);
    
    public void setContentDisposition(String contentDisposition);

    public String getContentDisposition();

    public void setData(MimeBodyPart data, DataHistoryItem historyItem) throws OpenAS2Exception;
    
	public DataHistoryItem setData(MimeBodyPart data) throws OpenAS2Exception;

    public MimeBodyPart getData();

    public void setHeader(String key, String value);

    public String getHeader(String key);

    public String getHeader(String key, String delimiter);

    public void setHeaders(InternetHeaders headers);

    public InternetHeaders getHeaders();

    public void setHistory(DataHistory history);

    public DataHistory getHistory();

    public void setMDN(MessageMDN mdn);

    public MessageMDN getMDN();

    public void setMessageID(String messageID);

    public String getMessageID();

    public void setPartnership(Partnership partnership);

    public Partnership getPartnership();

    public String getProtocol();

    public boolean isRequestingMDN();

    public boolean isRequestingAsynchMDN();

    public void setSubject(String subject);

    public String getSubject();

    public void addHeader(String key, String value);

    public String generateMessageID();

    public void updateMessageID();
    
    public String getLoggingText();
}

@@ -207,16 +207,70 @@
 ption;%0D%0A
+import org.openas2.params.InvalidParameterException;%0D%0A
 import o
@@ -358,16 +358,669 @@
 e %7B%0D%0A%09%0D%0A
+    public static final String MSG_STATUS_MSG_INIT = %22initializing_msg%22;%0D%0A    public static final String MSG_STATUS_MSG_SEND = %22sending_msg%22;%0D%0A    public static final String MSG_STATUS_MSG_RESEND = %22resending_msg%22;%0D%0A    public static final String MSG_STATUS_MDN_SEND = %22sending_mdn%22;%0D%0A    public static final String MSG_STATUS_MDN_WAIT = %22awaiting_mdn%22;%0D%0A    public static final String MSG_STATUS_MDN_PARSE = %22parsing_mdn%22;%0D%0A    public static final String MSG_STATUS_MDN_VERIFY = %22verifying_mdn%22;%0D%0A    public static final String MSG_STATUS_MDN_PROCESS_INIT = %22init_processing_mdn%22;%0D%0A    public static final String MSG_STATUS_MSG_CLEANUP = %22cleanup%22;%0D%0A%0D%0A
     publ
@@ -1105,16 +1105,96 @@
 a%22;%0D%0A%09%0D%0A
+%09public void setStatus(String status);%0D%0A%0D%0A    public String getStatus();%0D%0A    %0D%0A
 %09public 
@@ -3009,32 +3009,65 @@
 erateMessageID()
+ throws InvalidParameterException
 ;%0D%0A%0D%0A    public 
@@ -3092,52 +3092,257 @@
 ID()
-;%0D%0A    %0D%0A    public String getLoggingText();
+ throws InvalidParameterException;%0D%0A    %0D%0A    public String getLogMsgID();%0D%0A%0D%0A    public String getLogMsg();%0D%0A%0D%0A    public void setLogMsg(String msg);%0D%0A%0D%0A    public String getCalculatedMIC();%0D%0A%0D%0A%09public void setCalculatedMIC(String calculatedMIC);%0D%0A
 %0D%0A%7D%0D

Add message processing states