@Override public void delete(Identifier identifier) throws RESTException { if (identifier.size() < 3) { throw new IllegalArgumentException( "Identifier not precise enough. Needs ID as well. " + identifier.toString()); } super.doDeleteCall(super.createFullURL(identifier)); }
@Override public boolean exists(Identifier identifier) throws RESTException { if (identifier.size() < 3) { throw new IllegalArgumentException( "Identifier not precise enough. Needs ID as well. " + identifier.toString()); } try { super.doGetCall(super.createFullURL(identifier)); return true; } catch (RESTException e) { if (e.getErrorCode() == 404) { return false; } else { throw e; } } }
@Override public void delete(Table table, UUID id) throws RESTException { super.doDeleteCall(super.createFullURL(table) + "/" + id.toString()); }
@Override public void update(Document entity) throws RESTException, ParseException, IOException { JSONParser parser = new JSONParser(); String documentJson = SDKUtils.createJSON(entity.getObject()); super.doPutCall(super.createFullURL(entity), (JSONObject) parser.parse(documentJson)); }