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.common.sa.service;
25:
26: import java.util.Properties;
27:
28: public class EndPoint {
29: protected Properties settings = new Properties();
30: protected String name = "";
31: protected String role = "";
32:
33: public String getName() {
34: return name;
35: }
36:
37: public void setName(String name) {
38: if (name != null)
39: this .name = name;
40: }
41:
42: public String getRole() {
43: return role;
44: }
45:
46: public void setRole(String role) {
47: this .role = role;
48: }
49:
50: public Properties getSettings() {
51: return settings;
52: }
53:
54: public void addSetting(String key, boolean value) {
55: if (key == null)
56: return;
57: Boolean flag = new Boolean(value);
58: settings.setProperty(key, flag.toString());
59: }
60:
61: public void addSetting(String key, String value) {
62: if (key == null || value == null)
63: return;
64: settings.setProperty(key, value);
65: }
66:
67: public EndPoint() {
68: super ();
69:
70: }
71:
72: public boolean isProvider() {
73: return this .getRole().equalsIgnoreCase(
74: PropertiesKey.ROLE_PROVIDER);
75: }
76:
77: public boolean isConumer() {
78: return this.getRole().equalsIgnoreCase(
79: PropertiesKey.ROLE_CONSUMER);
80: }
81:
82: }
|