View Javadoc

1   /*
2    * Copyright 2001-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.jdiagnose.remote;
18  
19  import org.jdiagnose.RemoteResult;
20  import org.jdiagnose.ResultInfo;
21  
22  /***
23   * @author jmccrindle
24   */
25  public class DefaultRemoteResult implements RemoteResult {
26  
27      private String guid = null;
28      private ResultInfo resultInfo = null;
29      private String agent = null;
30      private String host = null;
31      private long sequenceNumber = 0L;
32  
33      public DefaultRemoteResult() {
34          
35      }
36      
37      /***
38       * @param resultInfo
39       * @param agent
40       * @param host
41       */
42      public DefaultRemoteResult(String guid, ResultInfo resultInfo, String agent, String host, long sequenceNumber) {
43          this.resultInfo = resultInfo;
44          this.agent = agent;
45          this.host = host;
46          this.guid = guid;
47          this.sequenceNumber = sequenceNumber;
48      }
49  
50      /* (non-Javadoc)
51       * @see org.jdiagnose.runtime.RemoteResult#getResultInfo()
52       */
53      public ResultInfo getResultInfo() {
54          return resultInfo;
55      }
56  
57      /* (non-Javadoc)
58       * @see org.jdiagnose.runtime.RemoteResult#getAgent()
59       */
60      public String getAgent() {
61          return agent;
62      }
63  
64      /* (non-Javadoc)
65       * @see org.jdiagnose.runtime.RemoteResult#getHost()
66       */
67      public String getHost() {
68          return host;
69      }
70  
71      public String getGuid() {
72          return guid;
73      }
74      
75      /* (non-Javadoc)
76       * @see java.lang.Object#toString()
77       */
78      public String toString() {
79          return "{" + guid + ", " + host + ", " + agent + ", " + resultInfo.toString() + "}";
80      }
81      
82      /***
83       * @return Returns the sequenceNumber.
84       */
85      public long getSequenceNumber() {
86          return sequenceNumber;
87      }
88  }