/** {@inheritDoc} */ public Future<Void> deleteMessageCollection(UserId userId, String msgCollId, SecurityToken token) throws ProtocolException { throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "this functionality is not yet available"); }
public Future<Void> modifyMessage(UserId userId, String msgCollId, String messageId, Message message, SecurityToken token) throws ProtocolException { throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented"); } }
/** {@inheritDoc} */ public Future<Void> deleteMessages(UserId userId, String msgCollId, List<String> ids, SecurityToken token) throws ProtocolException { throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "this functionality is not yet available"); }
/** {@inheritDoc} */ public Future<MessageCollection> createMessageCollection(UserId userId, MessageCollection msgCollection, SecurityToken token) throws ProtocolException { throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "this functionality is not yet available"); }
/** {@inheritDoc} */ public Future<Void> modifyMessage(UserId userId, String msgCollId, String messageId, Message message, SecurityToken token) throws ProtocolException { throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "this functionality is not yet available"); }
/** {@inheritDoc} */ public Future<Void> modifyMessageCollection(UserId userId, MessageCollection msgCollection, SecurityToken token) throws ProtocolException { throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "this functionality is not yet available"); }
private void assertNoBody(HttpApiRequest httpRequest, String method) { if (httpRequest.body != null) { throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Request body not supported for " + method); } }
public Future<Void> modifyMessage(UserId userId, String msgCollId, String messageId, Message message, SecurityToken token) throws ProtocolException { throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented"); } }
public static void requireNotEmpty(Collection<?> coll, String message) throws ProtocolException { if (coll.isEmpty()) { throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, message); } }
public static void requireSingular(Collection<?> coll, String message) throws ProtocolException { if (coll.size() != 1) { throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, message); } }
public static void requireNotEmpty(Collection<?> coll, String message) throws ProtocolException { if (coll.isEmpty()) { throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, message); } }
public static void requireEmpty(Collection<?> coll, String message) throws ProtocolException { if (!coll.isEmpty()) { throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, message); } }
public static void requireSingular(Collection<?> coll, String message) throws ProtocolException { if (coll.size() != 1) { throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, message); } }
public <T> T getTypedRequest(Class<T> dataTypeClass) { try { return jsonConverter.convertToObject(new JSONObject(this.parameters).toString(), dataTypeClass); } catch (RuntimeException e) { if (e.getCause() instanceof JSONException) throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, e.getMessage()); throw e; } }
public int getStartIndex() { String startIndex = getParameter(START_INDEX); try { return startIndex == null ? DEFAULT_START_INDEX : Integer.valueOf(startIndex); } catch (NumberFormatException nfe) { throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Parameter " + START_INDEX + " (" + startIndex + ") is not a number."); } }
public FilterOperation getFilterOperation() { String filterOp = getParameter(FILTER_OPERATION); try { return filterOp == null ? FilterOperation.contains : FilterOperation.valueOf(filterOp); } catch (IllegalArgumentException iae) { throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Parameter " + FILTER_OPERATION + " (" + filterOp + ") is not valid."); } }
public SortOrder getSortOrder() { String sortOrder = getParameter(SORT_ORDER); try { return sortOrder == null ? SortOrder.ascending : SortOrder.valueOf(sortOrder); } catch (IllegalArgumentException iae) { throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Parameter " + SORT_ORDER + " (" + sortOrder + ") is not valid."); } }
public FilterOperation getFilterOperation() { String filterOp = getParameter(FILTER_OPERATION); try { return filterOp == null ? FilterOperation.contains : FilterOperation.valueOf(filterOp); } catch (IllegalArgumentException iae) { throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Parameter " + FILTER_OPERATION + " (" + filterOp + ") is not valid."); } }
@Operation(httpMethods = "DELETE") public Future<?> futureException(RequestItem req) { if (mock != null) { return mock.futureException(req); } return Futures.immediateFailedFuture(new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, FAILURE_MESSAGE, new Throwable())); }
@Operation(httpMethods = "DELETE") public Future<?> futureException(RequestItem req) { if (mock != null) { return mock.futureException(req); } return ImmediateFuture.errorInstance(new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, FAILURE_MESSAGE, new Throwable())); }