public boolean instanceExists(ViewInstanceEntity instanceEntity) {

    ViewEntity viewEntity = getDefinition(instanceEntity.getViewName());

    return viewEntity != null &&
        (getInstanceDefinition(viewEntity.getCommonName(), viewEntity.getVersion(), instanceEntity.getName()) != null);
  }
Determine whether or not the given view instance exists.

@param instanceEntity the view instance entity
@return true if the the given view instance exists; false otherwise
ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java