org.objectweb.david.libs.helpers
Class IORHelpers
java.lang.Object
|
+--org.objectweb.david.libs.helpers.IORHelpers
- public class IORHelpers
- extends Object
This class contains utilies to manipulate Interoperable Object References.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IORHelpers
public IORHelpers()
forgeIOR
public static final String forgeIOR(ORB orb,
String rep_id,
byte[] key,
String host,
int port)
throws JonathanException
- Creates a stringified IOR with an IIOP profile.
- Parameters:
orb - an ORB instance;rep_id - the repository id of the interface referenced by the returned
IOR;key - the referenced object key;host - the name of the machine where the referenced object lives;port - the port to use to communicate with the referenced object.- Returns:
- a stringified IOR of a CORBA object.
- Throws:
JonathanException - if something goes wrong.
writeIORToFile
public static final void writeIORToFile(String ior,
String filename)
throws IOException
- Writes an IOR to a file.
- Parameters:
ior - the IOR to write.filename - the name of the file.- Throws:
IOException - if an IO Exception occurred;
readIORFromFile
public static final String readIORFromFile(String filename)
throws IOException
- Reads an IOR from a file.
- Parameters:
filename - the file name.- Returns:
- the IOR
- Throws:
IOException - if an IO Exception occurred;
readIORFromURL
public static final String readIORFromURL(String url)
throws IOException
- Reads an IOR from a file whose location is specified by 'url'.
- Parameters:
url - the url specifying the file location.- Returns:
- an ior
- Throws:
IOException - if an IO Exception occurred;
bytesToIORHexString
public static final String bytesToIORHexString(byte[] octet_stream)
- Returns a stringified IOR.
- Parameters:
octet_stream - a byte array encoding the IOR.- Returns:
- a stringified IOR.
IORHexStringToBytes
public static final byte[] IORHexStringToBytes(String str)
- Decodes a stringified IOR into an array of bytes encoding the IOR.
- Parameters:
str - a stringified IOR.- Returns:
- an array of bytes encoding the IOR.