|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rhq.core.domain.configuration.RawConfiguration
public class RawConfiguration
Resources support structured configuration as well as raw configuration which is represented by this class. A raw configuration is typically in the form of a file on the file system. This could be httpd.conf in the case of apache.
A raw configuration is stored as a CLOB and has a SHA-256 hash with which it can be uniquely identified. A RawConfiguration is always associated with its parentConfiguration
which
can be structured, raw, or both. A Configuration can have multiple RawConfigurations associated with it. Suppose for
apache that each virtual host configuration is stored in a separate file. We might have a single Configuration object
that represents all of the apache configuration, and that object may contain multiple RawConfigurations for each of
the virtual host config files.
Field Summary | |
---|---|
String |
errorMessage
THis value is not persisted to the database, but is set when validation indicates that there is a problem with the file structure. |
Constructor Summary | |
---|---|
RawConfiguration()
|
Method Summary | |
---|---|
RawConfiguration |
deepCopy(boolean keepId)
Creates a deep copy of this object that includes all of the properties except for the parent configuration. |
boolean |
equals(Object obj)
Two RawConfiguration objects are considered equal when the following conditions hold: Both have the same sha256 and path property is null for both or Both have the same sha256, path property is non-null and equal for both Note: This definition of equality holdsonly when comparing RawConfigurations belonging to the same resource. |
Configuration |
getConfiguration()
|
String |
getContents()
|
long |
getCtime()
|
int |
getId()
|
long |
getMtime()
|
String |
getPath()
|
String |
getSha256()
|
int |
hashCode()
|
void |
setConfiguration(Configuration configuration)
|
void |
setContents(String contents,
String sha256)
Replaces the contents of the raw configuration. |
void |
setId(int id)
|
void |
setPath(String path)
|
void |
setSha256(String digestString)
|
String |
toString()
Returns a string representation of this object that is in the following format,
RawConfiguration[id=1, path=/foo/bar/raw.txt, sha256=13xcx9sd82e, configuration= |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public String errorMessage
Constructor Detail |
---|
public RawConfiguration()
Method Detail |
---|
public int getId()
public void setId(int id)
public String getPath()
public void setPath(String path)
path
- The new file system path of the configuration file represented by this objectpublic String getContents()
public void setContents(String contents, String sha256)
getSha256()
will be
updated as well.
contents
- The new contentssha256
- the digest string representing the sha256 hash of the given contentspublic String getSha256()
getContents()
public void setSha256(String digestString)
public long getCtime()
public long getMtime()
public Configuration getConfiguration()
Configuration
objectpublic void setConfiguration(Configuration configuration)
configuration
- The parent configuration objectpublic boolean equals(Object obj)
equals
in class Object
obj
- The object to compare for equality
public int hashCode()
hashCode
in class Object
public String toString()
RawConfiguration[id=1, path=/foo/bar/raw.txt, sha256=13xcx9sd82e, configuration=]
toString
in class Object
public RawConfiguration deepCopy(boolean keepId)
keepId
flag is false
, then the id property is not copied.
deepCopy
in interface DeepCopyable<RawConfiguration>
keepId
- A flag indicating whether or not the id should be copied
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |