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: * @(#)ProvisioningEndpointStatisticsData.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.esb.management.common.data;
030:
031: import java.io.Serializable;
032: import java.util.Date;
033:
034: /**
035: * Provides Provisioning Endpoint Statistics
036: *
037: * @author graj
038: */
039: public class ProvisioningEndpointStatisticsData extends
040: EndpointStatisticsData implements IEndpointStatisticsData,
041: Serializable {
042: static final long serialVersionUID = -1L;
043:
044: public static final String ACTIVATION_TIME_KEY = "ActivationTime";
045:
046: public static final String UPTIME_KEY = "EndpointUpTime (ms)";
047:
048: public static final String NUM_RECEIVED_REQUESTS_KEY = "NumReceivedRequests";
049:
050: public static final String NUM_SENT_REPLIES_KEY = "NumSentReplies";
051:
052: public static final String ME_RESPONSE_TIME_AVG_KEY = "MessageExchangeResponseTime Avg (ns)";
053:
054: protected Date activationTime;
055:
056: protected long uptime;
057:
058: protected long numberOfReceivedRequests;
059:
060: protected long numberOfSentReplies;
061:
062: protected long messageExchangeResponseTimeAverage;
063:
064: /** Constructor - creates a ProvisioningEndpointStatisticsData object */
065: public ProvisioningEndpointStatisticsData() {
066: this .isProvisioningEndpoint = true;
067: }
068:
069: /**
070: * Constructor - creates a ProvisioningEndpointStatisticsData object
071: *
072: * @param endpointData
073: */
074: public ProvisioningEndpointStatisticsData(
075: EndpointStatisticsData endpointData) {
076: super (endpointData);
077: this .isProvisioningEndpoint = true;
078: ProvisioningEndpointStatisticsData data = (ProvisioningEndpointStatisticsData) endpointData;
079: this .setActivationTime(data.getActivationTime());
080: this .setUptime(data.getUptime());
081: this .setNumberOfReceivedRequests(data
082: .getNumberOfReceivedRequests());
083: this .setNumberOfSentReplies(data.getNumberOfSentReplies());
084: this .setMessageExchangeResponseTimeAverage(data
085: .getMessageExchangeResponseTimeAverage());
086: }
087:
088: /**
089: * @return the activationTime
090: */
091: public Date getActivationTime() {
092: return this .activationTime;
093: }
094:
095: /**
096: * @param activationTime
097: * the activationTime to set
098: */
099: public void setActivationTime(Date activationTime) {
100: this .activationTime = activationTime;
101: }
102:
103: /**
104: * @return the uptime
105: */
106: public long getUptime() {
107: return this .uptime;
108: }
109:
110: /**
111: * @param uptime
112: * the uptime to set
113: */
114: public void setUptime(long uptime) {
115: this .uptime = uptime;
116: }
117:
118: /**
119: * @return the numberOfReceivedRequests
120: */
121: public long getNumberOfReceivedRequests() {
122: return this .numberOfReceivedRequests;
123: }
124:
125: /**
126: * @param numberOfReceivedRequests
127: * the numberOfReceivedRequests to set
128: */
129: public void setNumberOfReceivedRequests(
130: long numberOfReceivedRequests) {
131: this .numberOfReceivedRequests = numberOfReceivedRequests;
132: }
133:
134: /**
135: * @return the numberOfSentReplies
136: */
137: public long getNumberOfSentReplies() {
138: return this .numberOfSentReplies;
139: }
140:
141: /**
142: * @param numberOfSentReplies
143: * the numberOfSentReplies to set
144: */
145: public void setNumberOfSentReplies(long numberOfSentReplies) {
146: this .numberOfSentReplies = numberOfSentReplies;
147: }
148:
149: /**
150: * @return the messageExchangeResponseTimeAverage
151: */
152: public long getMessageExchangeResponseTimeAverage() {
153: return this .messageExchangeResponseTimeAverage;
154: }
155:
156: /**
157: * @param messageExchangeResponseTimeAverage
158: * the messageExchangeResponseTimeAverage to set
159: */
160: public void setMessageExchangeResponseTimeAverage(
161: long messageExchangeResponseTimeAverage) {
162: this .messageExchangeResponseTimeAverage = messageExchangeResponseTimeAverage;
163: }
164:
165: /**
166: * Return a displayable string of values
167: *
168: * @return
169: */
170: public String getDisplayString() {
171: StringBuffer buffer = new StringBuffer();
172: buffer.append("\n Activation Time" + "="
173: + this .getActivationTime());
174: buffer.append("\n Uptime" + "=" + this .getUptime());
175: buffer.append("\n Number Of Received Requests" + "="
176: + this .getNumberOfReceivedRequests());
177: buffer.append("\n Number Of Sent Replies" + "="
178: + this .getNumberOfSentReplies());
179: buffer.append("\n Message Exchange Response Time Average"
180: + "=" + this .getMessageExchangeResponseTimeAverage());
181: buffer.append(super .getDisplayString());
182: buffer.append("\n");
183: return buffer.toString();
184: }
185:
186: /**
187: * @param args
188: */
189: public static void main(String[] args) {
190: // TODO Auto-generated method stub
191:
192: }
193:
194: }
|