Package com.sun.solaris.service.pools
Class Configuration
- java.lang.Object
-
- com.sun.solaris.service.pools.Element
-
- com.sun.solaris.service.pools.Configuration
-
- All Implemented Interfaces:
Property,PropertyWalk
public class Configuration extends Element
TheConfigurationclass represents a pools configuration.
-
-
Constructor Summary
Constructors Constructor Description Configuration(java.lang.String location, int perms)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the configuration.voidcommit(int active)Commit the configuration, making any changes since the configuration was last committed (or opened if there have been no prior commits) permanent.PoolcreatePool(java.lang.String name)Create a pool with the supplied name.ResourcecreateResource(java.lang.String type, java.lang.String name)Create a resource with the supplied type and name.voiddestroyPool(Pool aPool)Destroy the supplied PoolInternal.voiddestroyResource(Resource res)Destroy the supplied resource.booleanequals(java.lang.Object o)Indicates whether some other Configuration is "equal to this one.voidexport(java.lang.String location, int format)Export the configuration, storing the current state of the configuration at the supplied location in the supplied format.protected voidfinalize()Reclaim the memory allocated for this configuration by the C proxy.ComponentgetComponent(java.lang.String type, long sys_id)Get the component with the supplied name.java.util.ListgetComponents(java.util.List values)Get a list of components which match the supplied selection criteria in values.protected longgetElem()Return the pointer to this configuration as an element.java.lang.StringgetInformation(int deep)Returns a descriptive string which describes the configuration.java.lang.StringgetLocation()Returns the location of the configuration.PoolgetPool(java.lang.String name)Get the pool with the supplied name.java.util.ListgetPools(java.util.List values)Get a list of pools which match the supplied selection criteria in values.ResourcegetResource(java.lang.String type, java.lang.String name)Get the resource with the supplied name.java.util.ListgetResources(java.util.List values)Get a list of resources which match the supplied selection criteria in values.inthashCode()Returns a hash code value for the object.voidopen(java.lang.String location, int perms)Opens the configuration at the supplied location and with the supplied permissions.voidremove()Remove the configuration.voidrollback()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.intstatus()Returns the status of the configuration.java.lang.StringtoString()Returns a string representation of this configuration.intupdate()Update the configuration, ensuring that the current state of the configuration reflects that of the kernel.voidvalidate(int level)Validate the configuration, ensuring that the current state of the configuration satisfies the supplied validation level.-
Methods inherited from class com.sun.solaris.service.pools.Element
getBoolProperty, getDoubleProperty, getLongProperty, getProperty, getStringProperty, putProperty, rmProperty, walk, walkProperties
-
-
-
-
Constructor Detail
-
Configuration
public Configuration(java.lang.String location, int perms) throws PoolsExceptionConstructor- Parameters:
location- The location of the configuration.perms- The OR'd permissions used when opening this configuration.- Throws:
PoolsException- The error message generated by libpool.
-
-
Method Detail
-
finalize
protected void finalize() throws java.lang.ThrowableReclaim the memory allocated for this configuration by the C proxy.- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable- If freeing this configuration fails.
-
open
public void open(java.lang.String location, int perms) throws PoolsExceptionOpens the configuration at the supplied location and with the supplied permissions.- Throws:
PoolsException- if there is an error opening the configuration.
-
close
public void close()
Closes the configuration.
-
getLocation
public java.lang.String getLocation()
Returns the location of the configuration.- Returns:
- the location of the configuration.
-
status
public int status()
Returns the status of the configuration.- Returns:
- the status of the configuration.
-
remove
public void remove() throws PoolsExceptionRemove the configuration.- Throws:
PoolsException- If the removal fails.
-
rollback
public void rollback() throws PoolsExceptionRollback 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:
PoolsException- If the rollback fails.
-
commit
public void commit(int active) throws PoolsExceptionCommit the configuration, making any changes since the configuration was last committed (or opened if there have been no prior commits) permanent.- Throws:
PoolsException- If the commit fails.
-
export
public void export(java.lang.String location, int format) throws PoolsExceptionExport the configuration, storing the current state of the configuration at the supplied location in the supplied format.- Parameters:
location- The location of the export.format- The format of the export.- Throws:
PoolsException- If the export fails.
-
validate
public void validate(int level) throws PoolsExceptionValidate the configuration, ensuring that the current state of the configuration satisfies the supplied validation level.- Parameters:
level- The desired level of validation.- Throws:
PoolsException- If the validation fails.
-
update
public int update() throws PoolsExceptionUpdate the configuration, ensuring that the current state of the configuration reflects that of the kernel.- Returns:
- a bitmap of the changed types.
- Throws:
PoolsException- If the update fails.
-
createPool
public Pool createPool(java.lang.String name) throws PoolsException
Create a pool with the supplied name.- Parameters:
name- The name of the PoolInternal.- Returns:
- a pool with the supplied name.
- Throws:
PoolsException- If the pool creation fails.
-
destroyPool
public void destroyPool(Pool aPool) throws PoolsException
Destroy the supplied PoolInternal.- Parameters:
aPool- The pool to be destroyed.- Throws:
PoolsException- If the pool cannot be located.
-
getPool
public Pool getPool(java.lang.String name) throws PoolsException
Get the pool with the supplied name.- Parameters:
name- The name of the pool to be found.- Returns:
- a pool with the supplied name.
- Throws:
PoolsException- If the pool cannot be located.
-
getPools
public java.util.List getPools(java.util.List values) throws PoolsExceptionGet a list of pools which match the supplied selection criteria in values.- Parameters:
values- A list of values to be used to qualify the search.- Returns:
- a list of pools which match the supplied criteria
- Throws:
PoolsException- If there is an error executing the query.
-
createResource
public Resource createResource(java.lang.String type, java.lang.String name) throws PoolsException
Create a resource with the supplied type and name.- Parameters:
type- The type of the resource.name- The name of the resource.- Returns:
- a resource of the supplied type and name.
- Throws:
PoolsException- If the resource creation fails.
-
destroyResource
public void destroyResource(Resource res) throws PoolsException
Destroy the supplied resource.- Parameters:
res- The resource to be destroyed.- Throws:
PoolsException- If the resource cannot be located.
-
getResource
public Resource getResource(java.lang.String type, java.lang.String name) throws PoolsException
Get the resource with the supplied name.- Parameters:
type- The type of the resource to be found.name- The name of the resource to be found.- Returns:
- a resource with the supplied name.
- Throws:
PoolsException- If the resource cannot be located.
-
getResources
public java.util.List getResources(java.util.List values) throws PoolsExceptionGet a list of resources which match the supplied selection criteria in values.- Parameters:
values- A list of values to be used to qualify the search.- Returns:
- a list of resources which match the supplied criteria
- Throws:
PoolsException- If there is an error executing the query.
-
getComponent
public Component getComponent(java.lang.String type, long sys_id) throws PoolsException
Get the component with the supplied name.- Parameters:
type- The type of the component to be found.sys_id- The sys_id of the component to be found.- Returns:
- a component with the supplied name.
- Throws:
PoolsException- If the component cannot be located.
-
getComponents
public java.util.List getComponents(java.util.List values) throws PoolsExceptionGet a list of components which match the supplied selection criteria in values.- Parameters:
values- A list of values to be used to qualify the search.- Returns:
- a list of components which match the supplied criteria
- Throws:
PoolsException- If there is an error executing the query.
-
getInformation
public java.lang.String getInformation(int deep)
Returns a descriptive string which describes the configuration.- Specified by:
getInformationin classElement- Parameters:
deep- Whether the information should contain information about all contained elements.- Returns:
- a descriptive string which describes the configuration.
-
toString
public java.lang.String toString()
Returns a string representation of this configuration.
-
equals
public boolean equals(java.lang.Object o)
Indicates whether some other Configuration is "equal to this one.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- the reference object with which to compare.- Returns:
trueif this object is the same as the o argument;falseotherwise.- See Also:
hashCode()
-
hashCode
public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided byjava.util.Hashtable.- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hash code value for this object.
- See Also:
equals(java.lang.Object),Hashtable
-
getElem
protected long getElem() throws PoolsExceptionReturn the pointer to this configuration as an element.- Specified by:
getElemin classElement- Returns:
- The pointer to the native configuration which this object wraps.
- Throws:
PoolsException- If there is an error converting the native configuration pointer to a native elem pointer.
-
-