Package com.google.enterprise.connector.manager

Examples of com.google.enterprise.connector.manager.ConnectorStatus


   * @param out PrintWriter where the response is written
   */
  public static void handleDoGet(String connectorName, Manager manager,
      PrintWriter out) {
    ConnectorMessageCode status = new ConnectorMessageCode();
    ConnectorStatus connectorStatus;
    try {
      connectorStatus = manager.getConnectorStatus(connectorName);
      if (connectorStatus == null) {
        status = new ConnectorMessageCode(
            ConnectorMessageCode.RESPONSE_NULL_CONNECTOR_STATUS, connectorName);
        LOGGER.warning("Connector manager returns no status for "
                       + connectorName);
      }
    } catch (ConnectorNotFoundException e) {
      connectorStatus = null;
      status = new ConnectorMessageCode(
        ConnectorMessageCode.EXCEPTION_CONNECTOR_NOT_FOUND, connectorName);
      LOGGER.log(Level.WARNING, ServletUtil.LOG_EXCEPTION_CONNECTOR_NOT_FOUND,
                 e);
    }

    ServletUtil.writeRootTag(out, false);
    ServletUtil.writeMessageCode(out, status);
    if (connectorStatus != null) {
      ServletUtil.writeXMLTag(out, 1, ServletUtil.XMLTAG_CONNECTOR_STATUS,
          false);
      ServletUtil.writeXMLElement(out, 2, ServletUtil.XMLTAG_CONNECTOR_NAME,
          connectorStatus.getName());
      ServletUtil.writeXMLElement(out, 2, ServletUtil.XMLTAG_CONNECTOR_TYPE,
          connectorStatus.getType());
      ServletUtil.writeXMLElement(out, 2, ServletUtil.XMLTAG_STATUS,
          Integer.toString(connectorStatus.getStatus()));

      String schedule = connectorStatus.getSchedule();
      if (schedule == null) {
        ServletUtil.writeEmptyXMLElement(out, 2,
            ServletUtil.XMLTAG_CONNECTOR_SCHEDULES);
      } else {
        StringBuilder buffer = new StringBuilder();
View Full Code Here


  /** A Manager that returns null ConnectorStatus. */
  private static class NullScheduleManager extends MockManager {
    @Override
    public ConnectorStatus getConnectorStatus(String connectorName)
        throws ConnectorNotFoundException {
      ConnectorStatus status = super.getConnectorStatus(connectorName);
      return new ConnectorStatus(status.getName(), status.getType(),
                                 status.getStatus(), null, null, null);
    }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.manager.ConnectorStatus

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.