fipaos.mts
Class IOR
- public class IOR
The IOR class is used to model a CORBA IOR. It allows the retrieval and
storage of the component parts of an IOR and the construction and parsing
of 'stringified' IORs that can be used in the stringToObject
methods of an ORB.
Constructor Summary |
IOR(String hex_ior) Constructs an IOR object from a stringified IOR. |
IOR(String IDL, String host, int port, String object_key) Constructs an IOR object using the information specified. |
IOR(String IDL, List hosts, List ports, List object_keys) Constructs an IOR object with multiple profiles using the information specified. |
Method Summary |
int | addProfile(String host, int port, String object_key) Adds a new profile to the IOR containing the specified information. |
String | getHost() Returns the host name of the current profile of the IOR. |
String | getHost(int profile) Returns the host name of the indicated profile of the IOR. |
String | getIDL() Returns the IDL currently in use by this IOR. |
String | getObjectKey() Returns the object key of the current profile of the IOR. |
String | getObjectKey(int profile) Returns the object key of the indicated profile of the IOR. |
int | getPort() Returns the port number of the current profile of the IOR. |
int | getPort(int profile) Returns the port of the indicated profile of the IOR. |
int | getProfileCount() Returns the number of profiles currently in the IOR. |
String | getTag() Returns the profile type tag of the current profile of the IOR. |
String | getTag(int profile) Returns the profile type tag of the indicated profile of the IOR. |
int | insertProfile(int profile, String host, int port, String object_key) Inserts a new profile to the IOR containing the specified information into the specified
profile position. |
boolean | isBigEndian() Indicates whether this IOR is encoded in a big or little endian way. |
void | isBigEndian(boolean endian) Sets the endianness of this IOR. |
static void | main(String[] args) When run from the command line this class will load an IOR from the
file specified as an argument, parse it and echo the results back
to STDOUT. |
int | removeProfile(int profile) Removes the specified profile from the IOR. |
void | setHost(String host) Sets the host name for the current profile of the IOR. |
void | setHost(int profile, String host) Sets the host name for the indicated profile of the IOR. |
void | setIDL(String idl) Sets the IDL to use for this IOR. |
void | setObjectKey(String obj_key) Sets the object key for the current profile of the IOR. |
void | setObjectKey(int profile, String obj_key) Sets the object key for the indicated profile of the IOR. |
void | setPort(int port) Sets the port for the current profile of the IOR. |
void | setPort(int profile, int port) Sets the port for the indicated profile of the IOR. |
void | setTag(String tag) Sets the profile type tag for the current profile of the IOR. |
void | setTag(int profile, String tag) Sets the profile type tag for the indicated profile of the IOR. |
String | toString() Converts the IOR object to a hexadecimal CDR 'stringified' representation, suitable
for transmission to other ORBs. |
TAG_GIOP
public final static String TAG_GIOP
TAG_IIOP
public final static String TAG_IIOP
IOR
public IOR(String hex_ior)
- Constructs an IOR object from a stringified IOR. Stringified IORs are
returned by ORBs as an easily transmissable form of an IOR, usually
by calling the objectToString()
method. They are large
strings of hexadecimal characters and begin with 'IOR:'.- Parameters:
- A - hexadecimal string representing a stringified IOR.
IOR
public IOR(String IDL, String host, int port, String object_key)
- Constructs an IOR object using the information specified.
- Parameters:
- IDL - The IDL that is to be used for the IOR. This will be a
string name, for example: 'IDL:FIPA_Agent_97'- host - The host name or IP address of the machine that this IOR represents
e.g. host.domain.com- port - The port of the target machine
- object_key - The object key section of the actual IOR of the target object.
Object keys are ORB specific so this must be supplied by retrieving it
from the ORB used to create the original IOR. It can be retrieved either
by method call on the ORB, or by parsing a stringified IOR.
IOR
public IOR(String IDL, List hosts, List ports, List object_keys)
- Constructs an IOR object with multiple profiles using the information specified.
Multiple profile IORs are very uncommon. The lists passed as parameters must
have the corresponding sections for each profile in the correct position in each list
and all lists must have the same number of elements.- Parameters:
- IDL - The IDL that is to be used for the IOR. This will be a
string name, for example: 'IDL:FIPA_Agent_97'- hosts - A list of host names or IP address of the machine that this IOR represents
e.g. host.domain.com- port - A list of ports of the target machine
- object_key - A list of object key sections of the actual IOR of the target object.
Object keys are ORB specific so this must be supplied by retrieving it
from the ORB used to create the original IOR. It can be retrieved either
by method call on the ORB, or by parsing a stringified IOR.
addProfile
public int addProfile(String host, int port, String object_key)
- Adds a new profile to the IOR containing the specified information. The new
profile is added to the end of the profile chain, and has an index number equal to the
total number of profiles currently in the IOR. The index number is incremented after
addition to reflect the inclusion of the new profile.- Parameters:
- host - The host name or IP address to use in this profile
- port - The port number to use in this profile
- object_key - The object key to use in this profile
- Returns: The number of profiles now present in the IOR (including the one just added)
getHost
public String getHost()
- Returns the host name of the current profile of the IOR. If only one profile is
in use (most cases) then the host name for the whole IOR is returned. For a multiple
profile IOR, then the host name of the latest profile to be added (i.e. the one with the
highest index number) is returned.- Returns: The host name of the IOR, or of the current IOR profile
getHost
public String getHost(int profile)
- Returns the host name of the indicated profile of the IOR.
- Parameters:
- profile - The index number of the profile to access
- Returns: The host name of the indicated IOR profile
getIDL
public String getIDL()
- Returns the IDL currently in use by this IOR. This will be the same
for all profiles in the IOR.- Returns: The IDL used in this IOR
getObjectKey
public String getObjectKey()
- Returns the object key of the current profile of the IOR. If only one profile is
in use (most cases) then the object key for the whole IOR is returned. For a multiple
profile IOR, then the object key of the latest profile to be added (i.e. the one with the
highest index number) is returned.- Returns: The object key of the IOR, or of the current IOR profile
getObjectKey
public String getObjectKey(int profile)
- Returns the object key of the indicated profile of the IOR.
- Parameters:
- profile - The index number of the profile to access
- Returns: The object key of the indicated IOR profile
getPort
public int getPort()
- Returns the port number of the current profile of the IOR. If only one profile is
in use (most cases) then the port for the whole IOR is returned. For a multiple
profile IOR, then the port of the latest profile to be added (i.e. the one with the
highest index number) is returned.- Returns: The port of the IOR, or of the current IOR profile
getPort
public int getPort(int profile)
- Returns the port of the indicated profile of the IOR.
- Parameters:
- profile - The index number of the profile to access
- Returns: The port of the indicated IOR profile
getProfileCount
public int getProfileCount()
- Returns the number of profiles currently in the IOR.
- Returns: The profile count
getTag
public String getTag()
- Returns the profile type tag of the current profile of the IOR. If only one profile is
in use (most cases) then the profile type tag for the whole IOR is returned. For a multiple
profile IOR, then the profile type tag of the latest profile to be added (i.e. the one with the
highest index number) is returned.- Returns: The profile type tag of the IOR, or of the current IOR profile
getTag
public String getTag(int profile)
- Returns the profile type tag of the indicated profile of the IOR.
- Parameters:
- profile - The index number of the profile to access
- Returns: The profile type tag of the indicated IOR profile
insertProfile
public int insertProfile(int profile, String host, int port, String object_key)
- Inserts a new profile to the IOR containing the specified information into the specified
profile position. The new profile is inserted into the profile chain at the index
number specified and all of the profiles following it are re-indexed.- Parameters:
- profile - The index number at which to insert this profile
- host - The host name or IP address to use in this profile
- port - The port number to use in this profile
- object_key - The object key to use in this profile
- Returns: The number of profiles now present in the IOR (including the one just inserted)
isBigEndian
public boolean isBigEndian()
- Indicates whether this IOR is encoded in a big or little endian way.
- Returns: True if the IOR is big endian, false otherwise
isBigEndian
public void isBigEndian(boolean endian)
- Sets the endianness of this IOR.
- Parameters:
- The - endianness flag- true is big endian, false is little endian
main
public static void main(String[] args)
- When run from the command line this class will load an IOR from the
file specified as an argument, parse it and echo the results back
to STDOUT. This is useful as a debugging tool, as it can show you the
IORs contents in a human readable form. A second optional argument
can be given - verbose mode (-v) - which prints out more information.
removeProfile
public int removeProfile(int profile)
- Removes the specified profile from the IOR. After removal, all of the other
profiles in the IOR are renumbered to reflect their new positions (if they have moved).
The number of profiles left in the IOR is returned by this method.- Parameters:
- profile - The index number of the profile to remove
- Returns: The number of profile left in the IOR after the removal operation
setHost
public void setHost(String host)
- Sets the host name for the current profile of the IOR. If only one
profile is used (in most cases) then this sets the host name for the IOR. If more than
one profile is in use, then this method sets the host name for the latest profile to be
added to the IOR (i.e. the one with the highest index number).
If the IOR was constructed from a stringified IOR then when the toString
method of this IOR is called then the hex output will be modified to show the new
host name.- Parameters:
- host - The host name (or IP address) to set in the IOR
setHost
public void setHost(int profile, String host)
- Sets the host name for the indicated profile of the IOR.
If the IOR was constructed from a stringified IOR then when the toString
method of this IOR is called then the hex output will be modified to show the new
host name.- Parameters:
- profile - The index number of the profile to modify in this IOR
- host - The host name (or IP address) to set in the IOR
setIDL
public void setIDL(String idl)
- Sets the IDL to use for this IOR. If the IOR was constructed from a stringified
IOR then when the toString
method of this IOR is called, the hex
output will have been modified to list the new IDL name. This IDL will be the same
for all profiles in the IOR.- Parameters:
- idl - The IDL to use for this IOR
setObjectKey
public void setObjectKey(String obj_key)
- Sets the object key for the current profile of the IOR. If only one
profile is used (in most cases) then this sets the object key for the IOR. If more than
one profile is in use, then this method sets the object key for the latest profile to be
added to the IOR (i.e. the one with the highest index number).
If the IOR was constructed from a stringified IOR then when the toString
method of this IOR is called then the hex output will be modified to show the new
object key.- Parameters:
- obj_key - The object key to set in the IOR
setObjectKey
public void setObjectKey(int profile, String obj_key)
- Sets the object key for the indicated profile of the IOR.
If the IOR was constructed from a stringified IOR then when the toString
method of this IOR is called then the hex output will be modified to show the new
object key.- Parameters:
- profile - The index number of the profile to modify in this IOR
- obj_key - The object key to set in the IOR
setPort
public void setPort(int port)
- Sets the port for the current profile of the IOR. If only one
profile is used (in most cases) then this sets the port for the IOR. If more than
one profile is in use, then this method sets the port for the latest profile to be
added to the IOR (i.e. the one with the highest index number).
If the IOR was constructed from a stringified IOR then when the toString
method of this IOR is called then the hex output will be modified to show the new
port.- Parameters:
- port - The port number to set in the IOR
setPort
public void setPort(int profile, int port)
- Sets the port for the indicated profile of the IOR.
If the IOR was constructed from a stringified IOR then when the toString
method of this IOR is called then the hex output will be modified to show the new
port.- Parameters:
- profile - The index number of the profile to modify in this IOR
- port - The port to set in the IOR
setTag
public void setTag(String tag)
- Sets the profile type tag for the current profile of the IOR. If only one
profile is used (in most cases) then this sets the profile type tag for the IOR. If more than
one profile is in use, then this method sets the profile type tag for the latest profile to be
added to the IOR (i.e. the one with the highest index number).
If the IOR was constructed from a stringified IOR then when the toString
method of this IOR is called then the hex output will be modified to show the new
profile type tag.- Parameters:
- tag - The profile type tag to set in the IOR
setTag
public void setTag(int profile, String tag)
- Sets the profile type tag for the indicated profile of the IOR.
If the IOR was constructed from a stringified IOR then when the toString
method of this IOR is called then the hex output will be modified to show the new
profile type tag.- Parameters:
- profile - The index number of the profile to modify in this IOR
- tag - The profile type tag to set in the IOR
toString
public String toString()
- Converts the IOR object to a hexadecimal CDR 'stringified' representation, suitable
for transmission to other ORBs. This representation is properly encoded and can
be used in the stringToObject
methods of ORBs in order to invoke
remote method calls on the object represented by this IOR.- Returns: A stringified representation of this IOR
to Class java.lang.String
to Class java.lang.String
to Class java.lang.String
to Class java.lang.String
to Class java.lang.String
to Class java.lang.String
to Class java.lang.String
to Class java.lang.String
to Class java.lang.String
to Class java.lang.String
to Class java.lang.String
to Class java.lang.String
to Class java.util.List
to Class java.util.List
to Class java.util.List
to Class java.util.List