public void validate(ViewEntity viewEntity, Validator.ValidationContext context) throws ValidationException {
    InstanceValidationResultImpl result = getValidationResult(viewEntity, context);
    if (!result.isValid()) {
      throw new ValidationException(result.toJson());
    }
  }
Validate the state of the instance.

@param viewEntity the view entity to which this instance will be bound
@param context the validation context

@throws ValidationException if the instance can not be validated
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewInstanceEntity.java