gov.lanl.Utility
Class NameService

java.lang.Object
  |
  +--gov.lanl.Utility.NameService

public class NameService
extends java.lang.Object

NameService utility class It locates and connects to the NameService and enables registration to the Name Service By default it uses NamingContextExt but can be recompiled to use the older NamingContext interface because it provides the extra utility classes internally. Additionally, it allows for connection to an insecure NameService from an SSL application using the locally developed ServiceInterface.

 

Constructor Summary
NameService(org.omg.CORBA.ORB orb, java.lang.String iorURL)
          Build internal reference to the NameService from an ior or by default
NameService(gov.lanl.SSLTools.ServiceInterface service, java.lang.String iorURL)
          Build internal reference using SSL interface
NameService(java.lang.String[] args, java.util.Properties props, java.lang.String iorURL)
          Constructor without an orb (creates one internally)
 
Method Summary
 org.omg.CORBA.Object connect(java.lang.String serverName)
          Obtain Object reference from the NameService
static gov.lanl.Utility.NameService current()
          return the current NameService or create a new onel, if possible
 void find(java.lang.String nameContext)
          List all of the Names in the given NameContext
 void register(org.omg.CORBA.Object obj, java.lang.String serviceName)
          Register CORBA object to this NameService using serviceName
 org.omg.CosNaming.NameComponent[] to_name(java.lang.String serviceName)
          function to turn string into a NameComponent array used when there is no NameContextExt implementation (also handles wild cards per spec)
 java.lang.String to_string(org.omg.CosNaming.NameComponent[] nameComponentList)
          Convert NameComponent[] into a String It will quote any literal '
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NameService

public NameService(gov.lanl.SSLTools.ServiceInterface service,
                   java.lang.String iorURL)
Build internal reference using SSL interface

Parameters:
service - ServiceInterface
iorURL - URL ior of the NameService (if known)

NameService

public NameService(org.omg.CORBA.ORB orb,
                   java.lang.String iorURL)
Build internal reference to the NameService from an ior or by default

Parameters:
orb - to connect to (overridden if the SSL service is present
iorURL - URL of ior of NameService (if known)
See Also:

NameService

public NameService(java.lang.String[] args,
                   java.util.Properties props,
                   java.lang.String iorURL)
Constructor without an orb (creates one internally)

Parameters:
args - command line arguments
props - Properties passed to Orb.
iorURL - URLf IOR of NameService (if there is one)
Method Detail

current

public static gov.lanl.Utility.NameService current()
return the current NameService or create a new onel, if possible

Returns:
NameService

register

public void register(org.omg.CORBA.Object obj,
                     java.lang.String serviceName)
Register CORBA object to this NameService using serviceName

Parameters:
obj -
serviceName -
See Also:

to_name

public org.omg.CosNaming.NameComponent[] to_name(java.lang.String serviceName)
function to turn string into a NameComponent array used when there is no NameContextExt implementation (also handles wild cards per spec)

Parameters:
serviceName - containing string to be converted to NameComponent[]
Returns:
NameComponent[]

to_string

public java.lang.String to_string(org.omg.CosNaming.NameComponent[] nameComponentList)
Convert NameComponent[] into a String It will quote any literal '.', '/', and '\' characters by adding a preceding '\'

Parameters:
nameComponentList - to be converted to String
Returns:
String containing Stringified NameComponent

connect

public org.omg.CORBA.Object connect(java.lang.String serverName)
Obtain Object reference from the NameService

Parameters:
serverName -
Returns:
Object CORBA object that it connects to
See Also:

find

public void find(java.lang.String nameContext)
List all of the Names in the given NameContext