Package org.apache.ambari.server

Examples of org.apache.ambari.server.StackAccessException


    }
    StackId stackId = new StackId(request.getStackVersion());
    StackInfo stackInfo = ambariMetaInfo.getStackInfo(stackId.getStackName(),
        stackId.getStackVersion());
    if (stackInfo == null) {
      throw new StackAccessException("stackName=" + stackId.getStackName() + ", stackVersion=" + stackId.getStackVersion());
    }

    // FIXME add support for desired configs at cluster level

    boolean foundInvalidHosts = false;
View Full Code Here


                                    String componentName) throws AmbariException {

    List<ComponentInfo> componentsByService = getComponentsByService(stackName, version, serviceName);

    if (componentsByService.size() == 0)
      throw new StackAccessException("stackName=" + stackName
          + ", stackVersion=" + version
          + ", stackVersion=" + serviceName
          + ", componentName=" + componentName);

    ComponentInfo componentResult = null;

    for (ComponentInfo component : componentsByService) {
      if (component.getName().equals(componentName))
        componentResult = component;
    }

    if (componentResult == null)
      throw new StackAccessException("stackName=" + stackName
          + ", stackVersion=" + version
          + ", stackVersion=" + serviceName
          + ", componentName=" + componentName);

    return componentResult;
View Full Code Here

                                      String version, String osType, String repoId) throws AmbariException {

    List<RepositoryInfo> repositories = getRepositories(stackName, version, osType);

    if (repositories.size() == 0)
      throw new StackAccessException("stackName=" + stackName
          + ", stackVersion=" + version
          + ", osType=" + osType
          + ", repoId=" + repoId);

    RepositoryInfo repoResult = null;
    for (RepositoryInfo repository : repositories) {
      if (repository.getRepoId().equals(repoId))
        repoResult = repository;
    }
    if (repoResult == null)
      throw new StackAccessException("stackName=" + stackName
          + ", stackName= " + version
          + ", osType=" + osType
          + ", repoId= " + repoId);
    return repoResult;
  }
View Full Code Here

  public ServiceInfo getService(String stackName, String version, String serviceName) throws AmbariException {

    Map<String, ServiceInfo> services = getServices(stackName, version);

    if (services.size() == 0)
      throw new StackAccessException("stackName=" + stackName + ", stackVersion=" + version + ", serviceName=" + serviceName);

    ServiceInfo serviceInfo = services.get(serviceName);

    if (serviceInfo == null)
      throw new StackAccessException("stackName=" + stackName + ", stackVersion=" + version + ", serviceName=" + serviceName);

    return serviceInfo;

  }
View Full Code Here

  public Stack getStack(String stackName) throws AmbariException {

    Set<Stack> supportedStackNames = getStackNames();

    if (supportedStackNames.size() == 0)
      throw new StackAccessException("stackName=" + stackName);

    Stack stackResult = null;

    for (Stack stack : supportedStackNames) {
      if (stack.getStackName().equals(stackName))
        stackResult = stack;
    }

    if (stackResult == null)
      throw new StackAccessException("stackName=" + stackName);

    return stackResult;
  }
View Full Code Here

        break;
      }
    }

    if (stackInfoResult == null)
      throw new StackAccessException("stackName=" + stackName
          + ", stackVersion=" + version);

    return stackInfoResult;
  }
View Full Code Here

  public PropertyInfo getProperty(String stackName, String version, String serviceName, String propertyName)
      throws AmbariException {
    Set<PropertyInfo> properties = getProperties(stackName, version, serviceName);

    if (properties.size() == 0)
      throw new StackAccessException("stackName=" + stackName
          + ", stackVersion=" + version
          + ", serviceName=" + serviceName
          + ", propertyName=" + propertyName);

    PropertyInfo propertyResult = null;

    for (PropertyInfo property : properties) {
      if (property.getName().equals(propertyName))
        propertyResult = property;
    }

    if (propertyResult == null)
      throw new StackAccessException("stackName=" + stackName
          + ", stackVersion=" + version
          + ", serviceName=" + serviceName
          + ", propertyName=" + propertyName);

    return propertyResult;
View Full Code Here

      throws AmbariException {

    Set<OperatingSystemInfo> operatingSystems = getOperatingSystems(stackName, version);

    if (operatingSystems.size() == 0)
      throw new StackAccessException("stackName=" + stackName
          + ", stackVersion=" + version
          + ", osType=" + osType);

    OperatingSystemInfo resultOperatingSystem = null;

    for (OperatingSystemInfo operatingSystem : operatingSystems) {
      if (operatingSystem.getOsType().equals(osType))
        resultOperatingSystem = operatingSystem;
    }

    if (resultOperatingSystem == null)
      throw new StackAccessException("stackName=" + stackName
          + ", stackVersion=" + version
          + ", osType=" + osType);

    return resultOperatingSystem;
  }
View Full Code Here

    // validate existing
    RepositoryInfo ri = getRepository(stackName, stackVersion, osType, repoId);

    if (!stackRoot.exists())
      throw new StackAccessException("Stack root does not exist.");

    ri.setBaseUrl(newBaseUrl);

    if (null != metainfoDAO) {
      String metaKey = generateRepoMetaKey(stackName, stackVersion, osType,
View Full Code Here

    }
    StackId stackId = new StackId(request.getStackVersion());
    StackInfo stackInfo = ambariMetaInfo.getStackInfo(stackId.getStackName(),
        stackId.getStackVersion());
    if (stackInfo == null) {
      throw new StackAccessException("stackName=" + stackId.getStackName() + ", stackVersion=" + stackId.getStackVersion());
    }

    // FIXME add support for desired configs at cluster level

    boolean foundInvalidHosts = false;
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.StackAccessException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.