APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.jndi.ldap

pack-priv final Class LdapAttribute

extends BasicAttribute
Class Inheritance
Imports
java.io.IOException, java.util.Hashtable, .Vector, javax.naming.*, javax.naming.directory.*

This subclass is used by LDAP to implement the schema calls. Basically, it keeps track of which context it is an attribute of so it can get the schema for that context.
Author
Jon Ruiz

Field Summary

Modifier and TypeField and Description
private transient DirContext
private Hashtable<String, ? super String>
private String
private Name
pack-priv static final long
Inherited from javax.naming.directory.BasicAttribute:
attrIDorderedvalues

Constructor Summary

AccessConstructor and Description
pack-priv
LdapAttribute(String
The attribute's id. It cannot be null.
id
)

Constructs a new instance of an attribute.

private
LdapAttribute(String
The attribute's id. It cannot be null.
id
,
DirContext
the baseCtx object of this attribute
baseCtx
,
Name
the RDN of the entry (relative to baseCtx)
rdn
)

Constructs a new instance of an attribute.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true Always returns true.
add
(Object
The value to be added. If null, a null value is added to the attribute.
attrVal
)

Overrides javax.naming.directory.BasicAttribute.add.

Implements javax.naming.directory.Attribute.add.

Adds a new value to this attribute.

public Object
clone()

Overrides javax.naming.directory.BasicAttribute.clone.

Implements javax.naming.directory.Attribute.clone.

Makes a copy of the attribute.

public DirContext

Returns:

This attribute's schema definition.
getAttributeDefinition
()

Overrides javax.naming.directory.BasicAttribute.getAttributeDefinition.

Implements javax.naming.directory.Attribute.getAttributeDefinition.

Retrieves this attribute's schema definition.

public DirContext

Returns:

This attribute's syntax definition.
getAttributeSyntaxDefinition
()

Overrides javax.naming.directory.BasicAttribute.getAttributeSyntaxDefinition.

Implements javax.naming.directory.Attribute.getAttributeSyntaxDefinition.

Retrieves the syntax definition associated with this attribute.

private DirContext
getBaseCtx()

returns the ctx this attribute came from.

private void
setBaseCtxInfo()

sets the information needed to reconstruct the baseCtx if we are serialized.

pack-priv void
setParent(DirContext baseCtx, Name rdn)

Sets the baseCtx and rdn used to find the attribute's schema Used by LdapCtx.setParents().

private void
writeObject(ObjectOutputStream out)

Hides javax.naming.directory.BasicAttribute.writeObject.

This is called when the object is serialized.

Inherited from javax.naming.directory.BasicAttribute:
addclearcontainsequalsgetgetgetAllgetIDhashCodeisOrderedremoveremovesetsizetoString

Field Detail

baseCtxback to summary
private transient DirContext baseCtx
baseCtxEnvback to summary
private Hashtable<String, ? super String> baseCtxEnv
baseCtxURLback to summary
private String baseCtxURL
rdnback to summary
private Name rdn
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides javax.naming.directory.BasicAttribute.serialVersionUID, javax.naming.directory.Attribute.serialVersionUID.

Constructor Detail

LdapAttributeback to summary
pack-priv LdapAttribute(String id)

Constructs a new instance of an attribute.

Parameters
id:String

The attribute's id. It cannot be null.

LdapAttributeback to summary
private LdapAttribute(String id, DirContext baseCtx, Name rdn)

Constructs a new instance of an attribute.

Parameters
id:String

The attribute's id. It cannot be null.

baseCtx:DirContext

the baseCtx object of this attribute

rdn:Name

the RDN of the entry (relative to baseCtx)

Method Detail

addback to summary
public boolean add(Object attrVal)

Overrides javax.naming.directory.BasicAttribute.add.

Implements javax.naming.directory.Attribute.add.

Adds a new value to this attribute.

Parameters
attrVal:Object

The value to be added. If null, a null value is added to the attribute.

Returns:boolean

true Always returns true.

cloneback to summary
public Object clone()

Overrides javax.naming.directory.BasicAttribute.clone.

Implements javax.naming.directory.Attribute.clone.

Doc from javax.naming.directory.Attribute.clone.

Makes a copy of the attribute. The copy contains the same attribute values as the original attribute: the attribute values are not themselves cloned. Changes to the copy will not affect the original and vice versa.

Annotations
@SuppressWarnings:unchecked
getAttributeDefinitionback to summary
public DirContext getAttributeDefinition() throws NamingException

Overrides javax.naming.directory.BasicAttribute.getAttributeDefinition.

Implements javax.naming.directory.Attribute.getAttributeDefinition.

Retrieves this attribute's schema definition.

Returns:DirContext

This attribute's schema definition.

Exceptions
NamingException:

Doc from javax.naming.directory.Attribute.getAttributeDefinition.

If a naming exception occurs while getting the schema.

getAttributeSyntaxDefinitionback to summary
public DirContext getAttributeSyntaxDefinition() throws NamingException

Overrides javax.naming.directory.BasicAttribute.getAttributeSyntaxDefinition.

Implements javax.naming.directory.Attribute.getAttributeSyntaxDefinition.

Retrieves the syntax definition associated with this attribute.

Returns:DirContext

This attribute's syntax definition.

Exceptions
NamingException:

Doc from javax.naming.directory.Attribute.getAttributeSyntaxDefinition.

If a naming exception occurs while getting the schema.

getBaseCtxback to summary
private DirContext getBaseCtx() throws NamingException

returns the ctx this attribute came from. This call allows LDAPAttribute to be serializable. 'baseCtx' is transient so if it is null, the `baseCtxURL` is used to reconstruct the context to which calls are made.

setBaseCtxInfoback to summary
private void setBaseCtxInfo()

sets the information needed to reconstruct the baseCtx if we are serialized. This must be called _before_ the object is serialized!!!

Annotations
@SuppressWarnings:unchecked
setParentback to summary
pack-priv void setParent(DirContext baseCtx, Name rdn)

Sets the baseCtx and rdn used to find the attribute's schema Used by LdapCtx.setParents().

writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException

Hides javax.naming.directory.BasicAttribute.writeObject.

This is called when the object is serialized. It is overridden so that the appropriate class variables can be set to re-construct the baseCtx when deserialized. Setting these variables is costly, so it is only done if the object is actually serialized.

Exceptions
IOException:

Doc from javax.naming.directory.BasicAttribute.writeObject.

if an I/O error occurs