1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 }