001: /**
002: * Sequoia: Database clustering technology.
003: * Copyright (C) 2002-2004 French National Institute For Research In Computer
004: * Science And Control (INRIA).
005: * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
006: * Copyright (C) 2006 Continuent, Inc.
007: * Contact: sequoia@continuent.org
008: *
009: * Licensed under the Apache License, Version 2.0 (the "License");
010: * you may not use this file except in compliance with the License.
011: * You may obtain a copy of the License at
012: *
013: * http://www.apache.org/licenses/LICENSE-2.0
014: *
015: * Unless required by applicable law or agreed to in writing, software
016: * distributed under the License is distributed on an "AS IS" BASIS,
017: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018: * See the License for the specific language governing permissions and
019: * limitations under the License.
020: *
021: * Initial developer(s): Nicolas Modrzyk
022: * Contributor(s): Emmanuel Cecchet.
023: */package org.continuent.sequoia.controller.virtualdatabase.protocol;
024:
025: import java.io.Serializable;
026:
027: import org.continuent.hedera.common.Member;
028: import org.continuent.sequoia.controller.virtualdatabase.DistributedVirtualDatabase;
029:
030: /**
031: * This class defines a ControllerInformation class to send to new group members
032: *
033: * @author <a href="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
034: * @author <a href="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
035: */
036: public class ControllerInformation extends
037: DistributedVirtualDatabaseMessage {
038: private static final long serialVersionUID = -2380753151132303045L;
039:
040: private String controllerName;
041: private String jmxName;
042: private long controllerId;
043:
044: /**
045: * Creates a new <code>ControllerInformation</code> object
046: *
047: * @param controllerName the controller name
048: * @param controllerJmxName the jmx name of the controller
049: * @param controllerId the controller identifier
050: */
051: public ControllerInformation(String controllerName,
052: String controllerJmxName, long controllerId) {
053: this .controllerName = controllerName;
054: this .jmxName = controllerJmxName;
055: this .controllerId = controllerId;
056: }
057:
058: /**
059: * Returns the controllerId value.
060: *
061: * @return Returns the controllerId.
062: */
063: public final long getControllerId() {
064: return controllerId;
065: }
066:
067: /**
068: * @return Returns the controllerName.
069: */
070: public String getControllerName() {
071: return controllerName;
072: }
073:
074: /**
075: * @param controllerName The controllerName to set.
076: */
077: public void setControllerName(String controllerName) {
078: this .controllerName = controllerName;
079: }
080:
081: /**
082: * Returns the jmxName value.
083: *
084: * @return Returns the jmxName.
085: */
086: public String getJmxName() {
087: return jmxName;
088: }
089:
090: /**
091: * Sets the jmxName value.
092: *
093: * @param jmxName The jmxName to set.
094: */
095: public void setJmxName(String jmxName) {
096: this .jmxName = jmxName;
097: }
098:
099: /**
100: * @see org.continuent.sequoia.controller.virtualdatabase.protocol.DistributedVirtualDatabaseMessage#handleMessageSingleThreaded(org.continuent.sequoia.controller.virtualdatabase.DistributedVirtualDatabase,
101: * org.continuent.hedera.common.Member)
102: */
103: public Object handleMessageSingleThreaded(
104: DistributedVirtualDatabase dvdb, Member sender) {
105: return null;
106: }
107:
108: /**
109: * @see org.continuent.sequoia.controller.virtualdatabase.protocol.DistributedVirtualDatabaseMessage#handleMessageMultiThreaded(org.continuent.sequoia.controller.virtualdatabase.DistributedVirtualDatabase,
110: * org.continuent.hedera.common.Member, java.lang.Object)
111: */
112: public Serializable handleMessageMultiThreaded(
113: DistributedVirtualDatabase dvdb, Member sender,
114: Object handleMessageSingleThreadedResult) {
115: dvdb.addRemoteControllerJmxName(sender, jmxName);
116: dvdb.addRemoteControllerId(sender, controllerId);
117: return Boolean.TRUE;
118: }
119: }
|