com.sun.wbem.cim
Class CIMNameSpace

java.lang.Object
  |
  +--com.sun.wbem.cim.CIMNameSpace

public class CIMNameSpace
extends java.lang.Object
implements java.io.Serializable

Creates and instantiates a CIM namespace, an object that defines a scope within which object keys must be unique. This class is used to refer to an implementation that provides a domain in which class instances are unique. The CIM namespace is a logical grouping of CIM classes and CIM instances that represent managed objects in a particular environment. A CIM object name consists of two parts: namespace + model path. The CIMNameSpace class instantiates the namespace portion of the CIM object name. For more information regarding the description and rules for the model path and namespace, refer to the CIM specification at http://www.dmtf.org/

Since:
WBEM 1.0
See Also:
Serialized Form

Constructor Summary
CIMNameSpace()
          Constructor creates and instantiates a default CIM namespace name.
CIMNameSpace(java.lang.String h)
          Constructor for a CIM namespace, pointing to a specified host or URL.
CIMNameSpace(java.lang.String host, java.lang.String ns)
          Constructor creates and instantiates a CIM namespace with the the specified host and CIM namespace name.
 
Method Summary
 java.lang.String getHost()
          Gets the host name of this CIM namespace
 java.net.URL getHostURL()
          Gets the host url of this CIM namespace
 java.lang.String getNameSpace()
          Gets the name of this CIM namespace
 void parse(java.lang.String p)
          Parses the name of a namespace by replacing the forward slash (/) with a backward slash (\).
 void setHost(java.lang.String h)
          Sets the host name of this CIM namespace to the specified string
 void setNameSpace(java.lang.String ns)
          Sets the name of this CIM namespace to the specified string
 java.lang.String toString()
          Returns a String representation of the CIMNameSpace This method is intended to be used only for debugging purposes, and the format of the returned string may vary between implementations.
 java.lang.String toXml()
          Returns the XML representation of the CIM namespace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CIMNameSpace

public CIMNameSpace()
Constructor creates and instantiates a default CIM namespace name. The default CIM namespace name is "\\.\root\cimv2"

CIMNameSpace

public CIMNameSpace(java.lang.String h)
Constructor for a CIM namespace, pointing to a specified host or URL. For example, specifying the string "myhost" creates a CIM namespace with host name "myhost" and the default namepspace name \root\cimv2 is used.
Parameters:
h - The string for the host name. h can be a host name, ip address, or a URL of the form: "http://myhost:8080/cimom"
Throws:
java.lang.IllegalArgumentException - If the String can not be used to create a valid URL (e.g. new URL(h)).

CIMNameSpace

public CIMNameSpace(java.lang.String host,
                    java.lang.String ns)
Constructor creates and instantiates a CIM namespace with the the specified host and CIM namespace name. For example, specifying host "myhost" and namespace name "westcoast" creates a CIM namespace with the name "\\myhost\westcoast". Namespaces can be nested within each other to form a hierarchy of classes and instances. Each namespace must have a unique name within the scope of its immediate parent namespace. For example: Namespace1\Namespace2...\LastNamespace
Parameters:
host - the string representing the host name, ip address, or URL.
ns - the string representing the name of this CIM namespace.
Method Detail

getNameSpace

public java.lang.String getNameSpace()
Gets the name of this CIM namespace
Returns:
nameSpace The string representing the name of this CIM namespace

getHost

public java.lang.String getHost()
Gets the host name of this CIM namespace
Returns:
host the string representing the host name that was used to create the CIMNameSpace

getHostURL

public java.net.URL getHostURL()
Gets the host url of this CIM namespace
Returns:
URL the URL that represents the host information that was used to create the CIMNameSpace.

parse

public void parse(java.lang.String p)
Parses the name of a namespace by replacing the forward slash (/) with a backward slash (\). For example, if you pass the name of the default namespace, /cim/v2, this routine replaces this string with \cim\v2.
Parameters:
p - the string to parse

setNameSpace

public void setNameSpace(java.lang.String ns)
Sets the name of this CIM namespace to the specified string
Parameters:
ns - the string representing the name of this CIM namespace

setHost

public void setHost(java.lang.String h)
Sets the host name of this CIM namespace to the specified string
Parameters:
h - the string representing the host name of this CIM namespace

toString

public java.lang.String toString()
Returns a String representation of the CIMNameSpace This method is intended to be used only for debugging purposes, and the format of the returned string may vary between implementations. The returned string may be empty but may not be null.
Overrides:
toString in class java.lang.Object
Returns:
string representation of this namespace

toXml

public java.lang.String toXml()
Returns the XML representation of the CIM namespace
Returns:
String The XML representation of the CIM namespace