org.openorb.ns.util

Class NamingUtils

public class NamingUtils extends Object

Method Summary
static voiddeepBind(NamingContext context, String name, Object obj)
Binds a objet to a name, creating any required subcontexts.
static voiddeepBind(NamingContext context, NameComponent[] name, Object obj)
Binds a objet to a name, creating any required subcontexts.
static voiddeepRebind(NamingContext context, String name, Object obj)
Binds a objet to a name, creating any required subcontexts.
static voiddeepRebind(NamingContext context, NameComponent[] name, Object obj)
Binds a objet to a name, creating any required subcontexts.
static NameComponent[]parent(NameComponent[] name)
Get the parent name of the given name.
static Stringparent(String name)
Get the parent name of the given name.
static NamingContextresolveOrCreateContext(NamingContext context, NameComponent[] name)
Resolve contexts as far as they exist in the name, and create the remainder
static NameComponent[]to_name(String sn)
This operation accepts a stringified name and returns a Name.
static Stringto_string(NameComponent[] n)
This operation accepts Name and returns a stringified name.
static Stringto_url(String addr, String sn)
This operation takes an URL address and performs any escapes necessary on the stringified name and returns a fully formed URL string.

Method Detail

deepBind

public static void deepBind(NamingContext context, String name, Object obj)
Binds a objet to a name, creating any required subcontexts.

Parameters: context The name context root. name The name obj The object to bind.

Throws: InvalidName invalid name NotFound context not found CannotProceed canno bind AlreadyBound name already bound

deepBind

public static void deepBind(NamingContext context, NameComponent[] name, Object obj)
Binds a objet to a name, creating any required subcontexts.

Parameters: context The name context root. name The name obj The object to bind.

Throws: InvalidName if the name is invalid NotFound context not found CannotProceed if the binding cannot be completed AlreadyBound if already bound

deepRebind

public static void deepRebind(NamingContext context, String name, Object obj)
Binds a objet to a name, creating any required subcontexts.

Parameters: context The name context root. name The name obj The object to bind.

Throws: InvalidName if the name is invalid NotFound if the context cannot be found CannotProceed if the rebind conot proceed

deepRebind

public static void deepRebind(NamingContext context, NameComponent[] name, Object obj)
Binds a objet to a name, creating any required subcontexts.

Parameters: context The name context root. name The name obj The object to bind.

Throws: InvalidName if the name is invalid NotFound if the context cannot be found CannotProceed if the bind conot proceed

parent

public static NameComponent[] parent(NameComponent[] name)
Get the parent name of the given name. The parent of the empty name will be also empty.

Parameters: name the name.

Returns: the parent name.

parent

public static String parent(String name)
Get the parent name of the given name. The parent of the empty name will be also empty. It is assumed that the name is in the correct format.

Parameters: name the name.

Returns: the parent name.

resolveOrCreateContext

public static NamingContext resolveOrCreateContext(NamingContext context, NameComponent[] name)
Resolve contexts as far as they exist in the name, and create the remainder

Parameters: context The name context root. name The name

Returns: NamingContext the naming context

Throws: InvalidName if the name is invalid NotFound if the context cannot be found CannotProceed if the resolve/context creation connot proceed

to_name

public static NameComponent[] to_name(String sn)
This operation accepts a stringified name and returns a Name.

Parameters: sn the stringified name to transform to a name.

Returns: NameComponent[] the name

Throws: InvalidName This exception is raised if the stringified name is syntactically malformed or violates an implementation limit.

to_string

public static String to_string(NameComponent[] n)
This operation accepts Name and returns a stringified name.

Parameters: n the name to stringified.

Returns: String the stringified name

Throws: InvalidName This exception is raised if the name is invalid.

to_url

public static String to_url(String addr, String sn)
This operation takes an URL address and performs any escapes necessary on the stringified name and returns a fully formed URL string.

Parameters: addr the address ( for example myhost.xyz.com ) sn the stringified name to add to the URL

Returns: the URL string format.

Throws: org.omg.CosNaming.NamingContextExtPackage.InvalidAddress This exception is raised if an address is invalid ( it means that the address does not respect the address format ). InvalidName This exception is raised if the stringified name is syntactically malformed or violates an implementation limit.