|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rhq.core.domain.configuration.Configuration
public class Configuration
This is the root object for the storage of a hierarchical value set of data. This data may represent configurations of external systems or the components within ON. The data values supported are the basic primitive types in containers of maps and lists. Containers may hold other containers creating the hierarchical data structure. This content is loosely related to the definition entities that can provide a model for the possible values and validation of them.
A Configuration
has one or more named Property
objects contained within it (similar to a
Map
). Note that Property
is an abstract class that actually represents either:
PropertySimple
)Property
objects (PropertyList
)Property
objects (PropertyMap
)Because a Configuration can contain a list or map of properties, a Configuration can contain a hierarchy of properties N-levels deep.
Each Property within a Configuration has a name - this not only includes simple properties, but also lists and
maps of properties as well. For example, you can retrieve a list of properties via getList(String)
by
passing in the name of the list.
Property
,
PropertySimple
,
PropertyList
,
PropertyMap
,
Serialized FormField Summary | |
---|---|
static String |
QUERY_GET_PLUGIN_CONFIG_UNIQUE_COUNT_BY_GROUP_AND_PROP_NAME
|
Constructor Summary | |
---|---|
Configuration()
|
Method Summary | |
---|---|
void |
afterUnmarshal(javax.xml.bind.Unmarshaller u,
Object parent)
This listener runs after jaxb unmarshalling and reconnects children properties to their parent configurations (as we don't send them avoiding cyclic references). |
Configuration |
clone()
Clones this object in the same manner as deepCopy() . |
Configuration |
deepCopy()
Makes a fully independent copy of this object and returns it. |
Configuration |
deepCopy(boolean keepIds)
Makes a fully independent copy of this object and returns it. |
boolean |
equals(Object obj)
NOTE: An Configuration containing a null map is considered equal to a Configuration containing an empty map. |
Property |
get(String name)
Retrieves the given property from this Configuration object. |
long |
getCreatedTime()
|
int |
getId()
|
PropertyList |
getList(String name)
Same as get(String) except that it returns the object as a PropertyList . |
Map<String,PropertyList> |
getListProperties()
Returns a map of all direct children of this Configuration that are of type PropertyList . |
Map<String,Property> |
getMap()
Returns the contents of this Configuration as a map. |
PropertyMap |
getMap(String name)
Same as get(String) except that it returns the object as a PropertyMap . |
Map<String,PropertyMap> |
getMapProperties()
Returns a map of all direct children of this Configuration that are of type PropertyMap . |
long |
getModifiedTime()
|
Collection<String> |
getNames()
Returns the names of all properties that are direct children of this Configuration object. |
String |
getNotes()
|
Collection<Property> |
getProperties()
Returns all the direct children of this Configuration. |
PropertySimple |
getSimple(String name)
Same as get(String) except that it returns the object as a PropertySimple . |
Map<String,PropertySimple> |
getSimpleProperties()
Returns a map of all direct children of this Configuration that are of type PropertySimple . |
String |
getSimpleValue(String name,
String defaultValue)
|
long |
getVersion()
|
int |
hashCode()
|
void |
put(Property value)
Adds the given property to this Configuration object. |
void |
readExternal(ObjectInput in)
|
Property |
remove(String name)
Removes the given property from this Configuration object. |
void |
setId(int id)
|
void |
setNotes(String notes)
|
void |
setProperties(Collection<Property> properties)
|
void |
setVersion(long version)
|
String |
toString()
|
void |
writeExternal(ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String QUERY_GET_PLUGIN_CONFIG_UNIQUE_COUNT_BY_GROUP_AND_PROP_NAME
Constructor Detail |
---|
public Configuration()
Method Detail |
---|
public int getId()
public void setId(int id)
public long getCreatedTime()
public long getModifiedTime()
public void put(Property value)
simple property
, a list of properties
or a
map of properties
.
put
in interface AbstractPropertyMap
value
- the new propertypublic Property get(String name)
simple property
, a list of properties
or a
map of properties
.
Note that this only gets direct children of this Configuration. You cannot get a property from within a child list or map via this method.
get
in interface AbstractPropertyMap
name
- the name of the property to be retrieved from this configuration
null
if there was no direct child with the given namepublic Property remove(String name)
simple property
, a list of properties
or a
map of properties
.
Note that this only removes direct children of this Configuration. You cannot remove a property from within a child list or map via this method.
name
- the name of the property to be removed from this configuration
null
if there was no direct child with the given namepublic PropertySimple getSimple(String name)
get(String)
except that it returns the object as a PropertySimple
.
getSimple
in interface AbstractPropertyMap
name
- the name of the simple property to be retrieved
null
if there was no simple property with the
given name
ClassCastException
- if there was a property in this Configuration with the given name, but it was not of
type PropertySimple
public String getSimpleValue(String name, String defaultValue)
public PropertyList getList(String name)
get(String)
except that it returns the object as a PropertyList
.
getList
in interface AbstractPropertyMap
name
- the name of the list property to be retrieved
null
if there was no list property with the given
name
ClassCastException
- if there was a property in this Configuration with the given name, but it was not of
type PropertyList
public PropertyMap getMap(String name)
get(String)
except that it returns the object as a PropertyMap
.
getMap
in interface AbstractPropertyMap
name
- the name of the map property to be retrieved
null
if there was no map property with the given
name
ClassCastException
- if there was a property in this Configuration with the given name, but it was not of
type PropertyMap
@NotNull public Map<String,Property> getMap()
Warning: Caution should be used when accessing the returned map. Please see
the javadoc for this class
for more information.
getMap
in interface AbstractPropertyMap
@NotNull public Collection<String> getNames()
@NotNull public Collection<Property> getProperties()
public void setProperties(Collection<Property> properties)
@NotNull public Map<String,PropertyMap> getMapProperties()
PropertyMap
. The
returned map is keyed on the PropertyMap
's names.
PropertyMap
children@NotNull public Map<String,PropertyList> getListProperties()
PropertyList
. The
returned map is keyed on the PropertyList
's names.
PropertyList
children@NotNull public Map<String,PropertySimple> getSimpleProperties()
PropertySimple
. The
returned map is keyed on the PropertySimple
's names.
PropertySimple
childrenpublic String getNotes()
public void setNotes(String notes)
public long getVersion()
public void setVersion(long version)
public Configuration deepCopy()
This is the same behavior as that of this object's clone()
method.
public Configuration deepCopy(boolean keepIds)
If keepIds
is false
, then all IDs of all properties and the config object itself are
set to 0. Otherwise, they are kept the same and this method behaves the same as clone()
.
keepIds
- if false
, zero out all IDs
public Configuration clone() throws CloneNotSupportedException
deepCopy()
.
clone
in class Object
CloneNotSupportedException
deepCopy()
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
Externalizable.writeExternal(java.io.ObjectOutput)
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
Externalizable.readExternal(java.io.ObjectInput)
public void afterUnmarshal(javax.xml.bind.Unmarshaller u, Object parent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |