KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > continuent > sequoia > controller > virtualdatabase > protocol > ControllerInformation


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
6  * Copyright (C) 2006 Continuent, Inc.
7  * Contact: sequoia@continuent.org
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Initial developer(s): Nicolas Modrzyk
22  * Contributor(s): Emmanuel Cecchet.
23  */

24
25 package org.continuent.sequoia.controller.virtualdatabase.protocol;
26
27 import java.io.Serializable JavaDoc;
28
29 import org.continuent.hedera.common.Member;
30 import org.continuent.sequoia.controller.virtualdatabase.DistributedVirtualDatabase;
31
32 /**
33  * This class defines a ControllerInformation class to send to new group members
34  *
35  * @author <a HREF="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
36  * @author <a HREF="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
37  */

38 public class ControllerInformation extends DistributedVirtualDatabaseMessage
39 {
40   private static final long serialVersionUID = -2380753151132303045L;
41
42   private String JavaDoc controllerName;
43   private String JavaDoc jmxName;
44   private long controllerId;
45
46   /**
47    * Creates a new <code>ControllerInformation</code> object
48    *
49    * @param controllerName the controller name
50    * @param controllerJmxName the jmx name of the controller
51    * @param controllerId the controller identifier
52    */

53   public ControllerInformation(String JavaDoc controllerName, String JavaDoc controllerJmxName,
54       long controllerId)
55   {
56     this.controllerName = controllerName;
57     this.jmxName = controllerJmxName;
58     this.controllerId = controllerId;
59   }
60
61   /**
62    * Returns the controllerId value.
63    *
64    * @return Returns the controllerId.
65    */

66   public final long getControllerId()
67   {
68     return controllerId;
69   }
70
71   /**
72    * @return Returns the controllerName.
73    */

74   public String JavaDoc getControllerName()
75   {
76     return controllerName;
77   }
78
79   /**
80    * @param controllerName The controllerName to set.
81    */

82   public void setControllerName(String JavaDoc controllerName)
83   {
84     this.controllerName = controllerName;
85   }
86
87   /**
88    * Returns the jmxName value.
89    *
90    * @return Returns the jmxName.
91    */

92   public String JavaDoc getJmxName()
93   {
94     return jmxName;
95   }
96
97   /**
98    * Sets the jmxName value.
99    *
100    * @param jmxName The jmxName to set.
101    */

102   public void setJmxName(String JavaDoc jmxName)
103   {
104     this.jmxName = jmxName;
105   }
106
107   /**
108    * @see org.continuent.sequoia.controller.virtualdatabase.protocol.DistributedVirtualDatabaseMessage#handleMessageSingleThreaded(org.continuent.sequoia.controller.virtualdatabase.DistributedVirtualDatabase,
109    * org.continuent.hedera.common.Member)
110    */

111   public Object JavaDoc handleMessageSingleThreaded(DistributedVirtualDatabase dvdb,
112       Member sender)
113   {
114     return null;
115   }
116
117   /**
118    * @see org.continuent.sequoia.controller.virtualdatabase.protocol.DistributedVirtualDatabaseMessage#handleMessageMultiThreaded(org.continuent.sequoia.controller.virtualdatabase.DistributedVirtualDatabase,
119    * org.continuent.hedera.common.Member, java.lang.Object)
120    */

121   public Serializable JavaDoc handleMessageMultiThreaded(
122       DistributedVirtualDatabase dvdb, Member sender,
123       Object JavaDoc handleMessageSingleThreadedResult)
124   {
125     dvdb.addRemoteControllerJmxName(sender, jmxName);
126     dvdb.addRemoteControllerId(sender, controllerId);
127     return Boolean.TRUE;
128   }
129 }
Popular Tags