public void save() throws ParseException {
if(!isDirty) return;
ParseCommand command;
if(objectId == null) {
command = new ParsePostCommand(getEndPoint());
}
else {
command = new ParsePutCommand(getEndPoint(), getObjectId());
}
command.setData(getParseData());
ParseResponse response = command.perform();
if(!response.isFailed()) {
JSONObject jsonResponse = response.getJsonObject();
if (jsonResponse == null) {
LOGGER.error("Empty response");
throw response.getException();