View Javadoc

1   /*
2    * $Id: BexeeMessage.java,v 1.1 2004/12/15 14:18:10 patforna Exp $
3    *
4    * Copyright (c) 2004 Patric Fornasier, Pawel Kowalski
5    * Berne University of Applied Sciences
6    * School of Engineering and Information Technology
7    * All rights reserved.
8    */
9   package bexee.core;
10  
11  import java.util.HashMap;
12  import java.util.Map;
13  
14  import org.apache.commons.lang.builder.ToStringBuilder;
15  import org.apache.commons.lang.builder.ToStringStyle;
16  
17  /***
18   * This class is used for crossing the bridge between Axis and bexee in both
19   * ways.
20   * <p>
21   * Note that the BexeeMessage contains no SOAP specific data, just XML together
22   * with other information such as the operation name etc. This allows for a
23   * decoupling of the bexee engine and thus keeping it relatively independent
24   * from the SOAP protocol and Axis.
25   * 
26   * @version $Revision: 1.1 $, $Date: 2004/12/15 14:18:10 $
27   * @author Patric Fornasier
28   * @author Pawel Kowalski
29   */
30  public class BexeeMessage {
31  
32      /*
33       * PORTTYPE WAS REMOVED, SINCE WE CAN ALWAYS HAVE ONLY ONE PORTTYPE PER AXIS
34       * WEB SERVICE
35       * 
36       * YOU CAN GET THE PORT TYPE VIA SERVICENAME->WSDL->PORTTYPE
37       */
38  
39      private String service;
40  
41      private String operation;
42  
43      private Map parts;
44  
45      /***
46       * Creates a new <code>BexeeMessage</code>.
47       */
48      public BexeeMessage() {
49          parts = new HashMap();
50      }
51  
52      //***************************************************/
53      // routing infos: operation name, service, etc.
54      //***************************************************/
55  
56      /***
57       * Gets the name of the invoked operation.
58       * 
59       * @return a <code>String</code> or null if the message hasn't been
60       *         initialized.
61       */
62      public String getOperation() {
63          return operation;
64      }
65  
66      public Object getPart(String name) {
67          return parts.get(name);
68      }
69  
70      public void putPart(String name, Object value) {
71          parts.put(name, value);
72      }
73  
74      public Map getParts() {
75          return parts;
76      }
77  
78      public void setParts(Map parts) {
79          this.parts = parts;
80      }
81  
82      public void setOperation(String operation) {
83          this.operation = operation;
84      }
85  
86      /***
87       * The name of the invoked service.
88       * 
89       * @return a <code>String</code>
90       */
91      public String getService() {
92          return service;
93      }
94  
95      /***
96       * The name of the invoked service.
97       * 
98       * @param service
99       *            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 }