Search in sources :

Example 1 with SetPropertyMetadata

use of org.vertexium.mutation.SetPropertyMetadata in project vertexium by visallo.

the class InMemoryGraph method alterElementPropertyMetadata.

protected void alterElementPropertyMetadata(InMemoryTableElement inMemoryTableElement, List<SetPropertyMetadata> setPropertyMetadatas, Authorizations authorizations) {
    for (SetPropertyMetadata spm : setPropertyMetadatas) {
        Property property = inMemoryTableElement.getProperty(spm.getPropertyKey(), spm.getPropertyName(), spm.getPropertyVisibility(), FetchHints.ALL_INCLUDING_HIDDEN, authorizations);
        if (property == null) {
            throw new VertexiumException("Could not find property " + spm.getPropertyKey() + ":" + spm.getPropertyName());
        }
        Metadata metadata = new Metadata(property.getMetadata());
        metadata.add(spm.getMetadataName(), spm.getNewValue(), spm.getMetadataVisibility());
        long newTimestamp = IncreasingTime.currentTimeMillis();
        inMemoryTableElement.appendAddPropertyMetadataMutation(property.getKey(), property.getName(), metadata, property.getVisibility(), newTimestamp);
    }
}
Also used : SetPropertyMetadata(org.vertexium.mutation.SetPropertyMetadata) SetPropertyMetadata(org.vertexium.mutation.SetPropertyMetadata)

Aggregations

SetPropertyMetadata (org.vertexium.mutation.SetPropertyMetadata)1