KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > jbi > management > systemstate > ComponentState


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2006 EBM Websourcing, http://www.ebmwebsourcing.com/
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * -------------------------------------------------------------------------
19  * $Id: ComponentState.java 154 28 avr. 2006 ofabre $
20  * -------------------------------------------------------------------------
21  */

22 package org.objectweb.petals.jbi.management.systemstate;
23
24 import org.objectweb.petals.util.StringHelper;
25
26 /**
27  *
28  * @author Olivier Fabre, Adrien LOUIS - EBM Websourcing
29  *
30  */

31 public class ComponentState {
32     private String JavaDoc archiveURL;
33
34     private String JavaDoc installState;
35
36     private String JavaDoc installURL;
37
38     private String JavaDoc lifecycleState;
39
40     private String JavaDoc name;
41
42     public ComponentState() {
43         super();
44     }
45
46     public ComponentState(String JavaDoc name, String JavaDoc installURL, String JavaDoc zipURL,
47         String JavaDoc installState, String JavaDoc lifecycleState) {
48         super();
49         this.name = name;
50         this.installURL = installURL;
51         this.archiveURL = zipURL;
52         this.installState = installState;
53         this.lifecycleState = lifecycleState;
54     }
55
56     public boolean equals(Object JavaDoc o) {
57         if (o instanceof ComponentState) {
58             ComponentState cc = (ComponentState) o;
59
60             return StringHelper.equal(name, cc.name)
61                 && StringHelper.equal(installURL, cc.installURL)
62                 && StringHelper.equal(archiveURL, cc.archiveURL)
63                 && StringHelper.equal(installState, cc.installState)
64                 && StringHelper.equal(lifecycleState, cc.lifecycleState);
65         } else {
66             return false;
67         }
68     }
69
70     public String JavaDoc getArchiveURL() {
71         return archiveURL;
72     }
73
74     public String JavaDoc getInstallState() {
75         return installState;
76     }
77
78     public String JavaDoc getInstallURL() {
79         return installURL;
80     }
81
82     public String JavaDoc getLifecycleState() {
83         return lifecycleState;
84     }
85
86     public String JavaDoc getName() {
87         return name;
88     }
89
90     public int hashCode() {
91         int hashCode = 0;
92         if (archiveURL != null) {
93             hashCode += archiveURL.hashCode();
94         }
95         if (installState != null) {
96             hashCode += installState.hashCode();
97         }
98         if (installURL != null) {
99             hashCode += installURL.hashCode();
100         }
101         if (lifecycleState != null) {
102             hashCode += lifecycleState.hashCode();
103         }
104         if (name != null) {
105             hashCode += name.hashCode();
106         }
107         return hashCode;
108     }
109
110     public void setArchiveURL(String JavaDoc zipURL) {
111         this.archiveURL = zipURL;
112     }
113
114     public void setInstallState(String JavaDoc installState) {
115         this.installState = installState;
116     }
117
118     public void setInstallURL(String JavaDoc installURL) {
119         this.installURL = installURL;
120     }
121
122     public void setLifecycleState(String JavaDoc lifecycleState) {
123         this.lifecycleState = lifecycleState;
124     }
125
126     public void setName(String JavaDoc name) {
127         this.name = name;
128     }
129 }
130
Popular Tags