Package com.google.apphosting.api.ApiProxy

Examples of com.google.apphosting.api.ApiProxy.ApplicationException


      checkVersion(version, module);
      checkNotDynamicModule(module);
    }
    String hostAndPort = module.getHostAndPort(instance);
    if (hostAndPort == null) {
      throw new ApplicationException(ModulesServiceError.ErrorCode.INVALID_INSTANCES_VALUE,
          "Instance " + instance + " not found");
    }
    return hostAndPort;
  }
View Full Code Here


    checkNotDynamicModule(module);
    try {
      module.startServing();
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, "startServing failed", e);
      throw new ApplicationException(ModulesServiceError.ErrorCode.UNEXPECTED_STATE_VALUE,
          "startServing failed with error " + e.getMessage());
    }
  }
View Full Code Here

        } finally {
          dynamicConfigurationLock.unlock();
        }
      } else {
        LOGGER.log(Level.SEVERE, "stopServing timed out");
        throw new ApplicationException(ModulesServiceError.ErrorCode.UNEXPECTED_STATE_VALUE,
            operation + " timed out");
      }
    } catch (InterruptedException ie) {
      LOGGER.log(Level.SEVERE, "stopServing interrupted", ie);
      throw new ApplicationException(ModulesServiceError.ErrorCode.UNEXPECTED_STATE_VALUE,
          operation + " interrupted " + ie.getMessage());
    }
  }
View Full Code Here

    checkNotDynamicModule(module);
    try {
      module.stopServing();
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, "stopServing failed", e);
      throw new ApplicationException(ModulesServiceError.ErrorCode.UNEXPECTED_STATE_VALUE,
          "stopServing failed with error " + e.getMessage());
    }
  }
View Full Code Here

  }

  private Module getRequiredModule(String moduleName) {
    Module module = moduleNameToModuleMap.get(moduleName);
    if (module == null) {
      throw new ApplicationException(ModulesServiceError.ErrorCode.INVALID_MODULE_VALUE,
          "Module not found");
    }
    return module;
  }
View Full Code Here

  private void checkNotDynamicModule(Module module) {
    if (module.getMainContainer().getAppEngineWebXmlConfig().getManualScaling().isEmpty() &&
        module.getMainContainer().getAppEngineWebXmlConfig().getBasicScaling().isEmpty()) {
      LOGGER.warning("Module " + module.getModuleName() + " cannot be a dynamic module");
      throw new ApplicationException(ModulesServiceError.ErrorCode.INVALID_VERSION_VALUE,
          "This operation is not supported on Dynamic modules.");
    }
  }
View Full Code Here

  private ManualScaling getRequiredManualScaling(Module module) {
    ManualScaling manualScaling =
        module.getMainContainer().getAppEngineWebXmlConfig().getManualScaling();
    if (manualScaling.isEmpty()) {
      LOGGER.warning("Module " + module.getModuleName() + " must be a manual scaling module");
      throw new ApplicationException(ModulesServiceError.ErrorCode.INVALID_VERSION_VALUE,
          "Manual scaling is required.");
    }
    return manualScaling;
  }
View Full Code Here

  private void checkVersion(String version, Module module) {
    String moduleVersion =
        module.getMainContainer().getAppEngineWebXmlConfig().getMajorVersionId();
    if (version == null || !version.equals(moduleVersion)) {
      throw new ApplicationException(ModulesServiceError.ErrorCode.INVALID_VERSION_VALUE,
          "Version not found");
    }
  }
View Full Code Here

      if (versions.containsKey(moduleName)) {
        return versions.get(moduleName);
      } else {
        logger.info("Operation getVersions failed because module=" + moduleName
            + " is not defined.");
        throw new ApplicationException(ModulesServiceError.ErrorCode.INVALID_MODULE_VALUE,
            "The specified module does not exist.");
      }
    }
View Full Code Here

      if (defaultVersions.containsKey(moduleName)) {
        return defaultVersions.get(moduleName);
      } else {
        logger.info("Operation getDefaultVersion failed because module=" + moduleName
            + " is not defined.");
        throw new ApplicationException(ModulesServiceError.ErrorCode.INVALID_MODULE_VALUE,
            "Invalid module name.");
      }
    }
View Full Code Here

TOP

Related Classes of com.google.apphosting.api.ApiProxy.ApplicationException

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.