use of cern.laser.source.alarmsysteminterface.FaultState in project ACS by ACS-Community.
the class FaultStateHelper method marshal.
/**
* Marshal a FaultState into a generated FaultState for XML transport.
*
* @param state The FaultState instance
* @return The generated FaultState
*/
public static cern.laser.source.alarmsysteminterface.impl.message.FaultState marshal(FaultState state) {
cern.laser.source.alarmsysteminterface.impl.message.FaultState generated = new cern.laser.source.alarmsysteminterface.impl.message.FaultState();
generated.setFamily(state.getFamily());
generated.setMember(state.getMember());
generated.setCode(state.getCode());
generated.setDescriptor(state.getDescriptor());
generated.setUserTimestamp(IsoDateFormat.formatDate(new Date(state.getUserTimestamp().getTime())));
cern.laser.source.alarmsysteminterface.impl.message.Properties properties = new cern.laser.source.alarmsysteminterface.impl.message.Properties();
Enumeration names = state.getUserProperties().propertyNames();
while (names.hasMoreElements()) {
String name = (String) names.nextElement();
Property property = new Property();
property.setName(name);
property.setValue(state.getUserProperties().getProperty(name));
properties.addProperty(property);
}
generated.setUserProperties(properties);
return generated;
}
Aggregations