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  package org.jdiagnose.remote;
17  
18  import org.jdiagnose.RemoteResult;
19  import org.jdiagnose.ResultInfo;
20  
21  /***
22   * Represents information about an agent, including the host name and agent 
23   * name. It is also used to createRemoteResults, provide Guid's and SequenceNumbers.
24   * @author jmccrindle
25   */
26  public interface Agent {
27      
28      /***
29       * @return The host that the agent is running on.
30       */
31      String getHost();
32      
33      /***
34       * @return The agent that the diagnostics are running in
35       */
36      String getAgent();
37      
38      /***
39       * @return The next sequence number for this agent
40       */
41      long nextSequenceNumber();
42      
43      /***
44       * @return a globally unique identifier
45       */
46      String nextGuid();
47      
48      /***
49       * Creates a remote result from a regular result
50       * @param result the result to wrap
51       * @return a remote result with agent, host, guid and sequenceNumber set.
52       */
53      RemoteResult createRemoteResult(ResultInfo result);
54  }