com.novell.service.file.nw
Class VolumeRestriction

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

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

Provides for attribute values of volume restrictions associated with a given Volume.

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 you have a code segment of multi-threaded application that 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 you have a code segment of a multi-threaded application that 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.

See Also:
VolumeRestrictionEnumerator

Field Summary
static java.lang.String ATTRIBUTE_ID
          Attribute ID of VolumeRestriction.
static java.lang.String COMPARE_SYNTAX_STRING
          Schema Syntax of VolumeRestriction.
static java.lang.String INUSE_FIELD
          The InUse compare field.
static java.lang.String NAME_FIELD
          The Name compare field.
static java.lang.String RESTRICTION_FIELD
          The Restriction compare field.
static java.lang.String SCHEMA_BINDING_NAME
          Schema Name of VolumeRestriction.
 
Constructor Summary
VolumeRestriction()
          Creates a Default VolumeRestriction Constructor with no parameters.
VolumeRestriction(java.lang.String name)
          Creates a VolumeRestriction Constructor object with only the name parameter known, and initializes the object to the values of theis parameter.
VolumeRestriction(java.lang.String name, int restriction, int inUse)
          Creates a full VolumeRestriction Constructor object with all possible state parameters, and initializes the object to the values of these parameters.
 
Method Summary
 java.lang.Object clone()
          Clones the current VolumeRestriction object.
 void copy(VolumeRestriction from)
          Copies the CallsServiceRemote from object into this object.
 void copySubset(VolumeRestriction from)
           
 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.
 int getInUse()
          Returns the inUse field of this Object.
 java.lang.String getName()
          Returns a reference to this object's name field.
 int getObjectId()
          Returns the objectId field of this Object.
 int getRestriction()
          Returns the restriction field of this Object.
 com.novell.service.rfc1960.Rfc1960Parser getSearchStringParser()
          Returns the RFC1960 Search String parser for the compare string.
 void setCompareString(java.lang.String compareString)
          Sets the compare string value for the compare fields.
 void setInUse(int value)
          Sets the inUse field of this Object.
 void setName(java.lang.String value)
          Sets the value of this object's name field.
 void setObjectId(int value)
          Sets the objectId field of this Object.
 void setRestriction(int value)
          Sets the restriction field of this Object.
 java.lang.String toString()
          Returns a String representation of this object.
 
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 VolumeRestriction.

(ATTRIBUTE_ID = "Volume Restrictions")


SCHEMA_BINDING_NAME

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

(SCHEMA_BINDING_NAME = ATTRIBUTE_ID + " Definition")


COMPARE_SYNTAX_STRING

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

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


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)

RESTRICTION_FIELD

public static final java.lang.String RESTRICTION_FIELD
The Restriction compare field.

(RESTRICTION_FIELD = "Restriction")

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

INUSE_FIELD

public static final java.lang.String INUSE_FIELD
The InUse compare field.

(INUSE_FIELD = "InUse")

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

VolumeRestriction

public VolumeRestriction()
Creates a Default VolumeRestriction Constructor with no parameters.

VolumeRestriction

public VolumeRestriction(java.lang.String name,
                         int restriction,
                         int inUse)
Creates a full VolumeRestriction Constructor object with all possible state parameters, and initializes the object to the values of these parameters.
Parameters:
name - The name data members value.
restriction - The restriction data members value.
inUse - The inUse data members value.

VolumeRestriction

public VolumeRestriction(java.lang.String name)
Creates a VolumeRestriction Constructor object with only the name parameter known, and initializes the object to the values of theis parameter.

All other data members are set to NULL or zero. The actual name parameter reference will be stored by this object (it will not be cloned). Later modifications to to this references state will be reflected in this object.

Parameters:
name - The name data members value.
Method Detail

getName

public java.lang.String getName()
Returns a reference to this object's name field.

If you modify the state of the returned object, it will be reflected in this object.

Returns:
The current value of this object's name field.

setName

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

The actual parameter reference will be stored by this object (it will not be cloned). Later modifications to to this reference's state will be reflected in this object.

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

getRestriction

public int getRestriction()
Returns the restriction field of this Object.
Returns:
The current value of this object's restriction field in 4K pieces.

setRestriction

public void setRestriction(int value)
Sets the restriction field of this Object.
Parameters:
value - The new value of this object's restriction field in 4K pieces.

getInUse

public int getInUse()
Returns the inUse field of this Object.
Returns:
The current value of this object's inUse field in 4K pieces.

setInUse

public void setInUse(int value)
Sets the inUse field of this Object.
Parameters:
value - The new value of this object's inUse field in 4K pieces.

getObjectId

public int getObjectId()
Returns the objectId field of this Object.

This method should only be used by name space provider spi code.

Returns:
The current value of this object's objectId field.

setObjectId

public void setObjectId(int value)
Sets the objectId field of this Object.

This method should only be used by name space provider spi code.

Parameters:
value - The new value of this object's objectId 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 name, restriction, and inUse fields. If the string passed in is not a valid RFC1960 formated string, this method will throw an IllegalArgumentException. If the compareString value is NULL, RFC1960 formatted compares will be disabled.

The names of these fields have taken 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 string passed in is not a valid RFC1960 formatted string.
See Also:
equals(java.lang.Object), NAME_FIELD, RESTRICTION_FIELD, INUSE_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 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 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), NAME_FIELD, RESTRICTION_FIELD, INUSE_FIELD

toString

public java.lang.String toString()
Returns a String representation of this object.

The String representation is in the following format: "name: s, restriction: n, inUse: n, compareString: s"

Returns:
A String representation of this object.
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Clones the current VolumeRestriction object.

Instantiates a new object of this type with all new references, but with the same values within those references.

Returns:
A new VolumeRestriction object with the same values.

copySubset

public void copySubset(VolumeRestriction from)

copy

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