01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2006 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU General Public License as published by the
09: * Free Software Foundation; either version 2 of the License, or (at your option)
10: * any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15: * for more details.
16: *
17: * You should have received a copy of the GNU General Public License along with
18: * this program; if not, write to the Free Software Foundation, Inc.,
19: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: *
21: *
22: * $Id$
23: */
24: package com.bostechcorp.cbesb.runtime.cbr;
25:
26: public class RoutingRuleElement {
27:
28: private String expressionType;
29: private String expression;
30: private TargetElement[] targets;
31:
32: public String getExpressionType() {
33: return expressionType;
34: }
35:
36: public void setExpressionType(String expressionType) {
37: this .expressionType = expressionType;
38: }
39:
40: public String getExpression() {
41: return expression;
42: }
43:
44: public void setExpression(String expression) {
45: this .expression = expression;
46: }
47:
48: public TargetElement[] getTargets() {
49: return targets;
50: }
51:
52: public void setTargets(TargetElement[] targets) {
53: this .targets = targets;
54: }
55:
56: public int size() {
57: if (targets == null) {
58: return 0;
59: } else {
60: return targets.length;
61: }
62: }
63:
64: public TargetElement getTargetServiceAtIndex(int index) {
65: TargetElement te = null;
66:
67: if (targets != null) {
68: if (index >= 0 && index < targets.length) {
69: te = targets[index];
70: }
71: }
72:
73: return te;
74: }
75:
76: public String toString() {
77: StringBuffer buffer = new StringBuffer();
78: buffer.append("\texpression = " + expression + "\n");
79: buffer.append("Count = " + size() + "\n");
80: for (int i = 0; i < size(); i++) {
81: buffer.append("TargetElement " + i + ":\n");
82: buffer.append(targets[i].toString());
83: }
84: return buffer.toString();
85: }
86: }
|