Esempio n. 1
0
 @Override
 public void markPropertyVisible(
     String key,
     String name,
     Visibility propertyVisibility,
     Long timestamp,
     Visibility visibility,
     Authorizations authorizations) {
   Iterable<Property> properties = getProperties(key, name);
   for (Property property : properties) {
     if (property.getVisibility().equals(propertyVisibility)) {
       markPropertyVisible(property, timestamp, visibility, authorizations);
       return;
     }
   }
   throw new IllegalArgumentException(
       "Could not find property " + key + " : " + name + " : " + propertyVisibility);
 }
Esempio n. 2
0
 protected void addPropertyInternal(Property property) {
   if (property.getKey() == null) {
     throw new IllegalArgumentException("key is required for property");
   }
   Object propertyValue = property.getValue();
   if (propertyValue instanceof PropertyValue && !((PropertyValue) propertyValue).isStore()) {
     return;
   }
   Property existingProperty =
       getProperty(property.getKey(), property.getName(), property.getVisibility());
   if (existingProperty == null) {
     this.properties.add(property);
   } else {
     if (existingProperty instanceof MutableProperty) {
       ((MutableProperty) existingProperty).update(property);
     } else {
       throw new VertexiumException(
           "Could not update property of type: " + existingProperty.getClass().getName());
     }
   }
 }
Esempio n. 3
0
 @Override
 public Property getProperty(String key, String name, Visibility visibility) {
   if (ID_PROPERTY_NAME.equals(name)) {
     return getIdProperty();
   } else if (Edge.LABEL_PROPERTY_NAME.equals(name) && this instanceof Edge) {
     return getEdgeLabelProperty();
   }
   for (Property p : getProperties()) {
     if (!p.getKey().equals(key)) {
       continue;
     }
     if (!p.getName().equals(name)) {
       continue;
     }
     if (visibility == null) {
       return p;
     }
     if (!visibility.equals(p.getVisibility())) {
       continue;
     }
     return p;
   }
   return null;
 }