01: /**
02: * Copyright 2004-2005 jManage.org
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */package org.jmanage.core.config;
16:
17: import java.util.List;
18: import java.util.LinkedList;
19:
20: /**
21: *
22: * date: Sep 15, 2004
23: * @author Rakesh Kalra
24: */
25: public class ApplicationClusterConfig extends ApplicationConfig {
26:
27: private List applications = new LinkedList();
28:
29: public ApplicationClusterConfig(String id, String name) {
30: setApplicationId(id);
31: setName(name);
32: }
33:
34: /**
35: * @return true
36: */
37: public boolean isCluster() {
38: return true;
39: }
40:
41: /**
42: * This method returns a list of applications in this cluster.
43: *
44: * @return list of applications in this cluster
45: */
46: public List getApplications() {
47: return applications;
48: }
49:
50: public void setApplications(List appConfigList) {
51: this .applications = appConfigList;
52: }
53:
54: /**
55: * Adds a application to this cluster.
56: *
57: * @param config ApplicationConfig to be added to this cluster
58: */
59: public void addApplication(ApplicationConfig config) {
60: applications.add(config);
61: }
62:
63: public void addAllApplications(List appConfigList) {
64: applications.addAll(appConfigList);
65: }
66:
67: /**
68: * Removes the application from the cluster.
69: *
70: * @param config
71: * @return true: if the application was removed from the cluster
72: */
73: public boolean removeApplication(ApplicationConfig config) {
74: return applications.remove(config);
75: }
76:
77: }
|