* @param item
* @return
*/
public PriamInstance transform(Item item)
{
PriamInstance ins = new PriamInstance();
Iterator<Attribute> attrs = item.getAttributes().iterator();
while (attrs.hasNext())
{
Attribute att = attrs.next();
if (att.getName().equals(Attributes.INSTANCE_ID))
ins.setInstanceId(att.getValue());
else if (att.getName().equals(Attributes.TOKEN))
ins.setToken(att.getValue());
else if (att.getName().equals(Attributes.APP_ID))
ins.setApp(att.getValue());
else if (att.getName().equals(Attributes.ID))
ins.setId(Integer.parseInt(att.getValue()));
else if (att.getName().equals(Attributes.AVAILABILITY_ZONE))
ins.setRac(att.getValue());
else if (att.getName().equals(Attributes.ELASTIC_IP))
ins.setHostIP(att.getValue());
else if (att.getName().equals(Attributes.HOSTNAME))
ins.setHost(att.getValue());
else if (att.getName().equals(Attributes.LOCATION))
ins.setDC(att.getValue());
else if (att.getName().equals(Attributes.UPDATE_TS))
ins.setUpdatetime(Long.parseLong(att.getValue()));
}
return ins;
}