/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*ident "%Z%%M% %I% %E% SMI"
*
*/
/**
* The <code>Configuration</code> class represents a pools configuration.
*/
{
/**
* Indicates whether the configuration represents a usable
* configuration.
*/
private boolean _valid = false;
/**
* A reference to the native libpool object represented by
* this instance.
*/
private long _this;
/**
* The name of this instance.
*/
/**
* The cache of elements known to this configuration.
*/
/**
* The key of the configuration.
*/
/**
* Constructor
* @param location The location of the configuration.
* @param perms The OR'd permissions used when opening this
* configuration.
* @exception PoolsException The error message generated by
* libpool.
*/
{
throw new PoolsException();
_conf = this;
}
/**
* Reclaim the memory allocated for this configuration by the C
* proxy.
*
* @throws Throwable If freeing this configuration fails.
*/
{
try
{
close();
if (_this != 0) {
_this = 0;
}
}
finally
{
super.finalize();
}
}
/**
* Returns a pointer to the native configuration, wrapped by this
* instance.
*
* @return the configuration pointer.
*/
final long getConf()
{
return (_this);
}
/**
* Opens the configuration at the supplied location and with the
* supplied permissions.
*
* @throws PoolsException if there is an error opening the
* configuration.
*/
{
if (_valid == false) {
throw new PoolsException();
}
_valid = true;
}
}
/**
* Closes the configuration.
*
*/
public void close()
{
if (_valid == true) {
}
_valid = false;
}
/**
* Returns the location of the configuration.
*
* @return the location of the configuration.
*/
{
}
/**
* Returns the status of the configuration.
*
* @return the status of the configuration.
*/
public int status()
{
}
/**
* Remove the configuration.
*
* @throws PoolsExecption If the removal fails.
*/
{
throw new PoolsException();
}
/**
* Rollback the configuration, undoing any changes which have been
* made since the last commit or (if there are no commits) since the
* configuration was opened.
*
* @throws PoolsExecption If the rollback fails.
*/
{
throw new PoolsException();
}
/**
* Commit the configuration, making any changes since the configuration
* was last committed (or opened if there have been no prior commits)
* permanent.
*
* @throws PoolsExecption If the commit fails.
*/
{
throw new PoolsException();
}
/**
* Export the configuration, storing the current state of the
* configuration at the supplied location in the supplied format.
*
* @param location The location of the export.
* @param format The format of the export.
* @throws PoolsExecption If the export fails.
*/
{
throw new PoolsException();
}
/**
* Validate the configuration, ensuring that the current state of the
* configuration satisfies the supplied validation level.
*
* @param level The desired level of validation.
* @throws PoolsExecption If the validation fails.
*/
{
throw new PoolsException();
}
/**
* Update the configuration, ensuring that the current state of the
* configuration reflects that of the kernel.
*
* @throws PoolsExecption If the update fails.
* @return a bitmap of the changed types.
*/
{
}
/**
* Create a pool with the supplied name.
*
* @param name The name of the PoolInternal.
* @throws PoolsExecption If the pool creation fails.
* @return a pool with the supplied name.
*/
{
long aPool;
throw new PoolsException();
}
return (p);
}
/**
* Destroy the supplied PoolInternal.
*
* @param aPool The pool to be destroyed.
* @throws PoolsException If the pool cannot be located.
*/
{
}
/**
* Get the pool with the supplied name.
*
* @param name The name of the pool to be found.
* @throws PoolsExecption If the pool cannot be located.
* @return a pool with the supplied name.
*/
{
long aPool;
0) {
throw new PoolsException();
}
else {
return (p);
}
}
/**
* Get the proxy for the pool with the supplied name.
*
* @param name The name of the pool to be found.
* @throws PoolsExecption If the pool cannot be located.
* @return the proxy for the pool with the supplied name.
*/
{
long aPool;
0) {
throw new PoolsException();
}
return (aPool);
}
/**
* Get a list of pools which match the supplied selection criteria
* in values.
*
* @param values A list of values to be used to qualify the search.
* @throws PoolsExecption If there is an error executing the query.
* @return a list of pools which match the supplied criteria
*/
{
== null) {
if (PoolInternal.pool_error() ==
return new ArrayList();
else
throw new PoolsException();
}
return (aList);
}
/**
* Create a resource with the supplied type and name.
*
* @param type The type of the resource.
* @param name The name of the resource.
* @throws PoolsExecption If the resource creation fails.
* @return a resource of the supplied type and name.
*/
throws PoolsException
{
long aResource;
throw new PoolsException();
}
return (res);
}
/**
* Destroy the supplied resource.
*
* @param res The resource to be destroyed.
* @throws PoolsException If the resource cannot be located.
*/
{
res.getResource());
}
/**
* Get the resource with the supplied name.
*
* @param type The type of the resource to be found.
* @param name The name of the resource to be found.
* @throws PoolsExecption If the resource cannot be located.
* @return a resource with the supplied name.
*/
throws PoolsException
{
long res;
name)) == 0) {
throw new PoolsException();
}
else {
return (r);
}
}
/**
* Get the proxy for the resource with the supplied type and
* name.
*
* @param type The type of the resource to be found.
* @param name The name of the resource to be found.
* @throws PoolsExecption If the resource cannot be located.
* @return the proxy for the resource with the supplied name.
*/
{
long res;
name)) == 0) {
throw new PoolsException();
}
return (res);
}
/**
* Get a list of resources which match the supplied selection criteria
* in values.
*
* @param values A list of values to be used to qualify the search.
* @throws PoolsExecption If there is an error executing the query.
* @return a list of resources which match the supplied criteria
*/
{
if (PoolInternal.pool_error() ==
return new ArrayList();
else
throw new PoolsException();
}
return (aList);
}
/**
* Get the component with the supplied name.
*
* @param type The type of the component to be found.
* @param sys_id The sys_id of the component to be found.
* @throws PoolsExecption If the component cannot be located.
* @return a component with the supplied name.
*/
throws PoolsException
{
throw new PoolsException();
}
/**
* Get the component proxy with the supplied type and sys_id.
*
* @param type The type of the component to be found.
* @param sys_id The sys_id of the component to be found.
* @throws PoolsExecption If the component cannot be located.
* @return a component with the supplied name.
*/
throws PoolsException
{
throw new PoolsException();
}
/**
* Get a list of components which match the supplied selection criteria
* in values.
*
* @param values A list of values to be used to qualify the search.
* @throws PoolsExecption If there is an error executing the query.
* @return a list of components which match the supplied criteria
*/
{
if (PoolInternal.pool_error() ==
return new ArrayList();
else
throw new PoolsException();
}
/*
* Extract type information
*/
throw new PoolsException();
throw new PoolsException();
throw new PoolsException();
throw new PoolsException();
sys_id));
else
}
return (aList);
}
/**
* Get a list of component proxies which match the supplied
* selection criteria in values.
*
* @param values A list of values to be used to qualify the search.
* @throws PoolsExecption If there is an error executing the query.
* @return a list of component proxies which match the
* supplied criteria
*/
{
if (PoolInternal.pool_error() ==
return new ArrayList();
else
throw new PoolsException();
}
return (components);
}
/**
* Returns a descriptive string which describes the configuration.
*
* @param deep Whether the information should contain information about
* all contained elements.
* @return a descriptive string which describes the configuration.
*/
{
}
/**
* Returns a string representation of this configuration.
*
* @return a string representation of this configuration.
*/
{
}
/**
* Indicates whether some other Configuration is "equal to this one.
* @param o the reference object with which to compare.
* @return <code>true</code> if this object is the same as the
* o argument; <code>false</code> otherwise.
* @see #hashCode()
*/
{
if (o == this)
return (true);
if (!(o instanceof Configuration))
return (false);
return (false);
return (true);
}
/**
* Returns a hash code value for the object. This method is
* supported for the benefit of hashtables such as those provided by
* <code>java.util.Hashtable</code>.
*
* @return a hash code value for this object.
* @see #equals(java.lang.Object)
* @see java.util.Hashtable
*/
public int hashCode()
{
}
/**
* Return the pointer to this configuration as an element.
*
* @return The pointer to the native configuration which this object
* wraps.
* @throws PoolsExecption If there is an error converting the native
* configuration pointer to a native elem pointer.
*/
{
long elem;
throw new PoolsException();
return (elem);
}
/**
* Return the anme of the configuration.
*/
{
return (name);
}
/**
* Return the key of the configuration.
*/
{
return (key);
}
}