@Override public Iterator<Map<String, Object>> multiGet(List<Coordinate> coordinates) { return _delegate.multiGet(coordinates); }
@Override public Iterator<Map<String, Object>> multiGet(List<Coordinate> coordinates) { return _delegate.multiGet(coordinates); }
@Override public Iterator<Map<String, Object>> multiGet(List<Coordinate> coordinates, ReadConsistency consistency) { return _delegate.multiGet(coordinates, consistency); }
@Override public Iterator<Map<String, Object>> multiGet(List<Coordinate> coordinates, ReadConsistency consistency) { return _delegate.multiGet(coordinates, consistency); }
@Override public Iterator<Map<String, Object>> multiGet(List<Coordinate> coordinates) { return _local.get().multiGet(coordinates); }
@Override public Iterator<Map<String, Object>> multiGet(List<Coordinate> coordinates, ReadConsistency consistency) { return _local.get().multiGet(coordinates, consistency); }
@Override public Iterator<Map<String, Object>> multiGet(List<Coordinate> coordinates) { return _local.get().multiGet(coordinates); }
@Override public Iterator<Map<String, Object>> multiGet(List<Coordinate> coordinates, ReadConsistency consistency) { return _local.get().multiGet(coordinates, consistency); }
@Override public List<Role> getRolesByGroup(@Nullable String group) { String groupKey = checkGroup(group); List<Role> roles = null; validateTables(); Map<String, Object> record = _dataStore.get(_groupTableName, groupKey); if (!Intrinsic.isDeleted(record)) { //noinspection unchecked List<String> names = (List<String>) record.get(IDS_ATTR); if (names != null && !names.isEmpty()) { List<Coordinate> coordinates = names.stream() .map(name -> Coordinate.of(_roleTableName, new RoleIdentifier(group, name).toString())) .collect(Collectors.toList()); Iterator<Map<String, Object>> records = _dataStore.multiGet(coordinates, ReadConsistency.STRONG); roles = StreamSupport.stream(Spliterators.spliteratorUnknownSize(records, 0), false) .map(this::convertRecordToRole) .filter(Objects::nonNull) .collect(Collectors.toList()); } } return roles != null ? roles : ImmutableList.of(); }
@Override public List<Role> getRolesByGroup(@Nullable String group) { String groupKey = checkGroup(group); List<Role> roles = null; validateTables(); Map<String, Object> record = _dataStore.get(_groupTableName, groupKey); if (!Intrinsic.isDeleted(record)) { //noinspection unchecked List<String> names = (List<String>) record.get(IDS_ATTR); if (names != null && !names.isEmpty()) { List<Coordinate> coordinates = names.stream() .map(name -> Coordinate.of(_roleTableName, new RoleIdentifier(group, name).toString())) .collect(Collectors.toList()); Iterator<Map<String, Object>> records = _dataStore.multiGet(coordinates, ReadConsistency.STRONG); roles = StreamSupport.stream(Spliterators.spliteratorUnknownSize(records, 0), false) .map(this::convertRecordToRole) .filter(Objects::nonNull) .collect(Collectors.toList()); } } return roles != null ? roles : ImmutableList.of(); }
/** * Retrieves a list of content items for the specified comma-delimited coordinates. */ @GET @Path ("_multiget") @Timed (name = "bv.emodb.sor.DataStoreResource1.multiGet", absolute = true) @ApiOperation (value = "Retrieves a list of content items for the specified comma-delimited coordinates.", notes = "Retrieves a list of content items for the specified comma-delimited coordinates.", response = Iterator.class ) public Iterator<Map<String, Object>> multiGet(@QueryParam ("id") List<String> coordinates, @QueryParam ("consistency") @DefaultValue ("STRONG") ReadConsistencyParam consistency, @QueryParam ("debug") BooleanParam debug, final @Authenticated Subject subject) { List<Coordinate> coordinateList = parseCoordinates(coordinates); for (Coordinate coordinate : coordinateList) { if (!subject.hasPermission(Permissions.readSorTable(new NamedResource(coordinate.getTable())))) { throw new UnauthorizedException("not authorized to read table " + coordinate.getTable()); } } return streamingIterator(_dataStore.multiGet(coordinateList, consistency.get()), debug); }