public abstract class LscBean extends Object implements IBean, Serializable
This object mainly provides methods to store and access "attributes", i.e. named fields and their values.
This implementation ignores the case of attribute names, and uses Java Sets to store lists of values, so values must be unique and are unordered.
Constructor and Description |
---|
LscBean() |
Modifier and Type | Method and Description |
---|---|
LscBean |
clone()
Clone this Bean object.
|
LscDatasets |
datasets() |
Set<Object> |
getAttributeAsSetById(String id)
Deprecated.
|
Attribute |
getAttributeById(String id)
Deprecated.
|
String |
getAttributeFirstValueById(String id)
Deprecated.
|
Set<String> |
getAttributesNames()
Get the attributes name.
|
List<String> |
getAttributeValuesById(String id)
Get all values of an attribute from its name
|
Set<Object> |
getDatasetAsSetById(String id)
Get an attribute from its name as a Set.
|
List<byte[]> |
getDatasetBinaryValuesById(String id)
Get all binary values of an attribute from its name
|
Set<Object> |
getDatasetById(String id)
Get an dataset from its name.
|
byte[] |
getDatasetFirstBinaryValueById(String id)
Get the first binary value of an attribute from its name
|
String |
getDatasetFirstValueById(String id)
Get the first value of an attribute from its name
|
byte[] |
getDatasetsBytes() |
Set<String> |
getDatasetsNames()
Get the attributes name list.
|
List<String> |
getDatasetValuesById(String id)
Get all values of an attribute from its name
|
String |
getDistinguishedName()
Deprecated.
|
String |
getDN()
Deprecated.
|
String |
getFullDistinguishedName()
Deprecated.
|
static LscBean |
getInstance(SearchResult entry,
String baseDn,
Class<?> c)
Set a bean from an LDAP entry
|
String |
getMainIdentifier()
Default distinguished name getter.
|
void |
setAttribute(Attribute attr)
Set an attribute.
|
void |
setAttribute(String name,
Set<Object> values)
Deprecated.
|
void |
setDataset(String name,
Set<Object> values)
Set a dataset.
|
void |
setDatasets(LscDatasets datasets) |
void |
setDistinguishName(String dn)
Deprecated.
|
void |
setMainIdentifier(String id)
Default main object identifier setter.
|
static void |
setMetadata(ResultSetMetaData metaData)
Manage something there !
|
String |
toString()
Bean pretty printer.
|
public final Set<Object> getDatasetById(String id)
getDatasetById
in interface IBean
id
- the name@Deprecated public final Attribute getAttributeById(String id)
IBean
getAttributeById
in interface IBean
id
- the namepublic final Set<Object> getDatasetAsSetById(String id)
id
- the name@Deprecated public final Set<Object> getAttributeAsSetById(String id)
IBean
getAttributeAsSetById
in interface IBean
id
- the namepublic final String getDatasetFirstValueById(String id) throws NamingException
getDatasetFirstValueById
in interface IBean
id
- The attribute name (case insensitive)NamingException
@Deprecated public final String getAttributeFirstValueById(String id) throws NamingException
IBean
getAttributeFirstValueById
in interface IBean
id
- The attribute name (case insensitive)NamingException
public byte[] getDatasetFirstBinaryValueById(String id) throws NamingException
getDatasetFirstBinaryValueById
in interface IBean
id
- The attribute name (case insensitive)NamingException
public final List<String> getDatasetValuesById(String id) throws NamingException
id
- The attribute name (case insensitive)NamingException
public final List<byte[]> getDatasetBinaryValuesById(String id) throws NamingException
id
- The attribute name (case insensitive)NamingException
public final List<String> getAttributeValuesById(String id) throws NamingException
IBean
getAttributeValuesById
in interface IBean
id
- The attribute name (case insensitive)NamingException
public final Set<String> getDatasetsNames()
public final Set<String> getAttributesNames()
IBean
getAttributesNames
in interface IBean
public final void setAttribute(Attribute attr)
setAttribute
in interface IBean
attr
- the attribute to setpublic final void setDataset(String name, Set<Object> values)
setDataset
in interface IBean
name
- The dataset name.values
- A set of values for this dataset.@Deprecated public final void setAttribute(String name, Set<Object> values)
IBean
setAttribute
in interface IBean
name
- The attribute name.values
- A set of values for the attribute.public final String getMainIdentifier()
getMainIdentifier
in interface IBean
@Deprecated public final String getDistinguishedName()
IBean
getDistinguishedName
in interface IBean
@Deprecated public final String getDN()
@Deprecated public final String getFullDistinguishedName()
public final void setMainIdentifier(String id)
setMainIdentifier
in interface IBean
id
- The main identifier to set@Deprecated public final void setDistinguishName(String dn)
IBean
setDistinguishName
in interface IBean
dn
- The distinguishedName to setpublic final String toString()
public LscBean clone() throws CloneNotSupportedException
clone
in interface IBean
clone
in class Object
CloneNotSupportedException
public static void setMetadata(ResultSetMetaData metaData)
metaData
- public static LscBean getInstance(SearchResult entry, String baseDn, Class<?> c) throws NamingException
entry
- the LDAP entrybaseDn
- the base Dn used to set the right Dnc
- class to instantiateNamingException
- thrown if a directory exception is encountered while looking
at the entrypublic LscDatasets datasets()
public void setDatasets(LscDatasets datasets)
setDatasets
in interface IBean
public byte[] getDatasetsBytes()
Copyright © 2005-2024 LSC project. All Rights Reserved.