com.novell.service.file.nw
Class VolumeUtilization

java.lang.Object
  |
  +--com.novell.service.file.nw.VolumeUtilization

public class VolumeUtilization
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Provides the attribute value for volume utilization.

This attribute value is unique from all other attribute values in that it requires the objectName be set by the user before it can obtain the values. Because of this feature the attribute value can not be setup for searching (only the default constructor is available). The returned jndi attribute value will actually be an object that will obtain all values when the setName() or setObjectId() methods are called. Calling any methods, other than Objectname(), previous to this time will cause an IllegalStateException to be thrown.

This class results in a mutable object. For versitility, code block synchronization has been implemented in the various jndi search and modify methods of this class's implementation to provide for thread safe operation.

If a code segment of a multi-threaded application uses get methods of this class, and there is a potential of another thread randomly using corresponding set methods of this class, you should enclose the calls to the get methods of this class in a synchronized code block.

If a code segment of a multi-threaded application uses set methods of this class, and there is a potential of another thread randomly using corresponding get methods of this class, you should enclose the calls to the set methods of this class in a synchronized code block.


Field Summary
static java.lang.String ATTRIBUTE_ID
          Attribute ID of VolumeUtilization.
static java.lang.String COMPARE_SYNTAX_STRING
          Schema Syntax of VolumeUtilization.
static java.lang.String NAME_FIELD
          The Name compare field.
static java.lang.String SCHEMA_BINDING_NAME
          Schema Name of VolumeUtilization.
static java.lang.String USEDBLOCKS_FIELD
          The UsedBlocks compare field.
static java.lang.String USEDDIRECTORIES_FIELD
          The UsedDirectories compare field.
static java.lang.String USEDFILES_FIELD
          The UsedFiles compare field.
 
Constructor Summary
VolumeUtilization()
          Constructs a default VolumeUtilization object with no parameters.
VolumeUtilization(java.lang.String Name)
          Constructs a VolumeUtilization object with only a name parameter.
 
Method Summary
 java.lang.Object clone()
          Instantiates a new object of this type with all new references, but with the same values within those references.
 void copy(VolumeUtilization from)
          Copies the CallsServiceRemote from object into this object.
 boolean equals(java.lang.Object obj)
          Compares the input object against this object for equality.
 java.lang.String getCompareString()
          Returns the current value of the compareString.
 java.lang.String getName()
          Returns the name field of this Object.
 com.novell.service.rfc1960.Rfc1960Parser getSearchStringParser()
          Returns the RFC1960 search string parser for the compare string.
 int getUsedBlocks()
          Returns the usedBlocks field of this Object.
 int getUsedDirectories()
          Returns the usedDirectories field of this Object.
 int getUsedFiles()
          Returns the usedFiles field of this Object.
 void setCompareString(java.lang.String compareString)
          Sets the compare string value for the compare fields.
 void setName(java.lang.String value)
          Sets the name field of this Object.
 void setUsedBlocks(int value)
          Sets the usedBlocks field of this Object.
 void setUsedDirectories(int value)
          Sets the usedDirectories field of this Object.
 void setUsedFiles(int value)
          Sets the usedFiles field of this Object.
 java.lang.String toString()
          Returns a String representation of the VolumeUtilization object in the format: "name: s, usedDirectories: n, usedFiles: n, usedBlocks: n".
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTRIBUTE_ID

public static final java.lang.String ATTRIBUTE_ID
Attribute ID of VolumeUtilization.

(ATTRIBUTE_ID = "Volume Utilizations")


SCHEMA_BINDING_NAME

public static final java.lang.String SCHEMA_BINDING_NAME
Schema Name of VolumeUtilization.

(SCHEMA_BINDING_NAME = ATTRIBUTE_ID + " Definition")


COMPARE_SYNTAX_STRING

public static final java.lang.String COMPARE_SYNTAX_STRING
Schema Syntax of VolumeUtilization.

(COMPARE_SYNTAX_STRING = "(" + SearchStringComponent.EQUALS_STRING + "," + SearchStringComponent.PRESENT_STRING + "," + SearchStringComponent.SUBSTRING_STRING + ")")


USEDDIRECTORIES_FIELD

public static final java.lang.String USEDDIRECTORIES_FIELD
The UsedDirectories compare field.

(USEDDIRECTORIES_FIELD = "UsedDirectories")

See Also:
setCompareString(java.lang.String), equals(java.lang.Object)

USEDFILES_FIELD

public static final java.lang.String USEDFILES_FIELD
The UsedFiles compare field.

(USEDFILES_FIELD = "UsedFiles")

See Also:
setCompareString(java.lang.String), equals(java.lang.Object)

USEDBLOCKS_FIELD

public static final java.lang.String USEDBLOCKS_FIELD
The UsedBlocks compare field.

(USEDBLOCKS_FIELD = "UsedBlocks")

See Also:
setCompareString(java.lang.String), equals(java.lang.Object)

NAME_FIELD

public static final java.lang.String NAME_FIELD
The Name compare field.

(NAME_FIELD = "Name")

See Also:
setCompareString(java.lang.String), equals(java.lang.Object)
Constructor Detail

VolumeUtilization

public VolumeUtilization()
Constructs a default VolumeUtilization object with no parameters.

VolumeUtilization

public VolumeUtilization(java.lang.String Name)
Constructs a VolumeUtilization object with only a name parameter.
Method Detail

getUsedDirectories

public int getUsedDirectories()
Returns the usedDirectories field of this Object.

The setName() method must be called first before this method can be called, otherwise an IllegalStateException will be thrown.

Returns:
The current value of the usedDirectories field.
Throws:
java.lang.IllegalStateException - if setName() is not called first.
See Also:
setName(java.lang.String)

setUsedDirectories

public void setUsedDirectories(int value)
Sets the usedDirectories field of this Object.

The setName() or setObjectId() methods must be called first before this method can be called, otherwise an IllegalStateException will be thrown.

Parameters:
value - The new value of the usedDirectories field.
Throws:
java.lang.IllegalStateException - if setName() or setObjectId() is not called first.
See Also:
setName(java.lang.String)

getUsedFiles

public int getUsedFiles()
Returns the usedFiles field of this Object.

The setName() method must be called first before this method can be called, otherwise an IllegalStateException will be thrown.

Returns:
The current value of the usedFiles field.
Throws:
java.lang.IllegalStateException - if setName() is not called first.
See Also:
setName(java.lang.String)

setUsedFiles

public void setUsedFiles(int value)
Sets the usedFiles field of this Object.

The setName() or setObjectId() methods must be called first before this method can be called, otherwise an IllegalStateException will be thrown.

Parameters:
value - The new value of the usedFiles field.
Throws:
java.lang.IllegalStateException - if setName() or setObjectId() is not called first.
See Also:
setName(java.lang.String)

getUsedBlocks

public int getUsedBlocks()
Returns the usedBlocks field of this Object.

The setName() method must be called first before this method can be called, otherwise an IllegalStateException will be thrown.

Returns:
The current value of the usedBlocks field.
Throws:
java.lang.IllegalStateException - if setName() is not called first.
See Also:
setName(java.lang.String)

setUsedBlocks

public void setUsedBlocks(int value)
Sets the usedBlocks field of this Object.

The setName() or setObjectId() methods must be called first before this method can be called, otherwise an IllegalStateException will be thrown.

Parameters:
value - The new value of the usedBlocks field.
Throws:
java.lang.IllegalStateException - if setName() or setObjectId() is not called first.
See Also:
setName(java.lang.String)

getName

public java.lang.String getName()
Returns the name field of this Object.
Returns:
The current value of the name field.

setName

public void setName(java.lang.String value)
Sets the name field of this Object.

When the user sets the object name the implementation can then calculate the objectId and obtain the state information. After this call is made, all other methods will then return their corresponding data, based on the last update, caused by calling this method. Each time this method is called (with the same, or a different name) the state is updated.

Parameters:
value - The new value of the name field.

setCompareString

public void setCompareString(java.lang.String compareString)
Sets the compare string value for the compare fields.

The compare string uses the RFC1960 (LDAP) search string format, and is used to allow individual compares on the usedDirectories, usedFiles, usedBlocks, and name fields. If the search string passed in is not a valid RFC1960 formatted string, this method will throw an IllegalArgumentException. If the compareString value is NULL, RFC1960 formatted compares will be disabled.

The names of these fields takes the names of their corresponding methods minus the get or set prefix. Given the following string:

"(&(Name=*printer*)(ObjectId>=2)(Rights>=128))"

The equals method will return TRUE if the name contains the substring printer, the objectId is not 2, and the rights are set to be able to modify (TA_MODIFY). If the approximate operator type is used on the Rights field the various bits of the operand value are checked, and if any of them are set, equals will return TRUE. For example: "(Rights~=3) returns TRUE if either the TA_READ or TA_WRITE bits are set, regardless of what other bits might be set.

Parameters:
compareString - The RFC1960 formatted search string. NULL disables this compare functionality.
Throws:
java.lang.IllegalArgumentException - If the search string passed in is not a valid RFC1960 formatted string.
See Also:
equals(java.lang.Object), USEDDIRECTORIES_FIELD, USEDFILES_FIELD, USEDBLOCKS_FIELD, NAME_FIELD

getCompareString

public java.lang.String getCompareString()
Returns the current value of the compareString.
Returns:
The current value of compareString.
See Also:
setCompareString(java.lang.String)

getSearchStringParser

public com.novell.service.rfc1960.Rfc1960Parser getSearchStringParser()
Returns the RFC1960 search string parser for the compare string.

A Rfc1960Parser object that was instantiated with the compareString last set by the setCompareString method is returned.

Returns:
The Rfc1960Parser object for the current compare String. NULL is returned if the compare string has not been set.

equals

public boolean equals(java.lang.Object obj)
Compares the input object against this object for equality.

If the input object has a RFC1960 compare string, this method will do the comparision based on the commands in the compare string. If the operationType is illegal for the data type being compared, an IllegalArmumentException will be thrown.

Parameters:
obj - The object to compare.
Returns:
A boolean set to TRUE if the objects compared are equal; otherwise FALSE is returned.
Throws:
java.lang.IllegalArgumentException - if the operationType is illegal for the data type being compared.
Overrides:
equals in class java.lang.Object
See Also:
setCompareString(java.lang.String), USEDDIRECTORIES_FIELD, USEDFILES_FIELD, USEDBLOCKS_FIELD, NAME_FIELD

toString

public java.lang.String toString()
Returns a String representation of the VolumeUtilization object in the format: "name: s, usedDirectories: n, usedFiles: n, usedBlocks: n".
Returns:
A String representation of this object.
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Instantiates a new object of this type with all new references, but with the same values within those references.
Returns:
A new VolumeUtilization object with the same values.

copy

public void copy(VolumeUtilization from)
Copies the CallsServiceRemote from object into this object.