Package com.betfair.baseline.v2.to

Examples of com.betfair.baseline.v2.to.BodyParamMapDateTimeKeyObject


    }
    String queryParamEntries = queryParamsBuff.toString();
    queryParamEntries = queryParamEntries.substring(0, queryParamEntries.length() - 1);

    NonMandatoryParamsOperationResponseObject responseObject = new NonMandatoryParamsOperationResponseObject();
    responseObject.setHeaderParameter(headerParamEntries);
    responseObject.setQueryParameter(queryParamEntries);

    return responseObject;
  }
View Full Code Here


      queryParamsBuff.append(entry);
    }
    String queryParamEntries = queryParamsBuff.toString();
    queryParamEntries = queryParamEntries.substring(0, queryParamEntries.length() - 1);

    NonMandatoryParamsOperationResponseObject responseObject = new NonMandatoryParamsOperationResponseObject();
    responseObject.setHeaderParameter(headerParamEntries);
    responseObject.setQueryParameter(queryParamEntries);

    return responseObject;
  }
View Full Code Here

    }
    String queryParamEntries = queryParamsBuff.toString();
    queryParamEntries = queryParamEntries.substring(0, queryParamEntries.length() - 1);

    NonMandatoryParamsOperationResponseObject responseObject = new NonMandatoryParamsOperationResponseObject();
    responseObject.setHeaderParameter(headerParamEntries);
    responseObject.setQueryParameter(queryParamEntries);

    return responseObject;
  }
View Full Code Here

    @KPITimedEvent(value = "Baseline.service.testListRetrieval", catchFailures = true)
    @Override
    public PrimitiveLists testListRetrieval(RequestContext ctx, Integer seed, TimeConstraints timeConstraints) throws SimpleException {
        ctx.setRequestLogExtension(new BaselineLogExtension(seed, null, null));
        PrimitiveLists response = new PrimitiveLists();
        Random rnd = new Random(seed);

        response.setBytes(new byte[rnd.nextInt(7) + 3]);
        for (int i = 0; i < response.getBytes().length; i++) {
            response.getBytes()[i] = (byte)rnd.nextInt();
        }

        response.setI32s(new ArrayList<Integer>());
        for (int i = 0; i < rnd.nextInt(7) + 3; i++) {
            response.getI32s().add(rnd.nextInt());
        }

        response.setI64s(new ArrayList<Long>());
        for (int i = 0; i < rnd.nextInt(7) + 3; i++) {
            response.getI64s().add(rnd.nextLong());
        }

        response.setFloats(new ArrayList<Float>());
        for (int i = 0; i < rnd.nextInt(7) + 3; i++) {
            response.getFloats().add(rnd.nextFloat());
        }

        response.setDoubles(new ArrayList<Double>());
        for (int i = 0; i < rnd.nextInt(7) + 3; i++) {
            response.getDoubles().add(rnd.nextDouble());
        }

        response.setStrings(new ArrayList<String>());
        for (int i = 0; i < rnd.nextInt(7) + 3; i++) {
            response.getStrings().add(String.valueOf((rnd.nextLong())));
        }

        response.setDates(new ArrayList<Date>());
        for (int i = 0; i < rnd.nextInt(7) + 3; i++) {
            response.getDates().add(new Date(rnd.nextLong()));
        }
        return response;
    }
View Full Code Here

        List<ReceivedEvent> ret = new ArrayList<ReceivedEvent>();
        if (event == GetReceivedEventsEventEnum.TimeTick) {
            Iterator<TimeTick> it = timeTicks.iterator();
            while (it.hasNext()) {
                TimeTick next = it.next();
                ReceivedEvent re = new ReceivedEvent();
                re.setEventName(ReceivedEventEventNameEnum.valueOf(event.name()));
                re.setTimeTick(next.getTime());
                ret.add(re);
                it.remove();
            }
            timeTicks.clear();
        }
        else if (event == GetReceivedEventsEventEnum.MatchedBet) {
            Iterator<MatchedBet> it = matchedBets.iterator();
            while (it.hasNext()) {
                MatchedBet next = it.next();
                ReceivedEvent re = new ReceivedEvent();
                re.setEventName(ReceivedEventEventNameEnum.valueOf(event.name()));
                re.setMatchedBet(next.getBody());
                ret.add(re);
                it.remove();
            }
            matchedBets.clear();
        }
        else if (event == GetReceivedEventsEventEnum.LogMessage) {
            Iterator<LogMessage> it = logMessages.iterator();
            while (it.hasNext()) {
                LogMessage next = it.next();
                ReceivedEvent re = new ReceivedEvent();
                re.setEventName(ReceivedEventEventNameEnum.valueOf(event.name()));
                re.setLogMessage(next.getBody());
                ret.add(re);
                it.remove();
            }
            logMessages.clear();
        }
        else if (event == GetReceivedEventsEventEnum.ListEvent) {
            Iterator<ListEvent> it = listEvents.iterator();
            while (it.hasNext()) {
                ListEvent next = it.next();
                ReceivedEvent re = new ReceivedEvent();
                re.setEventName(ReceivedEventEventNameEnum.valueOf(event.name()));
                re.setListEvent(next.getMessageList());
                ret.add(re);
                it.remove();
            }
            listEvents.clear();
        }
        else if (event == GetReceivedEventsEventEnum.SetEvent) {
            Iterator<SetEvent> it = setEvents.iterator();
            while (it.hasNext()) {
                SetEvent next = it.next();
                ReceivedEvent re = new ReceivedEvent();
                re.setEventName(ReceivedEventEventNameEnum.valueOf(event.name()));
                re.setSetEvent(next.getMessageSet());
                ret.add(re);
                it.remove();
            }
            setEvents.clear();
        }
        else if (event == GetReceivedEventsEventEnum.MapEvent) {
            Iterator<MapEvent> it = mapEvents.iterator();
            while (it.hasNext()) {
                MapEvent next = it.next();
                ReceivedEvent re = new ReceivedEvent();
                re.setEventName(ReceivedEventEventNameEnum.valueOf(event.name()));
                re.setMapEvent(next.getMessageMap());
                ret.add(re);
                it.remove();
            }
            mapEvents.clear();
        }
View Full Code Here

    @KPITimedEvent(value = "Baseline.service.testSimpleTypeReplacement", catchFailures = true)
    @Override
    public SimpleContainer testSimpleTypeReplacement(RequestContext ctx, Integer simpleInt, Double simpleDouble, String simpleString,
                                                     SimpleValidValue simpleEnum, TimeConstraints timeConstraints) throws SimpleException {
        ctx.setRequestLogExtension(new BaselineLogExtension(simpleInt, simpleDouble, simpleEnum));
        SimpleContainer cont = new SimpleContainer();
        cont.setSimpleInt(simpleInt);
        cont.setSimpleDouble(simpleDouble);
        cont.setSimpleString(simpleString);
        cont.setSimpleEnum(simpleEnum);
        return cont;
    }
View Full Code Here

    @Override
    public SimpleListContainer testStringableLists(RequestContext ctx, Set<Integer> intList, List<String> stringList,
                                                   List<SimpleValidValue> enumList, TimeConstraints timeConstraints) throws SimpleException {

        ctx.setRequestLogExtension(new BaselineLogExtension(intList.size(), stringList.size(), enumList.size()));
        SimpleListContainer cont = new SimpleListContainer();
        cont.setInts(new ArrayList<Integer>(intList));
        cont.setStrings(stringList);
        cont.setEnums(new HashSet<SimpleValidValue>(enumList));
        return cont;
    }
View Full Code Here

  @Override
  public SimpleMapOperationResponseObject simpleMapOperation(RequestContext ctx, BodyParamSimpleMapObject message, TimeConstraints timeConstraints) throws SimpleException {

    ctx.setRequestLogExtension(new BaselineLogExtension(message, null, null));

    SimpleMapOperationResponseObject response = new SimpleMapOperationResponseObject();
    Map<String,String> requestMap = message.getSimpleMap();

    Map<String,String> responseMap = new LinkedHashMap<String,String>();

    Object[] requestMapKeys = requestMap.keySet().toArray();
    Arrays.sort(requestMapKeys);

    for (Object key : requestMapKeys) {
      String value = requestMap.get(key.toString());
      responseMap.put(key.toString(), value);
    }

    response.setResponseMap(responseMap);

    return response;

  }
View Full Code Here

    e.execute(ec, testComplexMutatorKey, new Object[] {o,o}, new ExecutionObserver() {

      @Override
      public void onResult(ExecutionResult executionResult) {
        if (!executionResult.isFault()) {
          SimpleResponse response = (SimpleResponse) executionResult.getResult();
          System.out.println("result = 3".equals(response.getMessage()) ? "PASS" : "FAIL");
        }
        else {
          System.out.println("FAIL");
        }
        cl.countDown();
View Full Code Here

    e.execute(ec, testComplexMutatorKey, new Object[] {o,o}, new ExecutionObserver() {

      @Override
      public void onResult(ExecutionResult executionResult) {
        if (!executionResult.isFault()) {
          SimpleResponse response = (SimpleResponse) executionResult.getResult();
          System.out.println("result = 3".equals(response.getMessage()) ? "PASS" : "FAIL");
        }
        else {
          System.out.println("FAIL");
        }
        cl.countDown();
View Full Code Here

TOP

Related Classes of com.betfair.baseline.v2.to.BodyParamMapDateTimeKeyObject

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.