001: /*
002: * $Id: BexeeMessage.java,v 1.8 2004/12/01 14:24:27 kowap Exp $
003: *
004: * Copyright (c) 2004 Patric Fornasier, Pawel Kowalski
005: * Berne University of Applied Sciences
006: * School of Engineering and Information Technology
007: * All rights reserved.
008: */
009: package bexee.core;
010:
011: import java.util.HashMap;
012: import java.util.Map;
013:
014: import org.apache.commons.lang.builder.ToStringBuilder;
015: import org.apache.commons.lang.builder.ToStringStyle;
016:
017: /**
018: * This class is used for crossing the bridge between Axis and bexee in both
019: * ways.
020: * <p>
021: * Note that the BexeeMessage contains no SOAP specific data, just XML together
022: * with other information such as the operation name etc. This allows for a
023: * decoupling of the bexee engine and thus keeping it relatively independent
024: * from the SOAP protocol and Axis.
025: *
026: * @version $Revision: 1.8 $, $Date: 2004/12/01 14:24:27 $
027: * @author Patric Fornasier
028: * @author Pawel Kowalski
029: */
030: public class BexeeMessage {
031:
032: /*
033: * PORTTYPE WAS REMOVED, SINCE WE CAN ALWAYS HAVE ONLY ONE PORTTYPE PER AXIS
034: * WEB SERVICE
035: *
036: * YOU CAN GET THE PORT TYPE VIA SERVICENAME->WSDL->PORTTYPE
037: */
038:
039: private String service;
040:
041: private String operation;
042:
043: private Map parts;
044:
045: /**
046: * Creates a new <code>BexeeMessage</code>.
047: */
048: public BexeeMessage() {
049: parts = new HashMap();
050: }
051:
052: //**************************************************/
053: // routing infos: operation name, service, etc.
054: //**************************************************/
055:
056: /**
057: * Gets the name of the invoked operation.
058: *
059: * @return a <code>String</code> or null if the message hasn't been
060: * initialized.
061: */
062: public String getOperation() {
063: return operation;
064: }
065:
066: public Object getPart(String name) {
067: return parts.get(name);
068: }
069:
070: public void putPart(String name, Object value) {
071: parts.put(name, value);
072: }
073:
074: public Map getParts() {
075: return parts;
076: }
077:
078: public void setParts(Map parts) {
079: this .parts = parts;
080: }
081:
082: public void setOperation(String operation) {
083: this .operation = operation;
084: }
085:
086: /**
087: * The name of the invoked service.
088: *
089: * @return a <code>String</code>
090: */
091: public String getService() {
092: return service;
093: }
094:
095: /**
096: * The name of the invoked service.
097: *
098: * @param service
099: * a <code>String</code>
100: */
101: public void setService(String service) {
102: this .service = service;
103: }
104:
105: //**************************************************/
106: // overridden methods
107: //**************************************************/
108:
109: public String toString() {
110: return ToStringBuilder.reflectionToString(this,
111: ToStringStyle.MULTI_LINE_STYLE);
112: }
113: }
|