public static <T> T checkNotNull(T value, String name) { checkArgument(value != null, name + " is null"); return value; }
@Override protected String visitNode(Node node, Boolean context) { throw new RakamException("The filter syntax is not supported", BAD_REQUEST); }
public static SuccessMessage map(QueryResult queryResult) { if (queryResult.isFailed()) { throw new RakamException(queryResult.getError().message, INTERNAL_SERVER_ERROR); } else { return SuccessMessage.success(); } }
public static String checkCollection(String collection) { return checkCollection(collection, '"'); }
@Override public ProjectCollection getUserTable(String project, boolean isEventFilterActive) { return new ProjectCollection(project, USER_TABLE); }
public static String encode(Object obj) { return encode(obj, false); }
public static String checkTableColumn(String column) { return checkTableColumn(column, column, '"'); }
public ProjectCollection(String project, String collection) { this.project = checkNotNull(project, "project is null"); this.collection = checkNotNull(collection, "collection is null"); }
@Override public String getResponseBody() { return getResponseBody(StandardCharsets.UTF_8); }
public String decryptAES(String data, String secretKey) { return CryptUtil.decryptAES(data, secretKey); } }
public NashornHttpRequest get(String url) { return request(Methods.GET, url); }
public String sha1(String value) { return CryptUtil.sha1(value); }
public String encryptAES(String data, String secretKey) { return CryptUtil.encryptAES(data, secretKey); }
@Override public int[] storeBatch(List<Event> events) { throw new RakamException(NOT_IMPLEMENTED); }
public static String checkTableColumn(String column, char escape) { return checkTableColumn(column, column, escape); }
public RealtimeTable(String project, String tableName) { this.project = checkNotNull(project, "project is null"); this.tableName = checkNotNull(tableName, "tableName is null"); }
@Override public void store(Event event) { throw new RakamException(NOT_IMPLEMENTED); }
@Override public void createSegment(RequestContext context, String name, String tableName, Expression filterExpression, List<EventFilter> eventFilter, Duration interval) { throw new RakamException("Unsupported", HttpResponseStatus.BAD_REQUEST); }