Package com.betfair.baseline.v1.to

Examples of com.betfair.baseline.v1.to.SimpleResponse


    @Override
    public SimpleResponse testBodyParams(RequestContext ctx, String message, Integer value, ComplexObject complex, SimpleValidValue myEnum,
                                         ComplexObject anotherComplex, TimeConstraints timeConstraints) throws SimpleException {
        ctx.setRequestLogExtension(new BaselineLogExtension(message, value, complex));

        SimpleResponse response = new SimpleResponse();
        response.setMessage("message={" + message + "},value={" + value + "},complex={" + complex + "},myEnum={" + myEnum
                + "},anotherComplex={" + anotherComplex + "}");
        return response;
    }
View Full Code Here


        ctx.setRequestLogExtension(new BaselineLogExtension(seed, "List", async));
        List<SimpleResponse> response = new ArrayList<SimpleResponse>();
        Random rnd = new Random(seed);

        for (int i = 0; i < rnd.nextInt(7) + 3; i++) {
            SimpleResponse sr = new SimpleResponse();
            sr.setMessage(String.valueOf(async));
            response.add(sr);
        }
        if (async == AsyncBehaviour.SYNC) {
            return response;
        } else {
View Full Code Here

        ctx.setRequestLogExtension(new BaselineLogExtension(seed, "Map", async));
        Map<String, SimpleResponse> response = new HashMap<String, SimpleResponse>();
        Random rnd = new Random(seed);

        for (int i = 0; i < rnd.nextInt(7) + 3; i++) {
            SimpleResponse sr = new SimpleResponse();
            sr.setMessage(String.valueOf(async));
            response.put(String.valueOf(i), sr);
        }
        if (async == AsyncBehaviour.SYNC) {
            return response;
        } else {
View Full Code Here

  public SimpleResponse kpiTesting(RequestContext ctx, String message, TimeConstraints timeConstraints)
      throws SimpleException {
    ctx.setRequestLogExtension(new BaselineLogExtension(message, null, null));
    ctx.trace("Starting kpiTesting for %s", message);
   
    SimpleResponse response = new SimpleResponse();
    response.setMessage("This method uses KPI testing. Message received : " + message);
    return response;   
 
View Full Code Here

    } catch (NumberFormatException e) {
      throw new SimpleException(ResponseCode.InternalError,SimpleExceptionErrorCodeEnum.GENERIC, e.getMessage());
    } catch (InterruptedException e) {
      throw new SimpleException(ResponseCode.Timeout,SimpleExceptionErrorCodeEnum.TIMEOUT,e.getMessage());
    }
    SimpleResponse response = new SimpleResponse();
    response.setMessage("Waited for " + seconds + " seconds.");
    return response;   
 
View Full Code Here

    ctx.setRequestLogExtension(new BaselineLogExtension(logString, null, null));
    ctx.trace("Starting logMessage for %s", logString);
   
    LOGGER.log(Level.parse(logLevel), logString);
   
    SimpleResponse response = new SimpleResponse();
    response.setMessage(logString + " logged at " + logLevel);
    return response;   
  }
View Full Code Here

      String level, TimeConstraints timeConstraints) throws SimpleException {
 
    ctx.setRequestLogExtension(new BaselineLogExtension(logName + ": " + level, null, null));
    ctx.trace("Starting changeLogLevel to %s", level);
   
    SimpleResponse response = new SimpleResponse();
    if ((logName==null) || (logName.equalsIgnoreCase("")) || (logName.equalsIgnoreCase("service"))) {
            loggingControl.setLogLevel(LOGGER.getLogName(), level, false);
      response.setMessage("Service logging level set at " + level);
    } else {
            loggingControl.setLogLevel(logName, level, false);
      response.setMessage(logName + " logging level set at " + level);
    }

        LOGGER.log(Level.WARNING, "A warning message");
        LOGGER.log(Level.INFO,  "A warning message");
View Full Code Here

    if (dbConnectionStatusDetail != null) {
      ((BaselineMonitor)monitorRegistry.getMonitor("DB"+instance)).setStatus(toStatus(dbConnectionStatusDetail.toString()));
    }

    SimpleResponse response = new SimpleResponse();
    response.setMessage("Health Status Info set for Baseline app.");
    return response;

  }
View Full Code Here

  @Override
  public SimpleResponse testSimpleGetQA(RequestContext ctx, String message, TimeConstraints timeConstraints) throws SimpleException {
    ctx.setRequestLogExtension(new BaselineLogExtension(message, null, null));
    ctx.trace("Starting simple get for %s", message);
    if (message.equalsIgnoreCase("GET_CHANNEL_INFO")) {
      SimpleResponse response = new SimpleResponse();
      response.setMessage("ChannelId: " + ctx.getIdentity().toString());
      return response;
    }
    else if (message.equalsIgnoreCase("DELEGATE")) {
      SimpleResponseDelegate delegate = new SimpleResponseDelegateImpl();
      return new SimpleResponse(delegate);
    }
    else {
      SimpleResponse response = new SimpleResponse();
      response.setMessage("service2-" + message);
      return response;
    }

  }
View Full Code Here

  @Override
  public SimpleResponse testParameterStylesQA(RequestContext ctx,
      TestParameterStylesQAHeaderParamEnum headerParam, String queryParam, Date dateQueryParam, TimeConstraints timeConstraints) {

    ctx.setRequestLogExtension(new BaselineLogExtension(queryParam, null, null));
    SimpleResponse response = new SimpleResponse();
    response.setMessage("headerParam=" + headerParam
                + ",queryParam=" + queryParam + ",dateQueryParam=" + dateQueryParam);
    return response;
  }
View Full Code Here

TOP

Related Classes of com.betfair.baseline.v1.to.SimpleResponse

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.