|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 FormConstructor Summary | |
---|---|
Configuration()
|
Method Summary | |
---|---|
void |
addRawConfiguration(RawConfiguration rawConfiguration)
|
void |
afterUnmarshal(Object 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. |
Configuration |
deepCopyWithoutProxies()
|
boolean |
equals(Object obj)
NOTE: A 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. |
Map<String,Property> |
getAllProperties()
Getter for the properties reference. |
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. |
Set<RawConfiguration> |
getRawConfigurations()
|
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. |
Property |
remove(String name)
Removes the given property from this Configuration object. |
boolean |
removeRawConfiguration(RawConfiguration rawConfiguration)
|
void |
setId(int id)
|
void |
setNotes(String notes)
|
void |
setProperties(Collection<Property> properties)
|
void |
setVersion(long version)
|
String |
toString()
|
String |
toString(boolean verbose)
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String QUERY_GET_PLUGIN_CONFIG_BY_RESOURCE_ID
public static final String QUERY_GET_RESOURCE_CONFIG_BY_RESOURCE_ID
public static final String QUERY_GET_RESOURCE_CONFIG_MAP_BY_GROUP_ID
public static final String QUERY_GET_PLUGIN_CONFIG_MAP_BY_GROUP_ID
public static final String QUERY_GET_RESOURCE_CONFIG_MAP_BY_GROUP_UPDATE_ID
public static final String QUERY_GET_PLUGIN_CONFIG_MAP_BY_GROUP_UPDATE_ID
public static final String QUERY_BREAK_PROPERTY_RECURSION_BY_CONFIGURATION_IDS
public static final String QUERY_DELETE_RAW_CONFIGURATIONS_CONFIGURATION_IDS
public static final String QUERY_DELETE_CONFIGURATIONS_BY_CONFIGURATION_IDs
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, @Nullable 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()
When adding a property to the collection returned from this method, its
configuration property
is set to this instance.
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 Set<RawConfiguration> getRawConfigurations()
public void addRawConfiguration(RawConfiguration rawConfiguration)
public boolean removeRawConfiguration(RawConfiguration rawConfiguration)
public String getNotes()
public void setNotes(String notes)
public long getVersion()
public void setVersion(long version)
public Configuration clone()
deepCopy()
.
clone
in class Object
CloneNotSupportedException
deepCopy()
public Configuration deepCopy()
This is the underlying implementation for the 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 deepCopyWithoutProxies()
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public String toString(boolean verbose)
public void afterUnmarshal(Object u, Object parent)
public Map<String,Property> getAllProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |