if (action instanceof AddMixin) {
AddMixin addMixinAction = (AddMixin) action;
node = checkoutNode(node);
node.addMixin(addMixinAction.getNodeType());
} else if (action instanceof AddNode) {
AddNode addNodeAction = (AddNode) action;
JCRNodeWrapper addedNode =
addOrCheckoutNode(node, addNodeAction.getName(), addNodeAction.getNodeType(), null, Collections.<String, String>emptyMap());
setProperties(addedNode, addNodeAction.getProperties());
} else if (action instanceof SetProperties) {
SetProperties setPropertiesAction = (SetProperties) action;
setProperties(node, setPropertiesAction.getProperties());
}
}