org.sblim.wbem.cim
Class CIMNameSpace
java.lang.Object
org.sblim.wbem.cim.CIMNameSpace
- Cloneable, Serializable
public class CIMNameSpace
extends java.lang.Object
implements Serializable, Cloneable
CIMNameSpace.java
(C) Copyright IBM Corp. 2005, 2006
THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE
("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
You can obtain a current copy of the Common Public License from
http://www.opensource.org/licenses/cpl1.0.php
CIMNameSpace() - Constructs and instantiates a default CIM namespace name.
|
CIMNameSpace(String pURI) - Constructs a CIM namespace, pointing to a specified host or URI
(protocol://hostname[:port]/file), i.e.
|
CIMNameSpace(String pHost, String pNamespace) - Constructs an object which represents a CIMNameSpace.
|
Object | clone()
|
boolean | equals(Object o)
|
String | getHost() - Returns the hostname of the CIMNameSpace
|
URI | getHostURI() - Returns the URI representation of the CIMNameSpace.
|
URL | getHostURL() - Returns the URL representation of the CIMNameSpace.
|
String | getNameSpace() - Returns the namespace fragment of the CIMNameSpace.
|
int | getPort() - Returns the port defined for this namespace by the URI.
|
String | getScheme() - Returns the scheme specified on the URI.
|
int | hashCode()
|
static CIMNameSpace | parse(String pURI) - The CIMNameSpace(String) constructor must be used instead of
this method.
|
void | setHost(String pHost) - Specifies the host for this CIMNameSpace object.
|
void | setNameSpace(String pNamespace) - Specifies the namespace for this CIMNameSpace object.
|
protected void | setNamespace(String namespace)
|
void | setPort(int pPort) - Specifies the port for this CIMNameSpace object.
|
String | toString()
|
protected void | updateURI()
|
NAMESPACE_SEPARATOR
public static final char NAMESPACE_SEPARATOR
CIMNameSpace
public CIMNameSpace()
throws CIMException
Constructs and instantiates a default CIM namespace name.
CIMException
- CIM_ERR_FAILED - if a malformed URL is constructed from the
specified parameters
CIMNameSpace
public CIMNameSpace(String pURI)
throws CIMException
Constructs a CIM namespace, pointing to a specified host or URI
(protocol://hostname[:port]/file), i.e.
"https://47.11.8.15:5989/root/cimv2"
CIMNameSpace
public CIMNameSpace(String pHost,
String pNamespace)
throws CIMException
Constructs an object which represents a CIMNameSpace.
pHost
- host= protocol://hostname[:port]/file host=
"https://myhostname/" host= "http://myhostname:5988/cimom"
host= "myhostname"pNamespace
- a string which represents the namespace in the CIM Object
Manager. According to the spec it should not starts or ends
with '/'. This are examples of valid namespace. namespace=
"root/cimv2" namespace= "root"
CIMException
- CIM_ERR_INVALID_PARAMETER - if the URI is malformed
clone
public Object clone()
equals
public boolean equals(Object o)
getHost
public String getHost()
Returns the hostname of the CIMNameSpace
- a string which represents the hostname of the NameSpace
getHostURI
public URI getHostURI()
throws CIMException
Returns the URI representation of the CIMNameSpace.
getHostURL
public URL getHostURL()
throws CIMException
Returns the URL representation of the CIMNameSpace.
getNameSpace
public String getNameSpace()
Returns the namespace fragment of the CIMNameSpace. This fragment does
not include any information related to a host. (i.e. "myhost:root/cimv2",
this method return just the "root/cimv2"
getPort
public int getPort()
Returns the port defined for this namespace by the URI. If no port is
defined, then the default port is used.
getScheme
public String getScheme()
Returns the scheme specified on the URI.
hashCode
public int hashCode()
parse
public static CIMNameSpace parse(String pURI)
throws CIMException
The CIMNameSpace(String) constructor must be used instead of
this method.
Creates a CIMNameSpace object from the specified URI. This method behaves
as new CIMNameSpace(p).
setHost
public void setHost(String pHost)
Specifies the host for this CIMNameSpace object.
setNameSpace
public void setNameSpace(String pNamespace)
throws CIMException
Specifies the namespace for this CIMNameSpace object. The namespace
should not start or end with a '/', it will be automatically removed. As
a result a namespace like "/root/cimv2", will result on "root/cimv2", and
"/" would be translated into an empty namespace ("")
pNamespace
- The namespace
setNamespace
protected void setNamespace(String namespace)
setPort
public void setPort(int pPort)
Specifies the port for this CIMNameSpace object.
toString
public String toString()
Copyright © 2005, 2006 IBM Corporation. All Rights Reserved.