|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.ldap.entry.AbstractValue<byte[]>
org.apache.directory.shared.ldap.entry.client.ClientBinaryValue
org.apache.directory.server.core.entry.ServerBinaryValue
public class ServerBinaryValue
A server side schema aware wrapper around a binary attribute value. This value wrapper uses schema information to syntax check values, and to compare them for equality and ordering. It caches results and invalidates them when the wrapped value changes.
Field Summary |
---|
Fields inherited from class org.apache.directory.shared.ldap.entry.AbstractValue |
---|
normalized, normalizedValue, valid, wrapped |
Constructor Summary | |
---|---|
ServerBinaryValue(org.apache.directory.shared.ldap.schema.AttributeType attributeType)
Creates a ServerBinaryValue without an initial wrapped value. |
|
ServerBinaryValue(org.apache.directory.shared.ldap.schema.AttributeType attributeType,
byte[] wrapped)
Creates a ServerBinaryValue with an initial wrapped binary value. |
Method Summary | |
---|---|
protected java.lang.String |
checkAttributeType(org.apache.directory.shared.ldap.schema.AttributeType attributeType)
Check the attributeType member. |
ServerBinaryValue |
clone()
|
int |
compareTo(org.apache.directory.shared.ldap.entry.Value<byte[]> value)
|
void |
deserialize(java.io.ObjectInput in)
Deserialize a ServerBinaryValue. |
boolean |
equals(java.lang.Object obj)
Checks to see if this ServerBinaryValue equals the supplied object. |
org.apache.directory.shared.ldap.schema.AttributeType |
getAttributeType()
Get the associated AttributeType |
byte[] |
getNormalizedValue()
Gets the normalized (canonical) representation for the wrapped byte[]. |
byte[] |
getNormalizedValueCopy()
Gets a direct reference to the normalized representation for the wrapped value of this ServerValue wrapper. |
byte[] |
getNormalizedValueReference()
Gets the normalized (cannonical) representation for the wrapped string. |
int |
hashCode()
|
boolean |
instanceOf(org.apache.directory.shared.ldap.schema.AttributeType attributeType)
Check if the value is stored into an instance of the given AttributeType, or one of its ascendant. |
boolean |
isSame()
|
boolean |
isValid()
Uses the syntaxChecker associated with the attributeType to check if the value is valid. |
protected java.lang.String |
logAssert(java.lang.String message)
Utility method to get some logs if an assert fails |
void |
normalize()
|
void |
readExternal(java.io.ObjectInput in)
|
void |
serialize(java.io.ObjectOutput out)
We will write the value and the normalized value, only if the normalized value is different. |
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class org.apache.directory.shared.ldap.entry.client.ClientBinaryValue |
---|
clear, getCopy, isBinary, normalize, set, toString |
Methods inherited from class org.apache.directory.shared.ldap.entry.AbstractValue |
---|
get, getReference, isNormalized, isNull, isValid, setNormalized |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ServerBinaryValue(org.apache.directory.shared.ldap.schema.AttributeType attributeType)
attributeType
- the schema type associated with this ServerBinaryValuepublic ServerBinaryValue(org.apache.directory.shared.ldap.schema.AttributeType attributeType, byte[] wrapped)
attributeType
- the schema type associated with this ServerBinaryValuewrapped
- the binary value to wrap which may be null, or a zero length byte arrayMethod Detail |
---|
protected java.lang.String logAssert(java.lang.String message)
protected java.lang.String checkAttributeType(org.apache.directory.shared.ldap.schema.AttributeType attributeType)
public void normalize() throws javax.naming.NamingException
normalize
in interface org.apache.directory.shared.ldap.entry.Value<byte[]>
normalize
in class org.apache.directory.shared.ldap.entry.AbstractValue<byte[]>
javax.naming.NamingException
public byte[] getNormalizedValueReference()
getNormalizedValueReference
in interface org.apache.directory.shared.ldap.entry.Value<byte[]>
getNormalizedValueReference
in class org.apache.directory.shared.ldap.entry.AbstractValue<byte[]>
public byte[] getNormalizedValue()
getNormalizedValue
in interface org.apache.directory.shared.ldap.entry.Value<byte[]>
getNormalizedValue
in class org.apache.directory.shared.ldap.entry.AbstractValue<byte[]>
public byte[] getNormalizedValueCopy()
getNormalizedValueCopy
in interface org.apache.directory.shared.ldap.entry.Value<byte[]>
getNormalizedValueCopy
in class org.apache.directory.shared.ldap.entry.client.ClientBinaryValue
public final boolean isValid()
isValid
in interface org.apache.directory.shared.ldap.entry.Value<byte[]>
isValid
in class org.apache.directory.shared.ldap.entry.AbstractValue<byte[]>
Value.isValid()
public final boolean isSame()
public int compareTo(org.apache.directory.shared.ldap.entry.Value<byte[]> value)
compareTo
in interface java.lang.Comparable<org.apache.directory.shared.ldap.entry.Value<byte[]>>
compareTo
in class org.apache.directory.shared.ldap.entry.client.ClientBinaryValue
java.lang.IllegalStateException
- on failures to extract the comparator, or the
normalizers needed to perform the required comparisons based on the schemaValue#compareTo(Value)
public org.apache.directory.shared.ldap.schema.AttributeType getAttributeType()
public boolean instanceOf(org.apache.directory.shared.ldap.schema.AttributeType attributeType) throws javax.naming.NamingException
attributeType
- The AttributeType we are looking at
true
if the value is associated with the given
attributeType or one of its ascendant
javax.naming.NamingException
public int hashCode()
hashCode
in class org.apache.directory.shared.ldap.entry.client.ClientBinaryValue
Object.hashCode()
public boolean equals(java.lang.Object obj)
equals
in class org.apache.directory.shared.ldap.entry.client.ClientBinaryValue
java.lang.IllegalStateException
- on failures to extract the comparator, or the
normalizers needed to perform the required comparisons based on the schemapublic ServerBinaryValue clone()
clone
in interface org.apache.directory.shared.ldap.entry.Value<byte[]>
clone
in class org.apache.directory.shared.ldap.entry.client.ClientBinaryValue
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class org.apache.directory.shared.ldap.entry.client.ClientBinaryValue
java.io.IOException
We can't use this method for a ServerBinaryValue, as we have to feed the value
with an AttributeType object
public void serialize(java.io.ObjectOutput out) throws java.io.IOException
out
- the buffer in which we will stored the serialized form of the value
java.io.IOException
- if we can't write into the bufferpublic void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class org.apache.directory.shared.ldap.entry.client.ClientBinaryValue
java.io.IOException
java.lang.ClassNotFoundException
We can't use this method for a ServerBinaryValue, as we have to feed the value
with an AttributeType object
public void deserialize(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
in
- the buffer containing the bytes with the serialized value
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |