com.bea.ales.management
Interface MetaObject


public interface MetaObject

A MetaObject represents a generic hierarchical object. The object under the same tree has the same type. The attributes can be inherited from bottom to top or from top to bottom. A root node instance of MetaObject can be created through MetaObjectFactory with type specified. Multiple types of root node can be created in the same application.


Method Summary
 void addAttribute(AttributeElement attribute)
          Add the specified attribute to this meta object.
 void addAttribute(java.lang.String name, java.lang.String value)
          Create an attribute with specified name and value for this meta object.
 MetaObject cloneTo(MetaObject newParent)
          Clone the copy of this object to be under the object specified.
 MetaObject createChild(java.lang.String name)
          Create a child object of this object.
 MetaObjectQueryResult getAllAncestors(java.lang.String filterString)
          Return query result on this MetaObject that contains all ancestors match the pattern specified.
 MetaObjectQueryResult getAllDescendants()
          Return descendants query result on this MetaObject,
 MetaObjectQueryResult getAllDescendants(java.lang.String filterString)
          Return query result on the MetaObject that contains all children object match the pattern specified.
 AttributeElement getAttribute(java.lang.String attributeName)
          Find an attribute with the specified name.
 AttributeQueryResult getAttributes(int attrQueryType)
          Find all attributes which has the attrQueryType of this meta object.
 MetaObject getChildByName(java.lang.String objName)
          Get child object of this object by name.
 MetaObjectQueryResult getChildren()
          Return query result contains all children of this MetaObject.
 java.util.Collection getChildrenWithAttribute(AttributeElement attribute)
          Return all children of this object with a given attribute.
 int getInheritanceModel()
          Get the inheritance model of this object
 java.lang.String getName()
          Get the name of the MetaObject.
 MetaObject getParent()
          Return the parent of this object.
 java.lang.String getRootName()
          Return the root name of the MetaObject.
 java.lang.String getType()
          Return the type of the MetaObject
 void modifyAttribute(AttributeElement attribute)
          Modify the value of an attribute on this meta object using the given attribute element.
 void modifyAttribute(java.lang.String name, java.lang.String newValue)
          Modify the value of an attribute with the specified name from this meta object.
 void moveTo(MetaObject newParent)
          Move this object to be under the object specified.
 void removeAttribute(AttributeElement attr)
          Remove the specified attribute from this meta object.
 void removeAttribute(java.lang.String name)
          Remove an attribute by name.
 void removeChild(MetaObject obj)
          Remove the given child and all children's descendants from this MetaObject.
 void removeChild(java.lang.String objName)
          Remove the child object with name and all the child's descendants from this MetaObject.
 void rename(java.lang.String newName)
          Rename this object with the given newName.
 

Method Detail

getRootName

public java.lang.String getRootName()
Return the root name of the MetaObject.

Returns:
the root name of the MetaObject,

getType

public java.lang.String getType()
Return the type of the MetaObject

Returns:
the type of the MetaObject

getInheritanceModel

public int getInheritanceModel()
                        throws ManagementException
Get the inheritance model of this object

Returns:
The inheritance type of that object type, which would be InheritanceModel.TOP_TO_BOTTOM or InheritanceModel.BOTTOM_TO_TOP
Throws:
ManagementException - if the operation fails.

rename

public void rename(java.lang.String newName)
            throws ManagementException
Rename this object with the given newName. Root object can not renamed.

Parameters:
newName - the desired new name.
Throws:
ManagementException - if the operation fails.

createChild

public MetaObject createChild(java.lang.String name)
                       throws ManagementException
Create a child object of this object.

Parameters:
name - the relative name of child object.
Returns:
MetaObject the child object.
Throws:
ManagementException - if the operation fails

getChildByName

public MetaObject getChildByName(java.lang.String objName)
                          throws ManagementException
Get child object of this object by name.

Parameters:
objName - the name of the child object
Returns:
the child object in the tree with the name specified.
Throws:
ManagementException - if the operation fails.

removeChild

public void removeChild(java.lang.String objName)
                 throws ManagementException
Remove the child object with name and all the child's descendants from this MetaObject.

Parameters:
objName - the name of the child to remove in string format.

removeChild

public void removeChild(MetaObject obj)
                 throws ManagementException
Remove the given child and all children's descendants from this MetaObject.

Parameters:
obj - the MetaObject to remove from this object.

getChildren

public MetaObjectQueryResult getChildren()
                                  throws ManagementException
Return query result contains all children of this MetaObject.

Returns:
the query result of MetaObjects that contains all the children of this object
Throws:
ManagementException - if the operation fails.

getChildrenWithAttribute

public java.util.Collection getChildrenWithAttribute(AttributeElement attribute)
                                              throws ManagementException
Return all children of this object with a given attribute.

Parameters:
attribute - the attribute that the child object should have.
Returns:
All children that directly has that given attribute, or empty if no child or no child directly has the given attribute.

getAllDescendants

public MetaObjectQueryResult getAllDescendants()
                                        throws ManagementException
Return descendants query result on this MetaObject,

Returns:
the query result on the MetaObjects that contains the descendants of this object
Throws:
ManagementException - if the operation fails.

getAllDescendants

public MetaObjectQueryResult getAllDescendants(java.lang.String filterString)
                                        throws ManagementException
Return query result on the MetaObject that contains all children object match the pattern specified.

Returns:
the query result on the MetaObjects.
Throws:
ManagementException - if the operation fails.

getParent

public MetaObject getParent()
                     throws ManagementException
Return the parent of this object.

Returns:
the parent object, or null if this is a root node.
Throws:
ManagementException - if the operation fails.

getAllAncestors

public MetaObjectQueryResult getAllAncestors(java.lang.String filterString)
                                      throws ManagementException
Return query result on this MetaObject that contains all ancestors match the pattern specified.

Returns:
the query result on this MetaObjects.
Throws:
ManagementException - if the operation fails.

getName

public java.lang.String getName()
Get the name of the MetaObject.

Returns:
the name of the MetaObject

cloneTo

public MetaObject cloneTo(MetaObject newParent)
                   throws ManagementException
Clone the copy of this object to be under the object specified. If there is already object under the newParent with same name existed, the operation will fail.

Parameters:
newParent - the object which the copied instance will be under
Throws:
ManagementException - it the operation fails.

moveTo

public void moveTo(MetaObject newParent)
            throws ManagementException
Move this object to be under the object specified. If there is already object under the newParent with same name existed, the operation will fail.

Parameters:
newParent - the object which will be parent of this object
Throws:
ManagementException - if the operation fails.

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.String value)
                  throws ManagementException
Create an attribute with specified name and value for this meta object.

Parameters:
name - name of attribute.
value - value of attribute.
Throws:
ManagementException - if the operation fails.

addAttribute

public void addAttribute(AttributeElement attribute)
                  throws ManagementException
Add the specified attribute to this meta object.

Parameters:
attribute - the attribute to be added
Throws:
ManagementException - if the operation fails.

removeAttribute

public void removeAttribute(java.lang.String name)
                     throws ManagementException
Remove an attribute by name. The attribute which has the specified name will be removed from this meta object.

Parameters:
name - name of attribute to be removed.
Throws:
ManagementException - if the operation fails.

removeAttribute

public void removeAttribute(AttributeElement attr)
                     throws ManagementException
Remove the specified attribute from this meta object.

Parameters:
attr - the attribute to be removed.
Throws:
ManagementException - if the operation fails.

modifyAttribute

public void modifyAttribute(java.lang.String name,
                            java.lang.String newValue)
                     throws ManagementException
Modify the value of an attribute with the specified name from this meta object.

Parameters:
name - name of the attribute.
newValue - new attribute value desired.
Throws:
ManagementException - if the operation fails.

modifyAttribute

public void modifyAttribute(AttributeElement attribute)
                     throws ManagementException
Modify the value of an attribute on this meta object using the given attribute element. The value ot the attribute is modified.

Parameters:
attribute - The name of this passed in attribute is used to find attribute to be set of the meta object. The value of this passed in attribute is set to the value of the found attribute of the meta object.
Throws:
ManagementException - if the operation fails.

getAttribute

public AttributeElement getAttribute(java.lang.String attributeName)
                              throws ManagementException
Find an attribute with the specified name.

Parameters:
attributeName - name of the attribute.
Returns:
the attribute, or null if no attribute found for this meta object.
Throws:
ManagementException - if the operation fails.

getAttributes

public AttributeQueryResult getAttributes(int attrQueryType)
                                   throws ManagementException
Find all attributes which has the attrQueryType of this meta object.

Parameters:
attrQueryType - the attribute type.
Returns:
the query result which contains all the found attribute elements.
Throws:
ManagementException - if the operation fails.


Copyright © 2004-2008, Oracle and/or its affiliates. All rights reserved.