|
Hyperic HQ Plugin API v. 2.5.dev | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.hyperic.util.config.ConfigResponse
Field Summary | |
static byte[] |
EMPTY_CONFIG
Empty, encoded ConfigResponse. |
Constructor Summary | |
ConfigResponse()
Create a ConfigResponse that will not be validated against any schema. |
|
ConfigResponse(ConfigSchema schema)
Create a ConfigResponse that will be validated against the specified schema. |
|
ConfigResponse(java.util.Map attributes)
Create a ConfigResponse that will not be validated against any schema. |
Method Summary | |
static ConfigResponse |
decode(byte[] data)
Decode a ConfigResponse from a byte array with no schema validation. |
static ConfigResponse |
decode(ConfigSchema schema,
byte[] data)
Decode a ConfigResponse from a byte array according to the specified schema. |
byte[] |
encode()
|
java.util.Set |
getKeys()
|
java.lang.String |
getValue(java.lang.String key)
|
java.lang.String |
getValue(java.lang.String key,
java.lang.String defaultValue)
|
void |
merge(ConfigResponse other,
boolean overWrite)
Merge the values from another ConfigResponse into this object. |
static byte[] |
safeEncode(ConfigResponse cr)
|
void |
setValue(java.lang.String key,
java.lang.String value)
Set the value for an option. |
int |
size()
|
java.util.Properties |
toProperties()
Clone the attribute set into a properties |
java.lang.String |
toString()
|
void |
unsetValue(java.lang.String key)
Set the value for an option. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte[] EMPTY_CONFIG
Constructor Detail |
public ConfigResponse(ConfigSchema schema)
schema
- The schema to validate option settings against.
If this is null then no schema validation will be done, this is
equivalent to using the no-argument constructor.public ConfigResponse()
public ConfigResponse(java.util.Map attributes)
attributes
- The config properties normally
populated by setValue().Method Detail |
public void setValue(java.lang.String key, java.lang.String value) throws InvalidOptionException, InvalidOptionValueException
setValue
in interface net.hyperic.util.GenericValueMap
key
- The name of the option to setvalue
- The value to set the option to.
InvalidOptionException
- If this ConfigResponse does
not support the specified option.
InvalidOptionValueException
- If the value supplied
is not a legal/valid value for the option.public void unsetValue(java.lang.String key) throws InvalidOptionException, InvalidOptionValueException
key
- The name of the option to set
InvalidOptionException
- If this ConfigResponse does
not support the specified option.
InvalidOptionValueException
- If the value supplied
is not a legal/valid value for the option.public java.lang.String getValue(java.lang.String key)
getValue
in interface net.hyperic.util.GenericValueMap
public java.lang.String getValue(java.lang.String key, java.lang.String defaultValue)
public java.util.Set getKeys()
getKeys
in interface net.hyperic.util.GenericValueMap
public static ConfigResponse decode(byte[] data) throws net.hyperic.util.config.EncodingException
data
- The response data to decode.
EncodingException
- If the encoding is incorrect.public static ConfigResponse decode(ConfigSchema schema, byte[] data) throws net.hyperic.util.config.EncodingException, InvalidOptionException, InvalidOptionValueException
schema
- The schema to validate against.data
- The response data to decode.
EncodingException
- If the encoding is incorrect.
InvalidOptionException
- If the data specifies as option
that is not valid for the given schema.
InvalidOptionValueException
- If the data specifies
an illegal/invalid value for one of the options it contains.public static byte[] safeEncode(ConfigResponse cr) throws net.hyperic.util.config.EncodingException
net.hyperic.util.config.EncodingException
public byte[] encode() throws net.hyperic.util.config.EncodingException
net.hyperic.util.config.EncodingException
public void merge(ConfigResponse other, boolean overWrite)
other
- Other ConfigResponse to merge data fromoverWrite
- If true, values from the 'other' response will
overwrite values with the same name in the object.public java.util.Properties toProperties()
public java.lang.String toString()
public int size()
|
Hyperic HQ Plugin API v. 2.5.dev | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |