public abstract class StorableElement extends ElementBase implements Serializable, HasTimestamp
ID_PROPERTY_NAME| Modifier | Constructor and Description |
|---|---|
protected |
StorableElement(StorableGraph graph,
String id,
Visibility visibility,
Iterable<Property> properties,
Iterable<PropertyDeleteMutation> propertyDeleteMutations,
Iterable<PropertySoftDeleteMutation> propertySoftDeleteMutations,
Iterable<Visibility> hiddenVisibilities,
com.google.common.collect.ImmutableSet<String> extendedDataTableNames,
long timestamp,
FetchHints fetchHints,
Authorizations authorizations) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyInternal(Property property) |
void |
deleteProperty(String key,
String name,
Visibility visibility,
Authorizations authorizations)
Permanently deletes a property given it's key and name from the element.
|
boolean |
equals(Object obj) |
Authorizations |
getAuthorizations()
Gets the authorizations used to get this element.
|
QueryableIterable<ExtendedDataRow> |
getExtendedData(String tableName,
FetchHints fetchHints)
Gets all the rows from an extended data table.
|
com.google.common.collect.ImmutableSet<String> |
getExtendedDataTableNames()
Gets the extended data table names.
|
FetchHints |
getFetchHints()
Fetch hints used when fetching this element.
|
StorableGraph |
getGraph()
Gets the graph that this element belongs to.
|
Iterable<Visibility> |
getHiddenVisibilities()
Gets the list of hidden visibilities
|
Iterable<HistoricalPropertyValue> |
getHistoricalPropertyValues(String key,
String name,
Visibility visibility,
Long startTime,
Long endTime,
Authorizations authorizations)
Gets property values from the given range of timestamps in descending timestamp order.
|
String |
getId()
get the id of the element
|
Iterable<Property> |
getProperties()
an Iterable of all the properties on this element that you have access to based on the authorizations
used to retrieve the element.
|
Iterable<Property> |
getProperties(String key,
String name)
an Iterable of all the properties with the given name and key on this element that you have access to based on the authorizations
used to retrieve the element.
|
Property |
getProperty(String key,
String name)
Gets a property by key and name.
|
Iterable<PropertyDeleteMutation> |
getPropertyDeleteMutations() |
Iterable<PropertySoftDeleteMutation> |
getPropertySoftDeleteMutations() |
Value |
getPropertyValue(String name,
int index)
Gets the nth property value of the named property.
|
Value |
getPropertyValue(String key,
String name,
int index)
Gets the nth property value of the named property.
|
long |
getTimestamp()
The timestamp of when this element was updated.
|
Visibility |
getVisibility()
the visibility of the element.
|
int |
hashCode() |
protected Iterable<Property> |
internalGetProperties(String key,
String name) |
void |
markPropertyHidden(Property property,
Long timestamp,
Visibility visibility,
Authorizations authorizations)
Marks a property as hidden for a given visibility.
|
void |
markPropertyVisible(Property property,
Long timestamp,
Visibility visibility,
Authorizations authorizations)
Marks a property as visible for a given visibility, effectively undoing markPropertyHidden.
|
abstract <T extends Element> |
prepareMutation()
Prepares a mutation to allow changing multiple property values at the same time.
|
protected void |
removePropertyInternal(String key,
String name,
Visibility visibility) |
protected <TElement extends Element> |
saveExistingElementMutation(ExistingElementMutation<TElement> mutation,
Authorizations authorizations) |
void |
setVisibility(Visibility visibility) |
void |
softDeleteProperties(Authorizations authorizations) |
void |
softDeleteProperty(String key,
String name,
Visibility visibility,
Authorizations authorizations)
Soft deletes a property given it's key and name from the element for a given visibility.
|
String |
toString() |
protected void |
updatePropertiesInternal(Iterable<Property> properties,
Iterable<PropertyDeleteMutation> propertyDeleteMutations,
Iterable<PropertySoftDeleteMutation> propertySoftDeleteMutations) |
getEdgeLabelProperty, getElementIdProperty, getElementTypeProperty, getIdProperty, getInOrOutVertexIdProperty, getInVertexIdProperty, getOutVertexIdProperty, getProperties, getProperty, getProperty, getReservedProperty, getRowIdProperty, getTableNamePropertyclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddPropertyValue, addPropertyValue, compareTo, deleteProperties, deleteProperty, deleteProperty, getEndTime, getExtendedData, getExtendedData, getExtendedData, getHistoricalPropertyValues, getHistoricalPropertyValues, getHistoricalPropertyValues, isHidden, markPropertyHidden, markPropertyHidden, markPropertyHidden, markPropertyVisible, markPropertyVisible, markPropertyVisible, setProperty, setProperty, softDeleteProperties, softDeletePropertygetProperty, getPropertyValue, getPropertyValue, getPropertyValues, getPropertyValuesedge, vertexcreate, edge, getElementType, vertexpublic static final String CF_PROPERTY
public static final String CF_PROPERTY_METADATA
public static final String CF_PROPERTY_SOFT_DELETE
public static final String CF_EXTENDED_DATA
public static final String CF_PROPERTY_HIDDEN
public static final String CF_PROPERTY_VISIBLE
public static final String CF_HIDDEN
public static final String CF_SOFT_DELETE
public static final String METADATA_COLUMN_FAMILY
public static final String METADATA_COLUMN_QUALIFIER
public static final String DELETE_ROW_COLUMN_FAMILY
public static final String DELETE_ROW_COLUMN_QUALIFIER
public static final String CQ_SOFT_DELETE
public static final String CQ_HIDDEN
public static final byte[] SOFT_DELETE_VALUE
public static final byte[] HIDDEN_VALUE
public static final byte[] HIDDEN_VALUE_DELETED
protected StorableGraph graph
protected String id
protected Visibility visibility
protected long timestamp
protected long softDeleteTimestamp
protected FetchHints fetchHints
protected Set<Visibility> hiddenVisibilities
protected PropertyCollection properties
protected com.google.common.collect.ImmutableSet<String> extendedDataTableNames
protected ConcurrentSkipListSet<PropertyDeleteMutation> propertyDeleteMutations
protected ConcurrentSkipListSet<PropertySoftDeleteMutation> propertySoftDeleteMutations
protected Authorizations authorizations
protected List<SoftDeletedProperty> softDeletedProperties
protected List<HiddenProperty> hiddenPropertyMarkers
protected List<HiddenProperty> visiblePropertyMarkers
protected Set<StorablePropertyEntry> storableProperties
protected Set<StorableMetadataEntry> storablePropertyMetadatas
protected StorableElement(StorableGraph graph, String id, Visibility visibility, Iterable<Property> properties, Iterable<PropertyDeleteMutation> propertyDeleteMutations, Iterable<PropertySoftDeleteMutation> propertySoftDeleteMutations, Iterable<Visibility> hiddenVisibilities, com.google.common.collect.ImmutableSet<String> extendedDataTableNames, long timestamp, FetchHints fetchHints, Authorizations authorizations)
public void deleteProperty(String key, String name, Visibility visibility, Authorizations authorizations)
ElementdeleteProperty in interface Elementkey - The property key.name - The property name.visibility - The property visibility.public void softDeleteProperty(String key, String name, Visibility visibility, Authorizations authorizations)
ElementsoftDeleteProperty in interface Elementkey - The property key.name - The property name.visibility - The visibility string of the property to soft delete.public void softDeleteProperties(Authorizations authorizations)
public void markPropertyHidden(Property property, Long timestamp, Visibility visibility, Authorizations authorizations)
ElementmarkPropertyHidden in interface Elementproperty - The property.timestamp - The timestamp.visibility - The visibility string under which this property is hidden.
This visibility can be a superset of the property visibility to mark
it as hidden for only a subset of authorizations.authorizations - The authorizations used.public void markPropertyVisible(Property property, Long timestamp, Visibility visibility, Authorizations authorizations)
ElementmarkPropertyVisible in interface Elementproperty - The property.timestamp - The timestamp.visibility - The visibility string under which this property is now visible.authorizations - The authorizations used.protected <TElement extends Element> void saveExistingElementMutation(ExistingElementMutation<TElement> mutation, Authorizations authorizations)
public Iterable<HistoricalPropertyValue> getHistoricalPropertyValues(String key, String name, Visibility visibility, Long startTime, Long endTime, Authorizations authorizations)
ElementgetHistoricalPropertyValues in interface Elementkey - the key of the property.name - the name of the property.visibility - The visibility of the property to get.public abstract <T extends Element> ExistingElementMutation<T> prepareMutation()
ElementprepareMutation in interface Elementpublic QueryableIterable<ExtendedDataRow> getExtendedData(String tableName, FetchHints fetchHints)
ElementgetExtendedData in interface ElementtableName - The name of the table to get rows from.public Property getProperty(String key, String name)
GeObjectgetProperty in interface GeObjectkey - the key of the property.name - the name of the property.public Value getPropertyValue(String name, int index)
GeObjectgetPropertyValue in interface GeObjectname - The name of the property to retrieve.index - The zero based index into the values.public Value getPropertyValue(String key, String name, int index)
GeObjectgetPropertyValue in interface GeObjectkey - The property keyname - The name of the property to retrieve.index - The zero based index into the values.public Visibility getVisibility()
ElementgetVisibility in interface ElementgetVisibility in interface ElementLocationpublic long getTimestamp()
ElementgetTimestamp in interface ElementgetTimestamp in interface HasTimestamppublic void setVisibility(Visibility visibility)
public Iterable<Property> getProperties()
GeObjectgetProperties in interface GeObjectpublic Iterable<PropertyDeleteMutation> getPropertyDeleteMutations()
public Iterable<PropertySoftDeleteMutation> getPropertySoftDeleteMutations()
public Iterable<Property> getProperties(String key, String name)
GeObjectgetProperties in interface GeObjectgetProperties in class ElementBasekey - The property keyname - The name of the property to retrievepublic StorableGraph getGraph()
Elementprotected void updatePropertiesInternal(Iterable<Property> properties, Iterable<PropertyDeleteMutation> propertyDeleteMutations, Iterable<PropertySoftDeleteMutation> propertySoftDeleteMutations)
protected void removePropertyInternal(String key, String name, Visibility visibility)
public void addPropertyInternal(Property property)
public int hashCode()
hashCode in class ElementBasepublic String toString()
toString in class ElementBasepublic boolean equals(Object obj)
equals in class ElementBasepublic Authorizations getAuthorizations()
ElementgetAuthorizations in interface Elementpublic Iterable<Visibility> getHiddenVisibilities()
ElementgetHiddenVisibilities in interface Elementpublic com.google.common.collect.ImmutableSet<String> getExtendedDataTableNames()
ElementgetExtendedDataTableNames in interface Elementpublic FetchHints getFetchHints()
ElementgetFetchHints in interface Elementprotected Iterable<Property> internalGetProperties(String key, String name)
internalGetProperties in class ElementBaseCopyright © 2016–2021 MWARE SOLUTIONS. All rights reserved.