Element.java revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*ident "%Z%%M% %I% %E% SMI"
*
*/
/**
* The <code>Element</code> class represents a pools configuration
* element. The class is an abstract, base class for concrete
* implementation elements, such as pool and resource.
*/
{
/**
* The configuration to which this element belongs.
*/
protected Configuration _conf;
/**
* Returns a string representation of this element.
*
* @return a string representation of this element.
*/
{
try {
return (getInformation(1));
} catch (PoolsException pe) {
}
}
/**
* Returns a descriptive string which describes the element.
*
* @param deep Whether the information should contain information about
* all contained elements.
* @throws PoolsException If the element cannot be located.
* @return a descriptive string which describes the element.
*/
/**
* Get the property with the supplied name.
*
* @param name The name of the property to be retrieved.
* @throws PoolsExecption If there is an error accessing the property.
* @return a value containing the property details.
*/
{
throw new PoolsException();
return (value);
}
/**
* Get the property with the supplied name using the supplied
* proxy.
*
* @param name The name of the property to be retrieved.
* @param proxy The proxy item used to retrieve the property.
* @throws PoolsExecption If there is an error accessing the property.
* @return a value containing the property details.
*/
throws PoolsException
{
throw new PoolsException();
return (value);
}
/**
* Put the supplied value as an element property with the supplied
* name.
*
* @param name The name of the property to be updated.
* @param value The value of the property to be updated.
* @throws PoolsExecption If there is an error accessing the property.
*/
{
throw new PoolsException();
}
/**
* Remove the element property with the supplied name.
*
* @param name The name of the property to be removed.
* @throws PoolsExecption If there is an error removing the property.
*/
{
throw new PoolsException();
}
/**
* Get a String property.
*
* If the type of the property does not match, i.e. it's not a
* String, or the element does not have such a property then a
* PoolsException is thrown.
*
* @param name The name of the property to be retrieved.
* @throws PoolsException If getting the String property fails.
*/
{
return (ret);
}
throw new PoolsException();
}
/**
* Get a long property.
*
* If the type of the property does not match, i.e. it's not a
* long, or the element does not have such a property then a
* PoolsException is thrown.
*
* @param name The name of the property to be retrieved.
* @throws PoolsException If getting the long property fails.
*/
{
return (ret);
}
throw new PoolsException();
}
/**
* Get a double property.
*
* If the type of the property does not match, i.e. it's not a
* double, or the element does not have such a property then a
* PoolsException is thrown.
*
* @param name The name of the property to be retrieved.
* @throws PoolsException If getting the double property fails.
*/
{
return (ret);
}
throw new PoolsException();
}
/**
* Get a boolean property.
*
* If the type of the property does not match, i.e. it's not a
* boolean, or the element does not have such a property then
* a PoolsException is thrown.
*
* @param name The name of the property to be retrieved.
* @throws PoolsException If getting the boolean property fails.
*/
{
return (ret);
}
throw new PoolsException();
}
/**
* Walk all properties of the invoking object.
*
* @param elem The element to whom the property belongs.
* @param val The value representing the current element.
* @param user User supplied data, provided when the walk is invoked.
* @throws PoolsExecption If there is an error walking the property.
* @return 0 to continue the walk, anything else to terminate it.
*/
throws PoolsException
{
return (0);
}
/**
* Return the pointer to this subtype as an element.
*
* @return The pointer to the native subtype which this object wraps.
* @throws PoolsExecption If there is an error converting the native
* subtype pointer to a native elem pointer.
*/
protected abstract long getElem() throws PoolsException;
/**
* Walk all the properties of this element.
*
* @param handler The object which will receive the callbacks.
* @param user Data supplied by the user for use in the callback.
* @return 0 for a successful walk, else 1.
* @throws PoolsExecption If there is an error during the walk.
*/
throws PoolsException
{
}
/**
* Walk the properties of the supplied element using the
* supplied handler.
*
* @param conf native reference to the configuration in which
* the element belongs.
* @param elem native reference to the element whose
* properties are to be walked.
* @param handler a method to be invoked with each property of
* the elem.
* @param user a user parameter which is passed to handler on
* each invocation.
* @throws PoolsException if there is an error accessing the
* element properties.
*/
/**
* Return the key of the element.
*/
}