public class DatabaseEntity
extends java.lang.Object
implements org.apache.avalon.framework.logger.LogEnabled
The entity is the database basic unit of management. It can have properties, all properties have a unique name but a property may have multiple values.
TODO?: this class is not completely implemented.
Constructor and Description |
---|
DatabaseEntity(java.lang.String id)
Creates an instance with the specified id
|
Modifier and Type | Method and Description |
---|---|
void |
addProperties(java.lang.String name,
java.lang.String[] values)
Adds or updates a property with a list of values to a DatabaseEntity.
|
void |
addProperty(java.lang.String name,
java.lang.String value) |
boolean |
containsProperty(java.lang.String name) |
boolean |
containsValue(java.lang.String propertyName,
java.lang.String propertyValue) |
void |
deleteProperty(java.lang.String name)
Deletes a properties object
|
void |
deleteValue(java.lang.String propertyName,
java.lang.String value)
Delete a valud from a property of this entity
|
void |
dump(java.io.PrintStream ps)
Dumps a debug info of this object.
|
void |
enableLogging(org.apache.avalon.framework.logger.Logger logger)
Sets the super.getLog().
|
java.lang.String |
getId()
Returns the id for this entity
|
Property[] |
getProperties()
Get's all the ContextKeys of this Database Entity
|
java.lang.String |
getProperty(java.lang.String name)
Get's the first value of the Property specified by a name
|
java.lang.String[] |
getPropertyValues(java.lang.String name)
Get's the values of a of the Property specified by a name
|
void |
setId(java.lang.String id)
Modifies the id for this entity
|
public DatabaseEntity(java.lang.String id) throws SDXException
id
- The id to assign to this entitySDXException
public java.lang.String getId()
public void setId(java.lang.String id)
public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
enableLogging
in interface org.apache.avalon.framework.logger.LogEnabled
logger
- The super.getLog() to use.public void addProperty(java.lang.String name, java.lang.String value)
public void addProperties(java.lang.String name, java.lang.String[] values)
If a property by the name specified already exists, the values are added to the property's list of values, if one wishes to replace the existing property, the property should be deleted first using the deleteProperty(String name) in this class, and then re-add the property
name
- The name to assign to the Propertyvalues
- An array of String values for the propertypublic java.lang.String getProperty(java.lang.String name)
name
- The name of an existing the Propertypublic java.lang.String[] getPropertyValues(java.lang.String name)
name
- The name of an existing the Propertypublic Property[] getProperties()
public void deleteProperty(java.lang.String name) throws SDXException
name
- The name of the property to be deletedSDXException
- If the name is null or an empty String.public void deleteValue(java.lang.String propertyName, java.lang.String value) throws SDXException
propertyName
- The propertynamevalue
- The value to deleteSDXException
public void dump(java.io.PrintStream ps)
public boolean containsProperty(java.lang.String name)
public boolean containsValue(java.lang.String propertyName, java.lang.String propertyValue)
Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.