Package net.aifusion.metamodel
Class ObjectPath
java.lang.Object
net.aifusion.metamodel.ObjectPath
Class to represent a CIM ObjectPath. An object path represents the globally unique name of a named element, and can be used to access that
element.
- Author:
- Sharad Singhal
-
Constructor Summary
ConstructorDescriptionObjectPath
(String objectName) Create an object path from a path specification as defined in DSP0004 and extended for CimV3.ObjectPath
(URI uri) Construct an object path from a URIObjectPath
(ElementType elementType, String className, String alias) Create an object path based on a class name and an instance alias, where alias is of the form "$" [a-zA-Z0-9_]+ObjectPath
(ElementType type, String objectName, NameSpacePath path, Map<String, DataValue> keys, String alias) Create an object path based on its type, name, name space path, and key-value pairs -
Method Summary
Modifier and TypeMethodDescriptionboolean
getAlias()
Get the alias value associated with this object pathGet the element type represented in this object pathgetKeyValue
(String keyName) Get the value associated with a given key in this object pathGet the localPath corresponding to this objectPathGet the normalized case name of the element in this pathgetName()
Get the name of the element in this pathGet the name space path associated with this object pathCreate a URL for this objectPath targeted at a given hostgetUUID()
get a UUID value based on this objectPath.int
hashCode()
toString()
toURL()
Create a URL based on this object path.
-
Constructor Details
-
ObjectPath
public ObjectPath(ElementType type, String objectName, NameSpacePath path, Map<String, DataValue> keys, String alias) Create an object path based on its type, name, name space path, and key-value pairs- Parameters:
type
- - type of named object (must be non-null)objectName
- - name of the object (must be non-null)path
- - Name space path for this object (must be non-null)keys
- - keys associated with this object (must be non-null for instances; must be null or empty for all other element types)alias
- - alias, if any defined on this object.
-
ObjectPath
Create an object path based on a class name and an instance alias, where alias is of the form "$" [a-zA-Z0-9_]+- Parameters:
elementType
- Type of this element (instance or structurevalue)className
- - name of class or structurealias
- - alias for the instance of the class, or value of the structure
-
ObjectPath
Create an object path from a path specification as defined in DSP0004 and extended for CimV3. The following forms are recognized
className: schemaName "_" identifier
instanceName : className "." key "=" dataValue [, key "=" dataValue]*
localClassPath : ["/elementType"] "/" pathName ["/" pathName]* ":" className
localInstancePath : ["/instanceType"] "/" pathName ["/" pathName]* ":" instanceName
classPath : scheme "://" authority localClassPath
instancePath : scheme "://" authority localInstancePath
where
schemaName : [A-Za-z0-9]+
identifier : [A-Za-z0-9_]+
scheme : [A-Za-z0-9+-.]+
authority : ascii char set not including "/"
The term "/elementType" above can take the forms "/" ["class" | "structure" | "enumeration" | "qualifiertype" | "interface"]
The term "/instanceType" above can take the forms "/" ["instance" | "structurevalue"]- Parameters:
objectName
- - string dataValue containing object name
-
ObjectPath
Construct an object path from a URI- Parameters:
uri
- - Properly constructed URI. In the URI, the localPath is expected to be of the form:
uri = '/' elementType '/' localPathElement [ ('/' localPathElement)* ] '/' ElementName [InstanceLocator] instanceLocator = '?' keyName ',' dataType '=' value (['&' keyName ',' dataType '=' value)*
-
-
Method Details
-
getElementType
Get the element type represented in this object path- Returns:
- - element type represented by this path
-
getName
Get the name of the element in this path- Returns:
- - name of the element in the path
-
getLowerCaseName
Get the normalized case name of the element in this path- Returns:
- - lower case name of the element in the path
-
getNameSpacePath
Get the name space path associated with this object path- Returns:
- - name space path associated with this object path. Null is returned if no namespace path is associated with the object path (e.g., for alias values)
-
getLocalPath
Get the localPath corresponding to this objectPath- Returns:
- - local path for this objectPath. Default is returned if none specified
-
getAlias
Get the alias value associated with this object path- Returns:
- - alias value. Null if no alias is set in this object path
-
getKeyValue
Get the value associated with a given key in this object path- Parameters:
keyName
- - case insensitive name of the key property- Returns:
- - value of the key. Null if this path is not a structure/instancevalue, or if no such key exists
-
toString
-
hashCode
public int hashCode() -
equals
-
getUUID
get a UUID value based on this objectPath. Note that the UUID depends on the element type, local path, and object name and keys, but does NOT depend on the hostname and authority in the namespace- Returns:
- - Type 3 (Name-based) UUID based on this objectPath
-
toURL
Create a URL based on this object path. The scheme/authority are extracted from this path, or replaced by defaults if null- Returns:
- - URL based on this object path
-
getURL
Create a URL for this objectPath targeted at a given host- Parameters:
scheme
- - scheme used for this URL. Replaced by a default if nullauthority
- - authority used for this URL. Replaced by a default if null- Returns:
- - URL constructed based on this ObjectPath
- See Also:
-