}
if (response.index < cachedStateList.index) {
response.index = cachedStateList.index;
}
} else if (cacheMessage instanceof Item) {
Item item = (Item) cacheMessage;
boolean exists = false;
for (JAXBElement responseElem : response.stateList.entries) {
if (responseElem.getName().getLocalPart().equals(item.getName())) {
// Element already exists in the response -> just update the state
responseElem.setValue(item.getState().toString());
exists=true;
break;
}
}
if (!exists) {
response.stateList.entries.add(new JAXBElement(new QName(item
.getName()), String.class, item.getState().toString()));
}
}
}
if (response.stateList.entries.size() > 0) {
if (response.index == 0) {