View Javadoc

1   /*
2   * The contents of this file are subject to the BT "ZEUS" Open Source 
3   * Licence (L77741), Version 1.0 (the "Licence"); you may not use this file 
4   * except in compliance with the Licence. You may obtain a copy of the Licence
5   * from $ZEUS_INSTALL/licence.html or alternatively from
6   * http://www.labs.bt.com/projects/agents/zeus/licence.htm
7   * 
8   * Except as stated in Clause 7 of the Licence, software distributed under the
9   * Licence is distributed WITHOUT WARRANTY OF ANY KIND, either express or 
10  * implied. See the Licence for the specific language governing rights and 
11  * limitations under the Licence.
12  * 
13  * The Original Code is within the package zeus.*.
14  * The Initial Developer of the Original Code is British Telecommunications
15  * public limited company, whose registered office is at 81 Newgate Street, 
16  * London, EC1A 7AJ, England. Portions created by British Telecommunications 
17  * public limited company are Copyright 1996-9. All Rights Reserved.
18  * 
19  * THIS NOTICE MUST BE INCLUDED ON ANY COPY OF THIS FILE
20  */
21  
22  
23  
24  package zeus.concepts;
25  
26  import java.io.*;
27  import java.util.*;
28  import zeus.util.*;
29  
30  /***
31      Address is a pure virtual class because we need to deal with Zeus based 
32      port and socket addressing, and FIPA GUI addressing, and any bizzar LEAP or 
33      Biz talk addressing that is implemented in the future 
34      */
35  public interface Address {
36      /***
37          getName returns the name of the agent that has this address
38          */
39     public abstract String getName(); 
40     
41        
42     /***
43      set the name field
44      */
45     public abstract void setName(String val); 
46     
47     /***
48      getHost returns the name of the host that the agent that has this address is 
49      currently present on
50      */
51     public abstract String getHost();
52     
53     /***
54      getType is a Zeus specific method, in Zeus it is used to denote "ANS" or "FACILITATOR".
55      Non Zeus agents should be typed as "FIPA-IIOP" or 
56      "LEAP" for example. Other types of agent may be implemented if other addressing 
57      is used i.e. "LDAP" 
58      */
59     public abstract String getType();
60     
61     /***
62      getPort returns the port that is listened to by the transport mechanism for the agent 
63      in the case of FIPA-IIOP agents this will generally be "900", as this is the default IIOP 
64      port number, FIPA-HTTP agents the port number might be "8080" for instance
65      */
66     public abstract int    getPort();
67     
68     /***
69       is this the same as another address? 
70       The behaviour should be that if a FIPA-IIOP agent of name X is present on host Y and 
71       also there is a FIPA-HTTP X,Y then FIPA-IIOP == FIPA-HTTP  (if you follow my thread)
72       
73       However, since the implementation is left to others don't be surprised if this always returns
74       false or something dumb like that...
75       */
76     public abstract boolean equals(Address addr );
77     
78     /***
79      returns true if these two agents share a machine and port - ie. they both live at the 
80      same address.... ahhh sweeeet.
81      */
82     public abstract boolean sameAddress (Address addr);
83     
84     /***
85      produce a nice string version of the address. 
86      The string produced MUST be in a format that can be parsed.
87      */
88     public abstract String toString();
89     
90     /*** 
91      *allow the type to be manipulated
92      */
93     public abstract void setType (String type);
94  }