private static void putInstanceData(ViewInstanceEntity instanceDefinition, String user, String name, String value) {
    ViewInstanceDataEntity oldInstanceDataEntity = getInstanceData(instanceDefinition, user, name);
    if (oldInstanceDataEntity != null) {
      instanceDefinition.getData().remove(oldInstanceDataEntity);
    }

    ViewInstanceDataEntity instanceDataEntity = new ViewInstanceDataEntity();
    instanceDataEntity.setViewName(instanceDefinition.getViewName());
    instanceDataEntity.setViewInstanceName(instanceDefinition.getName());
    instanceDataEntity.setName(name);
    instanceDataEntity.setUser(user);
    instanceDataEntity.setValue(value);
    instanceDataEntity.setViewInstanceEntity(instanceDefinition);

    instanceDefinition.getData().add(instanceDataEntity);
  }
Save an instance data value for the given key owned by given user.

@param instanceDefinition  the view instance definition
@param user                the owner of the data value
@param name                the name
@param value               the value
ambari-server/src/main/java/org/apache/ambari/server/view/ViewDataMigrationContextImpl.java