001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)NormalizedMessage.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package javax.jbi.messaging;
030:
031: import java.util.Set;
032:
033: import javax.activation.DataHandler;
034: import javax.security.auth.Subject;
035: import javax.xml.transform.Source;
036:
037: /** Represents a JBI Normalized Message.
038: *
039: * @author JSR208 Expert Group
040: */
041: public interface NormalizedMessage {
042: /** Add an attachment to the message.
043: * @param id unique identifier for the attachment
044: * @param content attachment content
045: * @throws MessagingException failed to add attachment
046: */
047: void addAttachment(String id, DataHandler content)
048: throws MessagingException;
049:
050: /** Retrieve the content of the message.
051: * @return message content
052: */
053: Source getContent();
054:
055: /** Retrieve attachment with the specified identifier.
056: * @param id unique identifier for attachment
057: * @return DataHandler representing attachment content, or null if an
058: * attachment with the specified identifier is not found
059: */
060: DataHandler getAttachment(String id);
061:
062: /** Returns a list of identifiers for each attachment to the message.
063: * @return iterator over String attachment identifiers
064: */
065: Set getAttachmentNames();
066:
067: /** Removes attachment with the specified unique identifier.
068: * @param id attachment identifier
069: * @throws MessagingException failed to remove attachment
070: */
071: void removeAttachment(String id) throws MessagingException;
072:
073: /** Set the content of the message.
074: * @param content message content
075: * @throws MessagingException failed to set content
076: */
077: void setContent(Source content) throws MessagingException;
078:
079: /** Set a property on the message.
080: * @param name property name
081: * @param value property value
082: */
083: void setProperty(String name, Object value);
084:
085: /**
086: * Set the security Subject for the message.
087: * @param subject Subject to associated with message.
088: */
089: void setSecuritySubject(Subject subject);
090:
091: /** Retrieve a list of property names for the message.
092: * @return list of property names
093: */
094: Set getPropertyNames();
095:
096: /** Retrieve a property from the message.
097: * @param name property name
098: * @return property value, or null if the property does not exist
099: */
100: Object getProperty(String name);
101:
102: /** Retrieve the security Subject from the message.
103: * @return security Subject associated with message, or null.
104: */
105: Subject getSecuritySubject();
106: }
|