public void installViewInstance(ViewInstanceEntity instanceEntity)
      throws ValidationException, IllegalArgumentException, SystemException {
    ViewEntity viewEntity = getDefinition(instanceEntity.getViewName());

    if (viewEntity != null) {
      String instanceName = instanceEntity.getName();
      String viewName = viewEntity.getCommonName();
      String version = viewEntity.getVersion();

      if (getInstanceDefinition(viewName, version, instanceName) == null) {
        if (LOG.isDebugEnabled()) {
          LOG.debug("Creating view instance {}/{}/{}", viewName, version, instanceName);
        }

        instanceEntity.validate(viewEntity, Validator.ValidationContext.PRE_CREATE);
        setPersistenceEntities(instanceEntity);

        ViewInstanceEntity persistedInstance = mergeViewInstance(instanceEntity, viewEntity.getResourceType());

        instanceEntity.setViewInstanceId(persistedInstance.getViewInstanceId());
        syncViewInstance(instanceEntity, persistedInstance);

        try {
          // bind the view instance to a view
          bindViewInstance(viewEntity, instanceEntity);
        } catch (Exception e) {
          String message = "Caught exception installing view instance.";
          LOG.error(message, e);
          throw new IllegalStateException(message, e);
        }
        // update the registry
        addInstanceDefinition(viewEntity, instanceEntity);

        // add the web app context
        handlerList.addViewInstance(instanceEntity);
      }

    } else {
      String message = "Attempt to install an instance for an unknown view " +
          instanceEntity.getViewName() + ".";

      LOG.error(message);
      throw new IllegalArgumentException(message);
    }
  }
TODO : This should move to {@link ViewInstanceOperationHandler}
Install the given view instance with its associated view.

@param instanceEntity the view instance entity
@throws ValidationException      if the given instance fails the validation checks
@throws IllegalArgumentException if the view associated with the given instance
                                 does not exist
@throws SystemException          if the instance can not be installed
ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java