KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jmanage > core > config > ApplicationClusterConfig


1 /**
2  * Copyright 2004-2005 jManage.org
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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  */

16 package org.jmanage.core.config;
17
18 import java.util.List JavaDoc;
19 import java.util.LinkedList JavaDoc;
20
21 /**
22  *
23  * date: Sep 15, 2004
24  * @author Rakesh Kalra
25  */

26 public class ApplicationClusterConfig extends ApplicationConfig {
27
28     private List JavaDoc applications = new LinkedList JavaDoc();
29
30     public ApplicationClusterConfig(String JavaDoc id, String JavaDoc name){
31         setApplicationId(id);
32         setName(name);
33     }
34
35     /**
36      * @return true
37      */

38     public boolean isCluster(){
39         return true;
40     }
41
42     /**
43      * This method returns a list of applications in this cluster.
44      *
45      * @return list of applications in this cluster
46      */

47     public List JavaDoc getApplications(){
48         return applications;
49     }
50
51     public void setApplications(List JavaDoc appConfigList) {
52         this.applications = appConfigList;
53     }
54
55     /**
56      * Adds a application to this cluster.
57      *
58      * @param config ApplicationConfig to be added to this cluster
59      */

60     public void addApplication(ApplicationConfig config){
61         applications.add(config);
62     }
63
64     public void addAllApplications(List JavaDoc appConfigList){
65         applications.addAll(appConfigList);
66     }
67
68     /**
69      * Removes the application from the cluster.
70      *
71      * @param config
72      * @return true: if the application was removed from the cluster
73      */

74     public boolean removeApplication(ApplicationConfig config){
75         return applications.remove(config);
76     }
77
78 }
79
Popular Tags