* @throws Exception on error
*/
public static MetricAttributes getMetricAttributes( SOAPElement soapElem )
throws Exception
{
MetricAttributes metricAttribs = new MetricAttributesImpl( );
Iterator attribIter = soapElem.getAllAttributes( );
while ( attribIter.hasNext( ) )
{
Name name = (Name) attribIter.next( );
String value = soapElem.getAttributeValue( name );
LOG.debug( "Found MuWS metric attribute " + name.getQualifiedName( ) + "=" + value + " in element "
+ soapElem.getElementName( ).getQualifiedName( ) );
if ( NameUtils.toQName( name ).equals( Muws05Constants.METRIC_ATTRIBUTE_CHANGE_TYPE ) )
{
metricAttribs.setChangeType( ChangeType.forString( value ) );
}
else if ( NameUtils.toQName( name ).equals( Muws05Constants.METRIC_ATTRIBUTE_LAST_UPDATED ) )
{
metricAttribs.setLastUpdated( new XmlSchemaDateFormat( ).parse( value ) );
}
else if ( NameUtils.toQName( name ).equals( Muws05Constants.METRIC_ATTRIBUTE_RESET_AT ) )
{
metricAttribs.setResetAt( new XmlSchemaDateFormat( ).parse( value ) );
}
else if ( NameUtils.toQName( name ).equals( Muws05Constants.METRIC_ATTRIBUTE_TIME_SCOPE ) )
{
metricAttribs.setTimeScope( TimeScope.forString( value ) );
}
}
return metricAttribs;
}