ItemData data = getCurrentItem(currentChange, i, FAKE_NODE);
if (data == FAKE_NODE)
{
throw new RepositoryException("Current item cannot be found");
}
throw new JCRInvalidItemStateException("(delete) " + (data.isNode() ? "Node" : "Property")+ " not found "
+ data.getQPath().getAsString() + " " + data.getIdentifier()
+ ". Probably was deleted by another session ", data.getIdentifier(), ItemState.DELETED);
}
}
}
// Update commands
if ((currentChangeStatus & TYPE_UPDATE_REFERENCE) > 0)
{
currentChange = TYPE_UPDATE_REFERENCE;
updateReference.executeBatch();
}
if ((currentChangeStatus & TYPE_UPDATE_VALUE) > 0)
{
currentChange = TYPE_UPDATE_VALUE;
updateValue.executeBatch();
}
if ((currentChangeStatus & TYPE_UPDATE_PROPERTY) > 0)
{
currentChange = TYPE_UPDATE_PROPERTY;
int[] results = updateProperty.executeBatch();
for (int i = 0; i < results.length; i++)
{
if (results[i] == 0)
{
ItemData data = getCurrentItem(currentChange, i, FAKE_PROPERTY);
if (data == FAKE_PROPERTY)
{
throw new RepositoryException("Current item cannot be found");
}
throw new JCRInvalidItemStateException("(update) Property not found " + data.getQPath().getAsString() + " "
+ data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
ItemState.UPDATED);
}
}
}
if ((currentChangeStatus & TYPE_UPDATE_NODE) > 0)
{
currentChange = TYPE_UPDATE_NODE;
int[] results = updateNode.executeBatch();
for (int i = 0; i < results.length; i++)
{
if (results[i] == 0)
{
ItemData data = getCurrentItem(currentChange, i, FAKE_NODE);
if (data == FAKE_NODE)
{
throw new RepositoryException("Current item cannot be found");
}
throw new JCRInvalidItemStateException("(update) Node not found " + data.getQPath().getAsString() + " "
+ data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
ItemState.UPDATED);
}
}
}
// Rename commands
if ((currentChangeStatus & TYPE_RENAME_NODE) > 0)
{
currentChange = TYPE_RENAME_NODE;
int[] results = renameNode.executeBatch();
for (int i = 0; i < results.length; i++)
{
if (results[i] == 0)
{
ItemData data = getCurrentItem(currentChange, i, FAKE_NODE);
if (data == FAKE_NODE)
{
throw new RepositoryException("Current item cannot be found");
}
throw new JCRInvalidItemStateException("(rename) Node not found " + data.getQPath().getAsString() + " "
+ data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
ItemState.RENAMED);
}
}
}