Skip navigation links

Oracle Virtual Directory Java API Reference
11g Release 1 (11.1.1)

E10688-03


com.octetstring.vde
Class Entry

java.lang.Object
  extended by com.octetstring.vde.Entry

All Implemented Interfaces:
java.io.Serializable

public class Entry
extends java.lang.Object
implements java.io.Serializable

The Entry class represents an LDAP entry in Java.

Author:
Octet String, Inc.
See Also:
Serialized Form

Constructor Summary
Entry()
          Creates a new Entry instance.
Entry(byte[] entryBytes)
          Creates a new Entry instance.
Entry(DirectoryString name)
          Creates a new Entry instance with the specified DN
Entry(Entry entry)
          Creates a new Entry instance.
Entry(Entry entry, boolean recreateName)
          Creates a new Entry instance., re-creating the dn from scratch

 

Method Summary
 void clear()
          Cleans up the reference resources not being used anymore
 java.lang.Object clone()
          Creates an exact copy of this entry that can be changed without affecting the original entry.
 boolean containsKey(DirectoryString attributeType)
          Checks to see whether this entry contains a particular attribute type.
 java.util.Vector<Syntax> get(DirectoryString attributeType)
          Retrieves the value(s) associated with a particular attribute type.
 java.util.Collection<Attribute> getAllAttributes()
           
 byte[] getAsByteArray()
          Retrieves the contents of this entry as a byte array.
 java.util.Vector<Attribute> getAttributes()
          Deprecated. 
 DirectoryString getBase()
          Retrieve the entry immediately above this entry in the directory tree.
 int getID()
          Retrieve the id of this entry.
 DirectoryString getName()
          Retrieve the distinguished name of this entry
 java.util.List<DirectoryString> getSubTypeAttributes()
           
 boolean isReturnEntry()
          Determines if the entry should be returned to the client
 java.util.Enumeration<DirectoryString> keys()
          Returns an enumeration of all attribute types available in this entry
 void put(DirectoryString attributeType, java.util.Vector<? extends Syntax> values)
          Replaces/Adds one or more values to this entry
 void put(DirectoryString attributeType, java.util.Vector<? extends Syntax> values, boolean checkExist)
          A version of the put method that allows a bypass of checking for the previous existence of the specified attribute type.
 void readFrom(Entry entry)
          Required for the new chain system to allow Entry objects to take the value of another Entry without creating a new reference
 void remove(DirectoryString attributeType)
          Removes the specified attribute type from this entry
static DirectoryString removeLangTag(DirectoryString attribute)
           
 void setAttributes(java.util.Collection<Attribute> attributeList)
           
 void setBase(DirectoryString base)
          Set the entry immediately above this entry in the directory tree
 void setID(int id)
          Set the id number of this entry
 void setName(DirectoryString name)
          Set the distinguished name of this entry
 void setName(DirectoryString name, boolean bypassConstruct)
          Set the distinguished name of the entry with an option for bypassing the normalization step.
 void setReturnAttrs(java.util.List<DirectoryString> returnAttrs)
           
 void setReturnEntry(boolean returnEntry)
          Set to determine if the entry should be returned to the client
 int size()
           
 org.w3c.dom.Element toDOM(org.w3c.dom.Document doc)
           
 java.lang.String toLDIF()
          Retrieve a string containing an LDIF representation of this entry
 java.lang.String toLDIF(boolean toMaskPassword)
           

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

Entry

public Entry()
Creates a new Entry instance.

Entry

public Entry(byte[] entryBytes)
Creates a new Entry instance.
Parameters:
entryBytes - a byte array representation of an Entry object. Can be generated by getAsByteArray.

Entry

public Entry(Entry entry)
Creates a new Entry instance.
Parameters:
entry - another object of the Entry class

Entry

public Entry(Entry entry,
             boolean recreateName)
Creates a new Entry instance., re-creating the dn from scratch
Parameters:
entry - another object of the Entry class

Entry

public Entry(DirectoryString name)
      throws InvalidDNException
Creates a new Entry instance with the specified DN
Parameters:
name - a DirectoryString value representing the entry's distinguished name
Throws:
InvalidDNException - if the entry name provided is invalid

Method Detail

getAttributes

@Deprecated
public java.util.Vector<Attribute> getAttributes()
Deprecated. 
Retrieve the attribute types present within this entry.
Returns:
a Vector of all attributes available in this entry

getAllAttributes

public java.util.Collection<Attribute> getAllAttributes()

setAttributes

public void setAttributes(java.util.Collection<Attribute> attributeList)

getBase

public DirectoryString getBase()
Retrieve the entry immediately above this entry in the directory tree.
Returns:
a distinguished name represented as a DirectoryString

setBase

public void setBase(DirectoryString base)
             throws InvalidDNException
Set the entry immediately above this entry in the directory tree
Parameters:
base - a DirectoryString value containing the distinguished name of the entry's base
Throws:
InvalidDNException

getName

public DirectoryString getName()
Retrieve the distinguished name of this entry
Returns:
a DirectoryString value containing the DN

setName

public void setName(DirectoryString name)
             throws InvalidDNException
Set the distinguished name of this entry
Parameters:
name - a DirectoryString value containing a DN
Throws:
InvalidDNException - if the entry name is invalid

setName

public void setName(DirectoryString name,
                    boolean bypassConstruct)
             throws InvalidDNException
Set the distinguished name of the entry with an option for bypassing the normalization step. Speeds up setup of the entry, but only advisable if the DN being passed was generated by getName from this or another entry.
Parameters:
name - a DirectoryString value containing the DN
bypassConstruct - true if the construction/normalization process should be bypassed
Throws:
InvalidDNException - should never be thrown by this version of the method

clone

public java.lang.Object clone()
Creates an exact copy of this entry that can be changed without affecting the original entry.
Overrides:
clone in class java.lang.Object
Returns:
an exact copy of this entry

containsKey

public boolean containsKey(DirectoryString attributeType)
Checks to see whether this entry contains a particular attribute type.
Parameters:
attributeType - a DirectoryString value containing an attribute type to check
Returns:
true if the entry contains the specified type

get

public java.util.Vector<Syntax> get(DirectoryString attributeType)
Retrieves the value(s) associated with a particular attribute type.
Parameters:
attributeType - a DirectoryString value representing the attribute we want to retrieve
Returns:
a Vector of values, with each element encoded as an object of a class that implements the Syntax interface

getAsByteArray

public byte[] getAsByteArray()
Retrieves the contents of this entry as a byte array. Allows for easy storage on disk or in other places where bytes can be written.
Returns:
an array of bytes that represent this entry

getID

public int getID()
Retrieve the id of this entry. This ID is arbitrary and is typically assigned by each adapter. IDs can be duplicated between adapters.
Returns:
the id number of this entry

keys

public java.util.Enumeration<DirectoryString> keys()
Returns an enumeration of all attribute types available in this entry
Returns:
an Enumeration of the attribute types this entry contains.

put

public void put(DirectoryString attributeType,
                java.util.Vector<? extends Syntax> values)
Replaces/Adds one or more values to this entry
Parameters:
attributeType - a DirectoryString containing the name of the attribute type whose values will be replaced.
values - a List of all the values this attribute contains. Each element in the vector is an instance of a class implementing the Syntax interface.

put

public void put(DirectoryString attributeType,
                java.util.Vector<? extends Syntax> values,
                boolean checkExist)
A version of the put method that allows a bypass of checking for the previous existence of the specified attribute type. Useful when building the entry from an existing entry.
Parameters:
attributeType - a DirectoryString value containing the attribute type to be changed.
values - a List containing the values of this attribute.
checkExist - true if we should check for the previous existence of this attribute type within the entry

remove

public void remove(DirectoryString attributeType)
Removes the specified attribute type from this entry
Parameters:
attributeType - the attribute type to be removed

setID

public void setID(int id)
Set the id number of this entry
Parameters:
id - an id number to associate with this entry. Can be arbitrarily assigned by an adapter for internal use.

toDOM

public org.w3c.dom.Element toDOM(org.w3c.dom.Document doc)

toLDIF

public java.lang.String toLDIF()
Retrieve a string containing an LDIF representation of this entry
Returns:
an LDIF representation of this entry

toLDIF

public java.lang.String toLDIF(boolean toMaskPassword)

readFrom

public void readFrom(Entry entry)
Required for the new chain system to allow Entry objects to take the value of another Entry without creating a new reference
Parameters:
entry - The entry to be cloned

size

public int size()

isReturnEntry

public boolean isReturnEntry()
Determines if the entry should be returned to the client
Returns:
Returns the returnEntry.

setReturnEntry

public void setReturnEntry(boolean returnEntry)
Set to determine if the entry should be returned to the client
Parameters:
returnEntry - The returnEntry to set.

setReturnAttrs

public void setReturnAttrs(java.util.List<DirectoryString> returnAttrs)
Parameters:
returnAttrs - a list of DirectoryString attribute names that are to be returned. Attributes in the current entry that are not in the returnAttrNames list are removed.

clear

public void clear()
Cleans up the reference resources not being used anymore

removeLangTag

public static DirectoryString removeLangTag(DirectoryString attribute)

getSubTypeAttributes

public java.util.List<DirectoryString> getSubTypeAttributes()

Skip navigation links

Oracle Virtual Directory Java API Reference
11g Release 1 (11.1.1)

E10688-03


Copyright © 2000-2010 Oracle and/or its affiliates. All Rights Reserved.