//
// get the metadata for the metric
//
ResourcePropertyCollection props = _resource.getPropertyCollection();
MetadataDescriptor metadata = props.getMetadata();
if (!metadata.isReadOnlyExternal(name))
{
Object[] filler = { name };
throw new RuntimeException(_MESSAGES.get("NotReadOnly", filler));
}
String change = metadata.getExtendedMetadata(name, MuwsConstants.CHANGE_TYPE_QNAME);
String gathering = metadata.getExtendedMetadata(name, MuwsConstants.GATHERING_QNAME);
String time = metadata.getExtendedMetadata(name, MuwsConstants.TIME_SCOPE_QNAME);
//
// required values (will throw if values are invalid)
//
_changeType = getChangeType(change);
_gatheringTime = getGatheringTime(gathering);
_timeScope = getTimeScope(time);
//
// optional values
//
_intervalString = metadata.getExtendedMetadata(name, MuwsConstants.CALC_INTERVAL_QNAME);
if (_intervalString != null)
_interval = XsdUtils.getDuration(_intervalString);
_group = metadata.getExtendedMetadata(name, MuwsConstants.METRIC_GROUP_QNAME);
//
// sanity check: if it's an Interval, it needs... an interval!
//
if (isInterval() && getIntervalString() == null)