Search in sources :

Example 1 with AlterPropertyVisibility

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);
    }
}
Also used : AlterPropertyVisibility(org.vertexium.mutation.AlterPropertyVisibility) StreamingPropertyValue(org.vertexium.property.StreamingPropertyValue) SetPropertyMetadata(org.vertexium.mutation.SetPropertyMetadata)

Aggregations

AlterPropertyVisibility (org.vertexium.mutation.AlterPropertyVisibility)1 SetPropertyMetadata (org.vertexium.mutation.SetPropertyMetadata)1 StreamingPropertyValue (org.vertexium.property.StreamingPropertyValue)1