{
PatchApplier.applyPatch(membership, patch);
}
catch (DataProcessingException e)
{
return new UpdateResponse(S_400_BAD_REQUEST);
}
validate(membership);
// we set groupID, memberID based on the URI
membership.setId(URIParamUtils.encodeKeyForBody(id, true, AllProtocolVersions.BASELINE_PROTOCOL_VERSION));
membership.setGroupID(getContext().getPathKeys().getAsInt(GROUP_ID));
membership.setMemberID(getContext().getPathKeys().getAsInt(MEMBER_ID));
_app.getMembershipMgr().save(membership);
return new UpdateResponse(S_204_NO_CONTENT);
}