Examples of InvalidRequestParamValueException


Examples of com.linkedin.databus2.core.container.request.InvalidRequestParamValueException

      String strAction = request.getParams().getProperty(DatabusRequest.PATH_PARAM_NAME, "");
      action = Actions.valueOf(strAction.toUpperCase());
    }
    catch(Exception ex)
    {
      throw new InvalidRequestParamValueException(COMMAND_NAME, "request path", request.getParams().getProperty(DatabusRequest.PATH_PARAM_NAME, ""));
    }

    switch(action)
    {
    case STATUS:
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.InvalidRequestParamValueException

      RequestProcessingException
  {
    String category = request.getParams().getProperty(DatabusRequest.PATH_PARAM_NAME);
    if (null == category)
    {
      throw new InvalidRequestParamValueException(_commandName, "category", "null");
    }

    if (! doProcess(category, request))
    {
      throw new InvalidRequestParamValueException(_commandName, "category", category);
    }

    return request;
  }
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.InvalidRequestParamValueException

  {
    Map<RegistrationId, DatabusV3Registration> registrationIdMap =
        _client.getRegistrationIdMap();

    if (null == registrationIdMap)
      throw new InvalidRequestParamValueException(request.getName(),
                                                  REGISTRATIONS_KEY,
                                                  "Present only for Databus V3 clients");

    Map<String, List<String>> ridList = new TreeMap<String, List<String>>();
    for (Map.Entry<RegistrationId, DatabusV3Registration> entry : registrationIdMap.entrySet())
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.InvalidRequestParamValueException

                                                   DatabusRequest request) throws RequestProcessingException
  {
    Map<RegistrationId, DatabusV3Registration> regIdMap = _client.getRegistrationIdMap();
    if (null == regIdMap)
    {
      throw new InvalidRequestParamValueException(request.getName(),
                                                  REGISTRATION_KEY_PREFIX,
                                                  "No registrations available !! ");
    }

    /**
     * Important Note: There is an important implementation difference on which
     * registrations are stored in the global registration data-structure maintained by
     * the client (DatabusHttp[V3]ClientImpls) between V2 and V3.
     *
     * 1. In the case of V2, only top-level registrations are stored in the global
     * data-structure (DatabusHttpClientImpl.regList 2. In the case of V3, all
     * registrations are stored in the global data-structure.
     *
     * In the case of V3, this is needed so that all registrations can act on the relay
     * external view change. This can be refactored in the future by moving the
     * relay-external view change to registration impl ( reduce the complexity in
     * ClientImpl ). The V2 implementation did not have this logic and was following a
     * more intuitive structure of preserving the hierarchy.
     */
    for (DatabusV3Registration r : regIdMap.values())
    {
      if (regId.equals(r.getRegistrationId()))
      {
        return r;
      }
    }
    throw new InvalidRequestParamValueException(request.getName(),
                                                REGISTRATION_KEY_PREFIX,
                                                "Registration with id " + regId
                                                    + " not present !!");
  }
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.InvalidRequestParamValueException

      _pauseConsumer.resume();
      request.getResponseContent().write(ByteBuffer.wrap("{\"pauseConsumer\":\"set-resume\"}".getBytes(Charset.defaultCharset())));
    }
    else
    {
      throw new InvalidRequestParamValueException(COMMAND_NAME, "request path", action);
    }
    return request;
  }
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.InvalidRequestParamValueException

    {
      sourceId = Integer.valueOf(sourceIdStr);
    }
    catch (NumberFormatException nfe)
    {
      throw new InvalidRequestParamValueException(request.getName(), prefix, sourceIdStr);
    }

    DbusEventsTotalStats sourceStats = statsCollector.getSourceStats(sourceId);
    if (null == sourceStats)
    {
      throw new InvalidRequestParamValueException(request.getName(), prefix, sourceIdStr);
    }

    writeJsonObjectToResponse(sourceStats, request);

    if (request.getRequestType() == HttpMethod.PUT || request.getRequestType() == HttpMethod.POST)
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.InvalidRequestParamValueException

    String client = category.substring(prefix.length());

    DbusEventsTotalStats clientStats = statsCollector.getPeerStats(client);
    if (null == clientStats)
    {
      throw new InvalidRequestParamValueException(request.getName(), prefix, client);
    }

    writeJsonObjectToResponse(clientStats, request);

    if (request.getRequestType() == HttpMethod.PUT || request.getRequestType() == HttpMethod.POST)
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.InvalidRequestParamValueException

    {
      sourceId = Integer.valueOf(sourceIdStr);
    }
    catch (NumberFormatException nfe)
    {
      throw new InvalidRequestParamValueException(request.getName(), INBOUND_HTTP_SOURCE_PREFIX, sourceIdStr);
    }

    DbusHttpTotalStats sourceStats = _client.getHttpStatsCollector().getSourceStats(sourceId);
    if (null == sourceStats)
    {
      throw new InvalidRequestParamValueException(request.getName(), INBOUND_HTTP_SOURCE_PREFIX, sourceIdStr);
    }

    writeJsonObjectToResponse(sourceStats, request);

    if (request.getRequestType() == HttpMethod.PUT || request.getRequestType() == HttpMethod.POST)
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.InvalidRequestParamValueException

    String client = category.substring(INBOUND_HTTP_RELAYS_PREFIX.length());

    DbusHttpTotalStats clientStats = _client.getHttpStatsCollector().getPeerStats(client);
    if (null == clientStats)
    {
      throw new InvalidRequestParamValueException(request.getName(), INBOUND_HTTP_RELAYS_PREFIX, client);
    }

    writeJsonObjectToResponse(clientStats, request);

    if (request.getRequestType() == HttpMethod.PUT || request.getRequestType() == HttpMethod.POST)
View Full Code Here

Examples of com.linkedin.databus2.core.container.request.InvalidRequestParamValueException

    String registrationIdStr = category.substring(prefix.length());
    DatabusV3Registration reg = _client.getRegistration(new RegistrationId(registrationIdStr));
    if ( null == reg )
    {
        LOG.warn("Invalid registrationId: " + registrationIdStr );
        throw new InvalidRequestParamValueException(request.getName(), prefix, "No data available for this RegistrationId yet" );
    }
    return reg;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.