public ImmutableSet<String> getTableNames(Authorizations authorizations) { VisibilityEvaluator visibilityEvaluator = new VisibilityEvaluator(new org.vertexium.security.Authorizations(authorizations.getAuthorizations())); return tables.entrySet().stream() .filter(entry -> entry.getValue().canRead(visibilityEvaluator)) .map(Map.Entry::getKey) .collect(StreamUtils.toImmutableSet()); }
private InMemoryExtendedDataRow findOrAddRow(ExtendedDataRowId rowId) { InMemoryExtendedDataRow row = findRow(rowId); if (row != null) { return row; } row = new InMemoryExtendedDataRow(rowId, FetchHints.ALL); rows.add(row); return row; }
public Iterable<ExtendedDataRow> getTable(String tableName, Authorizations authorizations) { VisibilityEvaluator visibilityEvaluator = new VisibilityEvaluator(new org.vertexium.security.Authorizations(authorizations.getAuthorizations())); Table table = tables.get(tableName); if (table == null) { throw new VertexiumException("Invalid table '" + tableName + "'"); } Iterable<ExtendedDataRow> rows = table.getRows(visibilityEvaluator); if (!rows.iterator().hasNext()) { throw new VertexiumException("Invalid table '" + tableName + "'"); } return rows; }
public void removeColumn(ExtendedDataRowId rowId, String columnName, String key, Visibility visibility) { Table table = tables.get(rowId.getTableName()); if (table != null) { table.removeColumn(rowId, columnName, key, visibility); } }
public void removeData(ExtendedDataRowId rowId) { Table table = tables.get(rowId.getTableName()); if (table != null) { table.removeData(rowId); } }
public void addData( ExtendedDataRowId rowId, String column, String key, Object value, long timestamp, Visibility visibility ) { InMemoryExtendedDataRow row = findOrAddRow(rowId); row.addColumn(column, key, value, timestamp, visibility); }
public void removeColumn(ExtendedDataRowId rowId, String columnName, String key, Visibility visibility) { InMemoryExtendedDataRow row = findRow(rowId); if (row == null) { return; } row.removeColumn(columnName, key, visibility); } }