use of org.vertexium.mutation.AlterPropertyVisibility in project vertexium by visallo.
the class InMemoryGraph method alterElementPropertyVisibilities.
protected void alterElementPropertyVisibilities(InMemoryTableElement inMemoryTableElement, List<AlterPropertyVisibility> alterPropertyVisibilities, Authorizations authorizations) {
for (AlterPropertyVisibility apv : alterPropertyVisibilities) {
Property property = inMemoryTableElement.getProperty(apv.getKey(), apv.getName(), apv.getExistingVisibility(), FetchHints.ALL_INCLUDING_HIDDEN, authorizations);
if (property == null) {
throw new VertexiumException("Could not find property " + apv.getKey() + ":" + apv.getName());
}
if (apv.getExistingVisibility() == null) {
apv.setExistingVisibility(property.getVisibility());
}
Object value = property.getValue();
Metadata metadata = property.getMetadata();
inMemoryTableElement.appendSoftDeletePropertyMutation(apv.getKey(), apv.getName(), apv.getExistingVisibility(), apv.getTimestamp());
long newTimestamp = apv.getTimestamp() + 1;
if (value instanceof StreamingPropertyValue) {
value = saveStreamingPropertyValue(inMemoryTableElement.getId(), apv.getKey(), apv.getName(), apv.getVisibility(), newTimestamp, (StreamingPropertyValue) value);
}
inMemoryTableElement.appendAddPropertyValueMutation(apv.getKey(), apv.getName(), value, metadata, apv.getVisibility(), newTimestamp);
}
}
Aggregations