001: /*
002: * ChainBuilder ESB
003: * Visual Enterprise Integration
004: *
005: * Copyright (C) 2006 Bostech Corporation
006: *
007: * This program is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU General Public License as published by the
009: * Free Software Foundation; either version 2 of the License, or (at your option)
010: * any later version.
011: *
012: * This program is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
014: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
015: * for more details.
016: *
017: * You should have received a copy of the GNU General Public License along with
018: * this program; if not, write to the Free Software Foundation, Inc.,
019: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020: *
021: *
022: * $Id: ExchangeVO.java 10907 2007-12-13 05:21:15Z lzheng $
023: */
024: package com.bostechcorp.cbesb.runtime.ccsl.errordb;
025:
026: import java.net.URI;
027:
028: import javax.jbi.messaging.ExchangeStatus;
029: import javax.jbi.messaging.MessageExchange;
030: import javax.jbi.servicedesc.ServiceEndpoint;
031: import javax.xml.namespace.QName;
032:
033: public class ExchangeVO extends AbstractVO {
034:
035: // private MessageExchange exchange;
036: private long exchangeId;
037: private String role;
038: private String endpointService = " ";
039: private String endpointName = " ";
040: private String exchangeContainerId = " ";
041: private String interfaceName = " ";
042: private String operation;
043: private String exchangeStatus = " ";
044: private String pattern;
045: private String service = " ";
046:
047: public ExchangeVO() {
048: }
049:
050: public ExchangeVO(long exchangeId) {
051: this .exchangeId = exchangeId;
052: }
053:
054: public ExchangeVO(MessageExchange exchange) {
055: MessageExchange.Role role = exchange.getRole();
056: String strRole = null;
057: if (role == MessageExchange.Role.CONSUMER)
058: strRole = "consumer";
059: else if (role == MessageExchange.Role.PROVIDER)
060: strRole = "provider";
061: else
062: strRole = "unknown(" + role + ")";
063: this .role = strRole;
064:
065: ServiceEndpoint se = exchange.getEndpoint();
066: if (se != null) {
067: QName serviceName = se.getServiceName();
068: if (serviceName != null)
069: this .endpointService = serviceName.toString();
070: }
071:
072: ServiceEndpoint endpoint = exchange.getEndpoint();
073: if (endpoint != null)
074: this .endpointName = endpoint.getEndpointName();
075:
076: this .exchangeContainerId = exchange.getExchangeId();
077:
078: QName intName = exchange.getInterfaceName();
079: if (intName != null) {
080: this .interfaceName = intName.toString();
081: }
082:
083: QName n = exchange.getOperation();
084: if (n != null)
085: this .operation = n.toString();
086:
087: URI pattern = exchange.getPattern();
088: if (pattern != null)
089: pattern.toString();
090:
091: QName service = exchange.getService();
092: if (service != null)
093: service.toString();
094:
095: ExchangeStatus status = exchange.getStatus();
096: if (status != null)
097: this .exchangeStatus = status.toString();
098:
099: }
100:
101: public String getRole() {
102:
103: return this .role;
104: }
105:
106: public void setRole(String role) {
107: this .role = role;
108: }
109:
110: public String getEndpointService() {
111:
112: return this .endpointService;
113: }
114:
115: public void setEndpointService(String endpointService) {
116: this .endpointService = endpointService;
117: }
118:
119: public String getEndpointName() {
120:
121: return this .endpointName;
122: }
123:
124: public void setEndpointName(String endpointName) {
125: this .endpointName = endpointName;
126: }
127:
128: public String getExchangeContainerId() {
129:
130: return this .exchangeContainerId;
131: }
132:
133: public void setExchangeContainerId(String exchangeContainerId) {
134: this .exchangeContainerId = exchangeContainerId;
135: }
136:
137: public String getInterfaceName() {
138:
139: return this .interfaceName;
140: }
141:
142: public void setInterfaceName(String interfaceName) {
143: this .interfaceName = interfaceName;
144: }
145:
146: public String getOperation() {
147:
148: return this .operation;
149: }
150:
151: public void setOperation(String operation) {
152: this .operation = operation;
153: }
154:
155: public String getPattern() {
156:
157: return this .pattern;
158: }
159:
160: public void setPattern(String pattern) {
161: this .pattern = pattern;
162: }
163:
164: public String getService() {
165:
166: return this .service;
167: }
168:
169: public void setService(String service) {
170: this .service = service;
171: }
172:
173: public String getExchangeStatus() {
174:
175: return this .exchangeStatus;
176: }
177:
178: public void setExchangeStatus(String exchangeStatus) {
179: this .exchangeStatus = exchangeStatus;
180: }
181:
182: public long getExchangeId() {
183: return exchangeId;
184: }
185:
186: public void setExchangeId(long id) {
187: exchangeId = id;
188: }
189: }
|