}
List<Property> currentProperties = getProperties();
List<Property> newProperites = new ArrayList<Property>();
for (int i = 0; i < currentProperties.size(); i++) {
Property prop = currentProperties.get(i);
newProperites.add(new JCRProperty(prop, i, logger));
}
// remove old properties, we will add a bunch of new ones
iterator = node.getNodes("messageProperty");
while (iterator.hasNext()) {
iterator.nextNode().remove();
}
// store new properties
for (int i = 0; i < newProperites.size(); i++) {
JCRProperty prop = (JCRProperty) newProperites.get(i);
Node propNode = node.addNode("messageProperty", "nt:unstructured");
propNode.addMixin(PROPERTY_NODE_TYPE);
prop.merge(propNode);
}
}
this.node = node;
}