@Override public String getNextToken(Map<String, Object> object) { return Intrinsic.getId(object); } });
@Override public String getNextToken(Map<String, Object> object) { return Intrinsic.getId(object); } });
@Override public String getNextToken(Map<String, Object> object) { return Intrinsic.getId(object); } });
@Override public String getNextToken(Map<String, Object> object) { return Intrinsic.getId(object); } });
public String getId() { return Intrinsic.getId(getMap()); }
String getTable() { return Intrinsic.getId(getRawJson()); }
public String getId() { return Intrinsic.getId(getMap()); }
String getTable() { return Intrinsic.getId(getRawJson()); }
@Override public Iterable<Map.Entry<String, Set<Permission>>> getAll() { validateTable(); return () -> { Iterator<Map<String, Object>> records = _dataStore.scan(_tableName, null, Long.MAX_VALUE, false, ReadConsistency.STRONG); return StreamSupport.stream(Spliterators.spliteratorUnknownSize(records, 0), false) .map(record -> Maps.immutableEntry(Intrinsic.getId(record), extractPermissionsFromRecord(record))) .iterator(); }; }
@Override public Iterable<Map.Entry<String, Set<Permission>>> getAll() { validateTable(); return () -> { Iterator<Map<String, Object>> records = _dataStore.scan(_tableName, null, Long.MAX_VALUE, false, ReadConsistency.STRONG); return StreamSupport.stream(Spliterators.spliteratorUnknownSize(records, 0), false) .map(record -> Maps.immutableEntry(Intrinsic.getId(record), extractPermissionsFromRecord(record))) .iterator(); }; }
private T convertDataStoreEntryToIdentity(Map<String, Object> map) { if (map == null || Intrinsic.isDeleted(map)) { return null; } // Make a copy of the map to avoid mutating the method parameter as a side-effect Map<String, Object> identityMap = Maps.newHashMap(map); // Historically the ID attribute used to be called "internalId". For backwards compatibility with the legacy // "internalId" attribute name and forwards compatibility with the "id" attribute name accept either one. String legacyInternalId = (String) identityMap.remove(INTERNAL_ID); if (!identityMap.containsKey(ID)) { if (legacyInternalId != null) { identityMap.put(ID, legacyInternalId); } else { // Identities have been in use since before non-authentication IDs were introduced. To grandfather in // those keys we'll use the hash of the identity's authentication ID as the identity's ID. identityMap.put(ID, Intrinsic.getId(map)); } } // Remove all intrinsics identityMap.keySet().removeAll(Intrinsic.DATA_FIELDS); return JsonHelper.convert(identityMap, _authIdentityClass); }
private T convertDataStoreEntryToIdentity(Map<String, Object> map) { if (map == null || Intrinsic.isDeleted(map)) { return null; } // Make a copy of the map to avoid mutating the method parameter as a side-effect Map<String, Object> identityMap = Maps.newHashMap(map); // Historically the ID attribute used to be called "internalId". For backwards compatibility with the legacy // "internalId" attribute name and forwards compatibility with the "id" attribute name accept either one. String legacyInternalId = (String) identityMap.remove(INTERNAL_ID); if (!identityMap.containsKey(ID)) { if (legacyInternalId != null) { identityMap.put(ID, legacyInternalId); } else { // Identities have been in use since before non-authentication IDs were introduced. To grandfather in // those keys we'll use the hash of the identity's authentication ID as the identity's ID. identityMap.put(ID, Intrinsic.getId(map)); } } // Remove all intrinsics identityMap.keySet().removeAll(Intrinsic.DATA_FIELDS); return JsonHelper.convert(identityMap, _authIdentityClass); }
/** * Creates a coordinate from a Json map with with "~table" and "~id". This is the inverse of {@link #asJson()}. */ public static Coordinate fromJson(Map<String, ?> json) { return Coordinate.of(Intrinsic.getTable(json), Intrinsic.getId(json)); }
@Override protected Map<String, Object> computeNext() { if (!_batch.hasNext()) { if (_limit == 0) { // First iteration get the requested number of results _limit = query.getLimit(); } else { // Subsequent requests iterate over all remaining results; dataStore will batch the results _limit = Long.MAX_VALUE; } _batch = _dataStore.scan(reportTable, _from, _limit, false, ReadConsistency.STRONG); if (!_batch.hasNext()) { return endOfData(); } } Map<String, Object> result = _batch.next(); _from = Intrinsic.getId(result); return result; } };
/** * Accepts a row from the table report and returns it converted into a TableReportEntry. If the row is deleted * or if it doesn't match all of the configured filters then null is returned. */ @Nullable private TableReportEntry convertToTableReportEntry(Map<String, Object> map, Predicate<String> placementFilter, Predicate<Boolean> droppedFilter, Predicate<Boolean> facadeFilter) { if (Intrinsic.isDeleted(map)) { return null; } final String tableName = Intrinsic.getId(map); List<TableReportEntryTable> tables = Lists.newArrayListWithExpectedSize(map.size()); for (Map.Entry<String, Object> entry : toMap(map.get("tables")).entrySet()) { TableReportEntryTable entryTable = convertToTableReportEntryTable(entry.getKey(), toMap(entry.getValue()), placementFilter, droppedFilter, facadeFilter); if (entryTable != null) { tables.add(entryTable); } } // If all tables were filtered then return null if (tables.isEmpty()) { return null; } return new TableReportEntry(tableName, tables); }
private Role convertRecordToRole(Map<String, Object> record) { if (Intrinsic.isDeleted(record)) { return null; } RoleIdentifier id = RoleIdentifier.fromString(Intrinsic.getId(record)); return new Role(id.getGroup(), id.getId(), (String) record.get(NAME_ATTR), (String) record.get(DESCRIPTION_ATTR)); }
private Role convertRecordToRole(Map<String, Object> record) { if (Intrinsic.isDeleted(record)) { return null; } RoleIdentifier id = RoleIdentifier.fromString(Intrinsic.getId(record)); return new Role(id.getGroup(), id.getId(), (String) record.get(NAME_ATTR), (String) record.get(DESCRIPTION_ATTR)); }
extrapolateStartTimeFromScanRanges(pendingScanRanges, activeScanRanges, completeScanRanges); return new ScanStatus(Intrinsic.getId(map), options, tableSnapshotCreated, canceled, startTime, pendingScanRanges, activeScanRanges, completeScanRanges, completeTime);
if (potentialIdentity != null && id.equals(potentialIdentity.getId())) { hashedAuthenticationId = Intrinsic.getId(entry); identity = potentialIdentity;
if (potentialIdentity != null && id.equals(potentialIdentity.getId())) { hashedAuthenticationId = Intrinsic.getId(entry); identity = potentialIdentity;