SDX Network Information Collector SDK

net.juniper.smgt.gateway.gal
Class NicFactory

java.lang.Object
  extended by net.juniper.smgt.gateway.gal.NicFactory

public class NicFactory
extends java.lang.Object

The NicFactory is used to access all the NIC components that are configured in the current gateway.


Field Summary
static java.lang.String DEFAULT_PROXY_CLASS
          The default NicProxy implementation classname to be instantiated if no property is specified.
static java.lang.String NIC_PROXY_PROPERTY_NAME
          The NicProxy classname property name
static java.lang.String PROXY_STUB_CLASS
          The default NicProxy implementation classname to be instantiated if no property is specified.
 
Constructor Summary
protected NicFactory(java.util.Properties localProps)
          Constructs NicFactory based on the privided properties.
 
Method Summary
 void destroy()
          Cleanup method
 void destroyNicComponent(java.lang.String nicNamespace)
          Destroys nic component based on its name space provided.
static NicFactory getInstance()
          Returns the sole instance of the NicFactory.
 NIC getNicComponent(java.lang.String nicNamespace, net.juniper.smgt.lib.config.ConfigMgr confMgr)
          Returns the NIC component that was configured with the specified name space.
 SaeLocator getSaeLocator(java.lang.String locName, net.juniper.smgt.lib.config.ConfigMgr confMgr)
          Returns the SaeLocator component that was configured with the specified name.
static void initialize(boolean accessMode, net.juniper.smgt.lib.config.ConfigMgr aMgr, java.lang.String[] aArgs, java.util.Properties props, java.lang.String rootNS)
          Initializes the sole instance of NicFactory using ORB properties passed in, access mode for NicHost (true for stand alone NicHost), ConfigManager instance, arguments to init ORB and NIC root name space.
static void initialize(java.util.Properties props)
          Initializes the sole instance of NicFactory using ORB properties passed in.
static boolean isAccessMode()
          Returns true if NicFactory is running in access mode (local resolvers will be used in resolution process at NicHost)
static boolean isInitialized()
          Checks if the factory has been previously initialized
static boolean isLocalMode()
          Returns true if there is a local NIC host attached to this Nic Factory.
static void setConfigManager(net.juniper.smgt.lib.config.ConfigMgr aConfMan)
          Associates the passed-in Config manager to the singelton instance of the NicFactory.
static void setConfigManager(net.juniper.smgt.lib.config.ConfigMgr aConfMan, java.lang.String nicRootNS)
          Associates the passed-in Config manager to the singelton instance of the NicFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROXY_STUB_CLASS

public static final java.lang.String PROXY_STUB_CLASS
The default NicProxy implementation classname to be instantiated if no property is specified.

See Also:
Constant Field Values

DEFAULT_PROXY_CLASS

public static final java.lang.String DEFAULT_PROXY_CLASS
The default NicProxy implementation classname to be instantiated if no property is specified.

See Also:
Constant Field Values

NIC_PROXY_PROPERTY_NAME

public static final java.lang.String NIC_PROXY_PROPERTY_NAME
The NicProxy classname property name

See Also:
Constant Field Values
Constructor Detail

NicFactory

protected NicFactory(java.util.Properties localProps)
Constructs NicFactory based on the privided properties.

Parameters:
props - Properties
Method Detail

getInstance

public static NicFactory getInstance()
Returns the sole instance of the NicFactory. The default ORB is used in the system.


setConfigManager

public static void setConfigManager(net.juniper.smgt.lib.config.ConfigMgr aConfMan)
Associates the passed-in Config manager to the singelton instance of the NicFactory. Should be called if the factory can be configured to run in local mode. Assumes that the local NIC host configuration will be found under the /nic namespace.

Parameters:
aConfMan - the application's configuration manager

setConfigManager

public static void setConfigManager(net.juniper.smgt.lib.config.ConfigMgr aConfMan,
                                    java.lang.String nicRootNS)
Associates the passed-in Config manager to the singelton instance of the NicFactory. Should be called if the factory can be configured to run in local mode.

Parameters:
aConfMan - the application's configuration manager
nicRootNS - the namespace (relative to the root) where the NIC local NIChost configuration can be found

initialize

public static void initialize(java.util.Properties props)
Initializes the sole instance of NicFactory using ORB properties passed in. This method is optional and should be called before getInstance() only if ORB configuration properties different from the default system ones need to be used.


initialize

public static void initialize(boolean accessMode,
                              net.juniper.smgt.lib.config.ConfigMgr aMgr,
                              java.lang.String[] aArgs,
                              java.util.Properties props,
                              java.lang.String rootNS)
Initializes the sole instance of NicFactory using ORB properties passed in, access mode for NicHost (true for stand alone NicHost), ConfigManager instance, arguments to init ORB and NIC root name space.

Parameters:
accessMode - boolean
aMgr - ConfigMgr
aArgs - String[]
props - Properties
rootNS - String

getNicComponent

public NIC getNicComponent(java.lang.String nicNamespace,
                           net.juniper.smgt.lib.config.ConfigMgr confMgr)
                    throws java.lang.IllegalArgumentException
Returns the NIC component that was configured with the specified name space.

Parameters:
nicNamespace - String the name space of the required NIC component
confMgr - ConfigMgr configuration manager
Returns:
the requested NIC component
Throws:
java.lang.IllegalArgumentException - runtime exception on instantiation failure - thrown when nicNamespace is invalid or directory connection is unavailable.

getSaeLocator

public SaeLocator getSaeLocator(java.lang.String locName,
                                net.juniper.smgt.lib.config.ConfigMgr confMgr)
                         throws java.lang.IllegalArgumentException
Returns the SaeLocator component that was configured with the specified name.

Parameters:
locName - the name of the required SaeLocator component
confMgr - configuration manager
Returns:
the requested SaeLocator component
Throws:
java.lang.IllegalArgumentException - if no SaeLocator component with the specified name is found.

destroy

public void destroy()
Cleanup method


destroyNicComponent

public void destroyNicComponent(java.lang.String nicNamespace)
Destroys nic component based on its name space provided.

Parameters:
nicNamespace - java.lang.String

isAccessMode

public static boolean isAccessMode()
Returns true if NicFactory is running in access mode (local resolvers will be used in resolution process at NicHost)

Returns:
boolean

isLocalMode

public static boolean isLocalMode()
Returns true if there is a local NIC host attached to this Nic Factory.

Returns:
boolean

isInitialized

public static boolean isInitialized()
Checks if the factory has been previously initialized


SDX Network Information Collector SDK