Package com.google.enterprise.connector.instantiator

Examples of com.google.enterprise.connector.instantiator.InstantiatorException


    try {
      propFileName =
          (String) applicationContext.getBean(
              APPLICATION_CONTEXT_PROPERTIES_BEAN_NAME, java.lang.String.class);
    } catch (BeansException e) {
      throw new InstantiatorException("Spring exception while getting "
          + APPLICATION_CONTEXT_PROPERTIES_BEAN_NAME + " bean", e);
    }
    if (Strings.isNullOrEmpty(propFileName)) {
      throw new InstantiatorException("Null or empty file name returned from "
          + "Spring while getting " + APPLICATION_CONTEXT_PROPERTIES_BEAN_NAME
          + " bean");
    }
    return propFileName;
  }
View Full Code Here


    Resource propResource = applicationContext.getResource(propFileName);
    File propFile;
    try {
      propFile = propResource.getFile();
    } catch (IOException e) {
      throw new InstantiatorException(e);
    }
    return propFile;
  }
View Full Code Here

      PropertiesUtils.storeToFile(props, propFile,
          CONNECTOR_MANGER_CONFIG_HEADER);
    } catch (PropertiesException e) {
      LOGGER.log(Level.WARNING, "Unable to save application context properties"
          + " file " + propFileName + ". ", e);
      throw new InstantiatorException(e);
    }

    // This property is not overwritten, but is logged.
    boolean validateCertificate = Boolean.parseBoolean(props.getProperty(
            GSA_FEED_VALIDATE_CERTIFICATE_PROPERTY_KEY,
            GSA_FEED_VALIDATE_CERTIFICATE_DEFAULT));
    LOGGER.info("Updated Connector Manager Config: "
        + GSA_FEED_PROTOCOL_PROPERTY_KEY + "=" + feederGateProtocol + "; "
        + GSA_FEED_HOST_PROPERTY_KEY + "=" + feederGateHost + "; "
        + GSA_FEED_PORT_PROPERTY_KEY + "=" + feederGatePort + "; "
        + GSA_FEED_VALIDATE_CERTIFICATE_PROPERTY_KEY + "="
        + validateCertificate + "; "
        + GSA_FEED_SECURE_PORT_PROPERTY_KEY + "=" + feederGateSecurePort + "; "
        + FEED_CONTENTURL_PREFIX_PROPERTY_KEY + "="
        + props.getProperty(FEED_CONTENTURL_PREFIX_PROPERTY_KEY) + "; "
        + MANAGER_LOCKED_PROPERTY_KEY + "="
        + props.getProperty(MANAGER_LOCKED_PROPERTY_KEY));

    // Update our local cached feed host.
    gsaFeedHost = feederGateHost;
    isGsaFeedHostInitialized = true;

    // TODO: The following should probably be done in ProductionManager.

    // Notify the GsaFeedConnection of new host and port.
    if (feeder != null) {
      try {
        feeder.setFeedHostAndPort(feederGateProtocol, feederGateHost,
            feederGatePort, feederGateSecurePort);

        // Update the validateCertificate flag. We do this here so that
        // the value can be updated without restarting Tomcat.
        feeder.setValidateCertificate(validateCertificate);
      } catch (MalformedURLException e) {
        throw new InstantiatorException("Invalid GSA Feed specification", e);
      }
    }

    // Notify GData aware Connectors.
    if (instantiator != null) {
View Full Code Here

  /** A MockManager that throws exception when getting config form. */
  private class ExceptionThrowingManager extends MockManager {
    @Override
    public ConfigureResponse getConfigForm(String connectorTypeName,
        String language) throws InstantiatorException {
      throw new InstantiatorException("getConfigForm: connectorType = "
                                      + connectorTypeName);
    }
View Full Code Here

  /** A MockManager that throws exception when getting config form. */
  private class ExceptionThrowingManager extends MockManager {
    @Override
    public ConfigureResponse getConfigFormForConnector(String connectorName,
        String language) throws InstantiatorException {
      throw new InstantiatorException("getConfigFormForConnector: "
          + "connectorName = " + connectorName);
    }
View Full Code Here

    public void restartConnectorTraversal(String connectorName)
        throws ConnectorNotFoundException, InstantiatorException {
      if ("UnknownConnector".equals(connectorName)) {
        throw new ConnectorNotFoundException(connectorName);
      } else if ("BrokenConnector".equals(connectorName)) {
        throw new InstantiatorException(connectorName);
      }
      restarts.put(connectorName, Boolean.TRUE);
    }
View Full Code Here

    }
    ConfigureResponse response;
    try {
      response = connectorType.getConfigForm(locale);
    } catch (Exception e) {
      throw new InstantiatorException("Failed to get configuration form.", e);
    }

    // Include the connectorInstance.xml in the response.
    if (response != null) {
      response = new ExtendedConfigureResponse(response,
View Full Code Here

    doTest();
  }

  /** Test setConnectorConfiguration throwing InstantiatorException. */
  public void testInstantiatorException() throws Exception {
    checkExceptionHandling(new InstantiatorException(getName()),
                           ConnectorMessageCode.EXCEPTION_INSTANTIATOR);
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.instantiator.InstantiatorException

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.