com.ibm.retail.si.mgmt
Class ObjectNameFactory

java.lang.Object
  |
  +--com.ibm.retail.si.mgmt.ObjectNameFactory

public class ObjectNameFactory
extends java.lang.Object

Factory for creating custom ObjectNames for Regular and Proxied MBeans. ObjectNames are passed in and copied, adding and/or replacing additional attributes. The static initialize method should be called before getting the singleton instance for the first time in order to pass in configuration information

Author:
Chris Arrington

Constructor Summary
protected ObjectNameFactory(java.lang.String deviceId, java.lang.String systemId, java.lang.String storeId)
           
 
Method Summary
 javax.management.ObjectName createObjectName(javax.management.ObjectName objName, java.lang.String component, java.lang.String devMajor, java.lang.String devMinor)
          Deprecated. The Id key needs to be supplied, use createObjectName( ObjectName, String, String, String ) instead
 javax.management.ObjectName createObjectName(javax.management.ObjectName objName, java.lang.String id, java.lang.String component, java.lang.String devMajor, java.lang.String devMinor)
          Creates a new ObjectName from an existing ObjectName that conforms to the SI Object Naming conventions, adding the supplied system information in addition to other required properties.
 javax.management.ObjectName createObjectName(java.lang.String domain, java.lang.String id, java.lang.String component, java.lang.String devMajor, java.lang.String devMinor)
          Creates a new ObjectName from the supplied information that conforms to the SI Object Naming conventions, having the supplied system information in addition to other required properties.
 javax.management.ObjectName createProxyObjectName(javax.management.ObjectName objName, com.ibm.retail.si.mgmt.MgmtDeviceInfo devInfo)
          Create a modified ObjectName for a proxy of the supplied ObjectName
static com.ibm.retail.si.mgmt.ObjectNameFactory getInstance()
           
protected static void initialize(java.lang.String deviceId, java.lang.String systemId, java.lang.String storeId)
          Initializes the singleton instance with the supplied attributes.
 javax.management.ObjectName reverseObjectName(javax.management.ObjectName objName)
          For usage within a general agent, this method, removes all device and component information added in createObjectName()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectNameFactory

protected ObjectNameFactory(java.lang.String deviceId,
                            java.lang.String systemId,
                            java.lang.String storeId)
Parameters:
deviceId - Device ID added only to regular ObjectNames
systemId - System ID added only to regular ObjectNames
storeId - Store ID to add to proxied MBeans, should be null for GA's
Method Detail

createProxyObjectName

public javax.management.ObjectName createProxyObjectName(javax.management.ObjectName objName,
                                                         com.ibm.retail.si.mgmt.MgmtDeviceInfo devInfo)
                                                  throws javax.management.MalformedObjectNameException
Create a modified ObjectName for a proxy of the supplied ObjectName

Parameters:
objName - Source ObjectName
devInfo - MgmtDeviceInfo matching the source device
Returns:
ObjectName for a proxy of the source instance, having new attributes and values based on parameters supplied to this factory
Throws:
javax.management.MalformedObjectNameException - Error creating new ObjectName

createObjectName

public javax.management.ObjectName createObjectName(javax.management.ObjectName objName,
                                                    java.lang.String component,
                                                    java.lang.String devMajor,
                                                    java.lang.String devMinor)
                                             throws javax.management.MalformedObjectNameException
Deprecated. The Id key needs to be supplied, use createObjectName( ObjectName, String, String, String ) instead

For usage within a general agent, this method sreates a new ObjectName for a regular MBean, adding device and system information in addition to the supplied component and version information

Parameters:
objName - Source ObjectName instance
component - Component name the MBean matches
devMajor - Major version of the component being represented
devMinor - Minor version of the component being represented
Returns:
New ObjectName based on the supplied instance with additional information
Throws:
javax.management.MalformedObjectNameException - Invalid parameter values supplied

createObjectName

public javax.management.ObjectName createObjectName(javax.management.ObjectName objName,
                                                    java.lang.String id,
                                                    java.lang.String component,
                                                    java.lang.String devMajor,
                                                    java.lang.String devMinor)
                                             throws javax.management.MalformedObjectNameException
Creates a new ObjectName from an existing ObjectName that conforms to the SI Object Naming conventions, adding the supplied system information in addition to other required properties.

Parameters:
objName - Source ObjectName instance
id - Type/Identifier for the MBean, cannot be null
component - Component name the MBean matches, can be null
devMajor - Major version of the component being represented, can be null
devMinor - Minor version of the component being represented, can be null
Returns:
New ObjectName based on the supplied instance with additional information
Throws:
javax.management.MalformedObjectNameException - Invalid parameter values supplied

createObjectName

public javax.management.ObjectName createObjectName(java.lang.String domain,
                                                    java.lang.String id,
                                                    java.lang.String component,
                                                    java.lang.String devMajor,
                                                    java.lang.String devMinor)
                                             throws javax.management.MalformedObjectNameException
Creates a new ObjectName from the supplied information that conforms to the SI Object Naming conventions, having the supplied system information in addition to other required properties.

Parameters:
domain - Domain portion of the new ObjectName
id - Type/Identifier for the MBean, cannot be null
component - Component name the MBean matches, can be null
devMajor - Major version of the component being represented, can be null
devMinor - Minor version of the component being represented, can be null
Returns:
New ObjectName based on the supplied instance with additional information
Throws:
javax.management.MalformedObjectNameException - Invalid parameter values supplied

reverseObjectName

public javax.management.ObjectName reverseObjectName(javax.management.ObjectName objName)
                                              throws javax.management.MalformedObjectNameException
For usage within a general agent, this method, removes all device and component information added in createObjectName()

Parameters:
objName - Source ObjectName
Returns:
ObjectName with device and component information removed
Throws:
javax.management.MalformedObjectNameException - Error creating new ObjectName

initialize

protected static void initialize(java.lang.String deviceId,
                                 java.lang.String systemId,
                                 java.lang.String storeId)
Initializes the singleton instance with the supplied attributes. Some

Parameters:
deviceId - Device ID added only to regular ObjectNames
systemId - System ID added only to regular ObjectNames
storeId - Store ID to add to proxied MBeans, should be null for GA's

getInstance

public static com.ibm.retail.si.mgmt.ObjectNameFactory getInstance()
                                                            throws MgmtException
Returns:
Singleton instance of this class. If a singleton hasn't been initialized via the initialize() method, then a MgmtException will be thrown
Throws:
MgmtException - Singleton instance has not been initialized


Copyright © 2004 IBM. All Rights Reserved.
Generated: July 19 2004