001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */package org.apache.cxf.message;
019:
020: import java.util.Collection;
021: import java.util.Set;
022:
023: import org.apache.cxf.interceptor.InterceptorChain;
024: import org.apache.cxf.transport.Destination;
025:
026: public interface Message extends StringMap {
027:
028: String TRANSPORT = "org.apache.cxf.transport";
029: String REQUESTOR_ROLE = "org.apache.cxf.client";
030:
031: String INBOUND_MESSAGE = "org.apache.cxf.message.inbound";
032: String INVOCATION_CONTEXT = "org.apache.cxf.invocation.context";
033:
034: String MIME_HEADERS = "org.apache.cxf.mime.headers";
035:
036: String ASYNC_POST_RESPONSE_DISPATCH = "org.apache.cxf.async.post.response.dispatch";
037:
038: String DECOUPLED_CHANNEL_MESSAGE = "decoupled.channel.message";
039: String PARTIAL_RESPONSE_MESSAGE = "org.apache.cxf.partial.response";
040:
041: String PROTOCOL_HEADERS = Message.class.getName()
042: + ".PROTOCOL_HEADERS";
043: String RESPONSE_CODE = Message.class.getName() + ".RESPONSE_CODE";
044: String ENDPOINT_ADDRESS = Message.class.getName()
045: + ".ENDPOINT_ADDRESS";
046: String HTTP_REQUEST_METHOD = Message.class.getName()
047: + ".HTTP_REQUEST_METHOD";
048: String PATH_INFO = Message.class.getName() + ".PATH_INFO";
049: String QUERY_STRING = Message.class.getName() + ".QUERY_STRING";
050: String MTOM_ENABLED = "mtom-enabled";
051: String SCHEMA_VALIDATION_ENABLED = "schema-validation-enabled";
052: String FAULT_STACKTRACE_ENABLED = "faultStackTraceEnabled";
053: String CONTENT_TYPE = "Content-Type";
054: String BASE_PATH = Message.class.getName() + ".BASE_PATH";
055: String ENCODING = Message.class.getName() + ".ENCODING";
056: String FIXED_PARAMETER_ORDER = Message.class.getName()
057: + "FIXED_PARAMETER_ORDER";
058: String MAINTAIN_SESSION = Message.class.getName()
059: + ".MAINTAIN_SESSION";
060:
061: String WSDL_DESCRIPTION = "javax.xml.ws.wsdl.description";
062: String WSDL_SERVICE = "javax.xml.ws.wsdl.service";
063: String WSDL_PORT = "javax.xml.ws.wsdl.port";
064: String WSDL_INTERFACE = "javax.xml.ws.wsdl.interface";
065: String WSDL_OPERATION = "javax.xml.ws.wsdl.operation";
066:
067: String getId();
068:
069: void setId(String id);
070:
071: InterceptorChain getInterceptorChain();
072:
073: void setInterceptorChain(InterceptorChain chain);
074:
075: /**
076: * @return the associated Destination if message is inbound, null otherwise
077: */
078: Destination getDestination();
079:
080: Exchange getExchange();
081:
082: void setExchange(Exchange exchange);
083:
084: Collection<Attachment> getAttachments();
085:
086: void setAttachments(Collection<Attachment> attachments);
087:
088: /**
089: * Retrieve the encapsulated content as a particular type (a result type
090: * if message is outbound, a source type if message is inbound)
091: *
092: * @param format the expected content format
093: * @return the encapsulated content
094: */
095: <T> T getContent(Class<T> format);
096:
097: /**
098: * Provide the encapsulated content as a particular type (a result type
099: * if message is outbound, a source type if message is inbound)
100: *
101: * @param format the provided content format
102: * @param content the content to be encapsulated
103: */
104: <T> void setContent(Class<T> format, Object content);
105:
106: /**
107: * @return the set of currently encapsulated content formats
108: */
109: Set<Class<?>> getContentFormats();
110:
111: /**
112: * Removes a content from a message. If some contents are completely consumed,
113: * removing them is a good idea
114: * @param format the format to remove
115: */
116: <T> void removeContent(Class<T> format);
117:
118: Object getContextualProperty(String key);
119: }
|