001: /*
002: * The contents of this file are subject to the terms of the Common Development
003: * and Distribution License (the License). You may not use this file except in
004: * compliance with the License.
005: *
006: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007: * or http://www.netbeans.org/cddl.txt.
008: *
009: * When distributing Covered Code, include this CDDL Header Notice in each file
010: * and include the License file at http://www.netbeans.org/cddl.txt.
011: * If applicable, add the following below the CDDL Header, with the fields
012: * enclosed by brackets [] replaced by your own identifying information:
013: * "Portions Copyrighted [year] [name of copyright owner]"
014: *
015: * The Original Software is NetBeans. The Initial Developer of the Original
016: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017: * Microsystems, Inc. All Rights Reserved.
018: */
019:
020: package org.netbeans.modules.wsdlextensions.jms.impl;
021:
022: import org.netbeans.modules.wsdlextensions.jms.JMSConstants;
023: import org.netbeans.modules.wsdlextensions.jms.JMSQName;
024: import org.netbeans.modules.wsdlextensions.jms.JMSOperation;
025:
026: import org.netbeans.modules.xml.wsdl.model.WSDLModel;
027: import org.w3c.dom.Element;
028:
029: /**
030: * JMSOperationImpl
031: */
032: public class JMSOperationImpl extends JMSComponentImpl implements
033: JMSOperation {
034:
035: public JMSOperationImpl(WSDLModel model, Element e) {
036: super (model, e);
037: }
038:
039: public JMSOperationImpl(WSDLModel model) {
040: this (model, createPrefixedElement(
041: JMSQName.OPERATION.getQName(), model));
042: }
043:
044: /*
045: public JMSOptions getOptions() {
046: return options;
047: }
048:
049: public void setOptions(JMSOptions val) {
050: options = val;
051: }
052: */
053:
054: public String getDestination() {
055: return getAttribute(JMSAttribute.JMS_OPERATION_DESTINATION);
056: }
057:
058: public void setDestination(String val) {
059: setAttribute(JMSOperation.ATTR_DESTINATION,
060: JMSAttribute.JMS_OPERATION_DESTINATION, val);
061: }
062:
063: public String getDestinationType() {
064: return getAttribute(JMSAttribute.JMS_OPERATION_DESTINATION_TYPE);
065: }
066:
067: public void setDestinationType(String val) {
068: setAttribute(JMSOperation.ATTR_DESTINATION_TYPE,
069: JMSAttribute.JMS_OPERATION_DESTINATION_TYPE, val);
070: }
071:
072: public String getTransaction() {
073: return getAttribute(JMSAttribute.JMS_OPERATION_TRANSACTION);
074: }
075:
076: public void setTransaction(String val) {
077: setAttribute(JMSOperation.ATTR_TRANSACTION,
078: JMSAttribute.JMS_OPERATION_TRANSACTION, val);
079: }
080:
081: public String getDeliveryMode() {
082: return getAttribute(JMSAttribute.JMS_OPERATION_DELIVERY_MODE);
083: }
084:
085: public void setDeliveryMode(String val) {
086: setAttribute(JMSOperation.ATTR_DELIVERY_MODE,
087: JMSAttribute.JMS_OPERATION_DELIVERY_MODE, val);
088: }
089:
090: public long getTimeToLive() {
091: String strVal = getAttribute(JMSAttribute.JMS_OPERATION_TIME_TO_LIVE);
092:
093: long numVal = JMSConstants.TIME_TO_LIVE_FOREVER;
094: if (strVal != null) {
095: try {
096: numVal = Long.parseLong(strVal);
097: } catch (Exception e) {
098: // just ignore
099: }
100: }
101: return numVal;
102: }
103:
104: public void setTimeToLive(long val) {
105: setAttribute(JMSOperation.ATTR_TIME_TO_LIVE,
106: JMSAttribute.JMS_OPERATION_TIME_TO_LIVE, "" + val);
107: }
108:
109: public int getPriority() {
110: String strVal = getAttribute(JMSAttribute.JMS_OPERATION_PRIORITY);
111:
112: int numVal = JMSConstants.PRIORITY_DEFAULT;
113: if (strVal != null) {
114: try {
115: numVal = Integer.parseInt(strVal);
116: } catch (Exception e) {
117: // just ignore
118: }
119: }
120: return numVal;
121: }
122:
123: public void setPriority(int val) {
124: setAttribute(JMSOperation.ATTR_PRIORITY,
125: JMSAttribute.JMS_OPERATION_PRIORITY, "" + val);
126: }
127:
128: public boolean getDisableMessageID() {
129: String strVal = getAttribute(JMSAttribute.JMS_OPERATION_DISABLE_MESSAGE_ID);
130: return JMSConstants.stringValueIsTrue(strVal);
131: }
132:
133: public void setDisableMessageID(boolean val) {
134: setAttribute(JMSOperation.ATTR_DISABLE_MESSAGE_ID,
135: JMSAttribute.JMS_OPERATION_DISABLE_MESSAGE_ID,
136: val ? JMSConstants.BOOLEAN_TRUE
137: : JMSConstants.BOOLEAN_FALSE);
138: }
139:
140: public boolean getDisableMessageTimeStamp() {
141: String strVal = getAttribute(JMSAttribute.JMS_OPERATION_DISABLE_MESSAGE_TIMESTAMP);
142: return JMSConstants.stringValueIsTrue(strVal);
143: }
144:
145: public void setDisableMessageTimeStamp(boolean val) {
146: setAttribute(JMSOperation.ATTR_DISABLE_MESSAGE_TIMESTAMP,
147: JMSAttribute.JMS_OPERATION_DISABLE_MESSAGE_TIMESTAMP,
148: val ? JMSConstants.BOOLEAN_TRUE
149: : JMSConstants.BOOLEAN_FALSE);
150: }
151:
152: public long getTimeout() {
153: String strVal = getAttribute(JMSAttribute.JMS_OPERATION_TIMEOUT);
154:
155: long numVal = JMSConstants.TIME_OUT_MSECS_DEFAULT;
156: if (strVal != null) {
157: try {
158: numVal = Long.parseLong(strVal);
159: } catch (Exception e) {
160: // just ignore
161: }
162: }
163: return numVal;
164: }
165:
166: public void setTimeout(long val) {
167: setAttribute(JMSOperation.ATTR_TIMEOUT,
168: JMSAttribute.JMS_OPERATION_TIMEOUT, "" + val);
169: }
170:
171: public String getClientID() {
172: return getAttribute(JMSAttribute.JMS_OPERATION_CLIENT_ID);
173: }
174:
175: public void setClientID(String val) {
176: setAttribute(JMSOperation.ATTR_CLIENT_ID,
177: JMSAttribute.JMS_OPERATION_CLIENT_ID, val);
178: }
179:
180: public String getMessageSelector() {
181: return getAttribute(JMSAttribute.JMS_OPERATION_MESSAGE_SELECTOR);
182: }
183:
184: public void setMessageSelector(String val) {
185: setAttribute(JMSOperation.ATTR_MESSAGE_SELECTOR,
186: JMSAttribute.JMS_OPERATION_MESSAGE_SELECTOR, val);
187: }
188:
189: public String getSubscriptionDurability() {
190: return getAttribute(JMSAttribute.JMS_OPERATION_SUBSCRIPTION_DURABILITY);
191: }
192:
193: public void setSubscriptionDurability(String val) {
194: setAttribute(JMSOperation.ATTR_SUBSCRIPTION_DURABILITY,
195: JMSAttribute.JMS_OPERATION_SUBSCRIPTION_DURABILITY, val);
196: }
197:
198: public String getSubscriptionName() {
199: return getAttribute(JMSAttribute.JMS_OPERATION_SUBSCRIPTION_NAME);
200: }
201:
202: public void setSubscriptionName(String val) {
203: setAttribute(JMSOperation.ATTR_SUBSCRIPTION_NAME,
204: JMSAttribute.JMS_OPERATION_SUBSCRIPTION_NAME, val);
205: }
206:
207: public int getBatchSize() {
208: String strVal = getAttribute(JMSAttribute.JMS_OPERATION_BATCH_SIZE);
209:
210: int numVal = JMSConstants.BATCH_SIZE_DEFAULT;
211: if (strVal != null) {
212: try {
213: numVal = Integer.parseInt(strVal);
214: } catch (Exception e) {
215: // just ignore
216: }
217: }
218: return numVal;
219: }
220:
221: public void setBatchSize(int val) {
222: setAttribute(JMSOperation.ATTR_BATCH_SZIE,
223: JMSAttribute.JMS_OPERATION_BATCH_SIZE, "" + val);
224: }
225:
226: public int getMaxConcurrentConsumers() {
227: String strVal = getAttribute(JMSAttribute.JMS_OPERATION_MAX_CONCURRENT_CONSUMERS);
228:
229: int numVal = -1;
230: if (strVal != null) {
231: try {
232: numVal = Integer.parseInt(strVal);
233: } catch (Exception e) {
234: // just ignore
235: }
236: }
237: return numVal;
238: }
239:
240: public void setMaxConcurrentConsumers(int val) {
241: setAttribute(JMSOperation.ATTR_MAX_CONCURRENT_CONSUMERS,
242: JMSAttribute.JMS_OPERATION_MAX_CONCURRENT_CONSUMERS, ""
243: + val);
244: }
245:
246: public String getRedeliveryHandling() {
247: return getAttribute(JMSAttribute.JMS_OPERATION_REDELIVERY_HANDLING);
248: }
249:
250: public void setRedeliveryHandling(String val) {
251: setAttribute(JMSOperation.ATTR_REDELIVERY_HANDLING,
252: JMSAttribute.JMS_OPERATION_REDELIVERY_HANDLING, val);
253: }
254:
255: public String getConcurrencyMode() {
256: return getAttribute(JMSAttribute.JMS_OPERATION_CONCURRENCY_MODE);
257: }
258:
259: public void setConcurrencyMode(String val) {
260: setAttribute(JMSOperation.ATTR_CONCURRENCY_MODE,
261: JMSAttribute.JMS_OPERATION_CONCURRENCY_MODE, val);
262:
263: }
264: }
|