public abstract class DirRecord extends Object implements Serializable
We will implement some aspects of the ldif as defined in RFC 2849 within this class. These will be related to the content vs change records. By default, a DirRecord object will be a content record. However, we will allow the creation of change type records. Having this defined here allows applications to pass around DirRecord objects without any idea of the underlying implementation.
Currently the following is implemented:
| Modifier and Type | Field and Description |
|---|---|
static int |
changeTypeAdd |
static int |
changeTypeDelete |
static int |
changeTypeInvalid |
static int |
changeTypeModdn |
static int |
changeTypeModify |
| Constructor and Description |
|---|
DirRecord() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttr(String attr,
Object val)
Add the attribute value to the table.
|
NamingEnumeration<?> |
attrElements(String attr)
Retrieve an enumeration of the named attribute's values.
|
boolean |
attrEquals(Attribute thisA,
Attribute that) |
int |
attrValCompare(Object val,
Attribute that,
boolean ignoreCase)
Compare the given single value with the attribute value(s).
|
int |
attrValCompare(Object val,
String attrName,
boolean ignoreCase)
Extract the target attribute from this record then
compare the given single value with the attribute value(s).
|
void |
clear()
Should be overriden to clear attributes.
|
boolean |
contains(Attribute attr)
Return true if the record contains all of the values of the given
attribute.
|
boolean |
dnEquals(DirRecord that)
Check dns for equality
|
boolean |
equals(DirRecord that)
Compare this with that.
|
boolean |
equals(DirRecord that,
String[] attrIDs)
Simpler form of equals in which attributes have the same names in both
records.
|
boolean |
equals(DirRecord that,
String[] thisAttrIDs,
String[] thatAttrIDs)
Compare this with that only looking at the named attributes.
|
boolean |
equalsAllBut(DirRecord that,
String[] attrIDs)
This compares all but the named attributes
allbut true => All must be equal except those on the list
|
Attribute |
findAttr(String attr) |
abstract Attributes |
getAttributes() |
String |
getAttrStr(String attr)
getAttrStr - return first (or only) string value for given attribute
|
Object |
getAttrVal(String attr)
getAttrVal - return first (or only) value for given attribute
"dn" is treated as an attribute name.
|
int |
getChangeType() |
String |
getDn()
return the dn for this record.
|
boolean |
getIsContent() |
ModificationItem[] |
getMods() |
String |
getName()
return the name for this record.
|
void |
setAttr(String attr,
Object val)
Set the attribute value in the table.
|
void |
setChangeType(int val) |
void |
setDn(String val)
Set the dn for this record.
|
void |
setIsContent(boolean val) |
void |
setName(String val)
Set the name for this record.
|
public static final int changeTypeInvalid
public static final int changeTypeAdd
public static final int changeTypeDelete
public static final int changeTypeModify
public static final int changeTypeModdn
public abstract Attributes getAttributes() throws NamingException
NamingExceptionpublic Attribute findAttr(String attr) throws NamingException
attr - NamingExceptionpublic void setAttr(String attr, Object val) throws NamingException
attr - val - NamingExceptionpublic void clear()
public void setName(String val) throws NamingException
val - NamingExceptionpublic String getName() throws Throwable
Throwablepublic void setDn(String val)
val - NamingExceptionpublic String getDn() throws Throwable
Throwablepublic boolean equals(DirRecord that) throws Throwable
that - Throwablepublic boolean equals(DirRecord that, String[] thisAttrIDs, String[] thatAttrIDs) throws Throwable
that - thisAttrIDs - thatAttrIDs - Throwablepublic boolean equals(DirRecord that, String[] attrIDs) throws Throwable
that - attrIDs - Throwablepublic boolean equalsAllBut(DirRecord that, String[] attrIDs) throws Throwable
that - attrIDs - Throwablepublic boolean attrEquals(Attribute thisA, Attribute that) throws Throwable
thisA - that - Throwablepublic int attrValCompare(Object val, Attribute that, boolean ignoreCase) throws Throwable
val - that - ignoreCase - Throwablepublic int attrValCompare(Object val, String attrName, boolean ignoreCase) throws Throwable
val - attrName - ignoreCase - Throwablepublic boolean dnEquals(DirRecord that) throws Throwable
that - Throwablepublic void addAttr(String attr, Object val) throws NamingException
attr - String attribute nameval - Object valueNamingExceptionpublic Object getAttrVal(String attr) throws Throwable
attr - String attribute nameThrowablepublic boolean contains(Attribute attr) throws Throwable
attr - Attribute we're looking forThrowablepublic NamingEnumeration<?> attrElements(String attr) throws NamingException
attr - NamingExceptionpublic String getAttrStr(String attr) throws Throwable
attr - String attribute nameThrowablepublic boolean getIsContent()
public int getChangeType()
public ModificationItem[] getMods() throws Throwable
Throwablepublic void setIsContent(boolean val)
val - public void setChangeType(int val)
val - Copyright © 2018 Bedework. All rights reserved.