001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)HelloAckInfo.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.binding.proxy;
030:
031: import com.sun.jbi.binding.proxy.connection.Event;
032:
033: import com.sun.jbi.binding.proxy.connection.EventInfo;
034:
035: import java.util.LinkedList;
036:
037: /**
038: * Represents a HelloAck message.
039: * @author Sun Microsystems, Inc
040: */
041: public class HelloAckInfo extends EventInfo {
042: private final long mLastTransitionTime;
043: private final long mBirthtime;
044: private final String mInstanceId;
045: private final LinkedList mMembers;
046: private final String mMasterId;
047: private final long mMasterBirthTime;
048:
049: public static final String EVENTNAME = "HelloAck";
050:
051: /**
052: * Constructor.
053: */
054: public HelloAckInfo(String id, long birthtime, long transitionTime,
055: String masterId, long masterBirthTime, LinkedList members) {
056: mInstanceId = id;
057: mBirthtime = birthtime;
058: mLastTransitionTime = transitionTime;
059: mMasterId = masterId;
060: mMasterBirthTime = masterBirthTime;
061: mMembers = members;
062: }
063:
064: public String getEventName() {
065: return (EVENTNAME);
066: }
067:
068: /**
069: * Accessor for Birthtime.
070: * @return long containing the Birthtime.
071: */
072: public long getBirthtime() {
073: return (mBirthtime);
074: }
075:
076: /**
077: * Accessor for InstanceId.
078: * @return String containing the instanceId.
079: */
080: public String getInstanceId() {
081: return (mInstanceId);
082: }
083:
084: /**
085: * Accessor for MasterId.
086: * @return String containing the masterId.
087: */
088: public String getMasterId() {
089: return (mMasterId);
090: }
091:
092: /**
093: * Accessor for MasterBirthTime.
094: * @return long containing the masterBirthTime.
095: */
096: public long getMasterBirthTime() {
097: return (mMasterBirthTime);
098: }
099:
100: /**
101: * Accessor for Members.
102: * @return LinkedList containing the members of this instance.
103: */
104: public LinkedList getMembers() {
105: return (mMembers);
106: }
107:
108: /**
109: * Accessor for LastTransitionTime.
110: * @return String containing the InstanceId.
111: */
112: public long getLastTransitionTime() {
113: return (mLastTransitionTime);
114: }
115:
116: public HelloAckInfo(Event event)
117: throws com.sun.jbi.binding.proxy.connection.EventException {
118: super (event);
119: mInstanceId = event.getString();
120: mLastTransitionTime = event.getLong();
121: mBirthtime = event.getLong();
122: mMasterId = event.getString();
123: mMasterBirthTime = event.getLong();
124: mMembers = (LinkedList) event.getObject();
125: }
126:
127: public void encodeEvent(Event event)
128: throws com.sun.jbi.binding.proxy.connection.EventException {
129: event.putString(mInstanceId);
130: event.putLong(mLastTransitionTime);
131: event.putLong(mBirthtime);
132: event.putString(mMasterId);
133: event.putLong(mMasterBirthTime);
134: event.putObject(mMembers);
135: }
136: }
|