Package com.betfair.baseline.v2.events

Examples of com.betfair.baseline.v2.events.BaselineJMSServiceBindingDescriptor


            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


    @Override
    public void emitLogMessage(RequestContext ctx, String logString, String logLevel, Long timeStamp, TimeConstraints timeConstraints) throws SimpleException {
        // Set the request log extension using the operation params
      ctx.setRequestLogExtension(new BaselineLogExtension(logString, null, null));
      // Construct an instance of the event to be emitted
      LogMessage lm = new LogMessage();
        LogMessageContainer body = new LogMessageContainer();
        lm.setBody(body);
        // Add the neccessary parameters
      body.setLogString(logString);
      body.setLogLevel(logLevel);
      body.setTimeStamp(timeStamp);
      try {
View Full Code Here

            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

        ctx.setRequestLogExtension(new BaselineLogExtension(eventNamespace, longArg, null));
        ctx.getLocation().getRemoteAddr();
        ctx.getLocation().getResolvedAddresses();
        if (longEventNamespacedExecutionObserver.containsKey(eventNamespace)) {
            ExecutionObserver observer = longEventNamespacedExecutionObserver.get(eventNamespace);
            LongEvent longEvent = new LongEvent();
            longEvent.setLongArg(longArg);
            observer.onResult(new ExecutionResult(longEvent));
        } else {
            throw new SimpleException(ResponseCode.BadRequest,  SimpleExceptionErrorCodeEnum.GENERIC,
                    "Unknown event namespace: "+ eventNamespace);
        }
View Full Code Here

        String message = builder.toString();

        ctx.trace("Emitting message map [ " + message +" ]");
        ctx.setRequestLogExtension(new BaselineLogExtension(message, null, null));

        MapEvent mEvent = new MapEvent();
        mEvent.setMessageMap(messageMap);

        try {
            mapMessageObserver.onResult(new ExecutionResult(mEvent));
        } catch (Throwable ex) {
          LOGGER.log(Level.SEVERE, "An exception occurred emitting the message map event:", ex);
View Full Code Here

            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

                switch (result.getResultType()) {
                    case Subscription:
                        matchedBetSubscription = result.getSubscription();
                        break;
                    case Success:
                        MatchedBet bet = (MatchedBet)result.getResult();
                        System.out.println("received bet object: " + bet.toString());
                        break;
                    case Fault:
                        System.out.println(result.getFault());
                        break;
                }
View Full Code Here

    public void emitMatchedBet(RequestContext ctx, MatchedBetStruct bet, MarketStruct market, TimeConstraints timeConstraints) throws SimpleException {
        ctx.trace("Starting simple get for matched bet between accounts [ " + bet.getAccount1() + ", " + bet.getAccount2() + "]");

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

        MatchedBet matchedBet = new MatchedBet();
        MatchedBetContainer body = new MatchedBetContainer();
        matchedBet.setBody(body);
        body.setMatchedBet(bet);
        body.setMarket(market);

        try {
            matchedBetObserver.onResult(new ExecutionResult(matchedBet));
View Full Code Here

            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

        String message = builder.toString();

        ctx.trace("Emitting message set [ " + message +" ]");
        ctx.setRequestLogExtension(new BaselineLogExtension(message, null, null));

        SetEvent sEvent = new SetEvent();
        sEvent.setMessageSet(messageSet);

        try {
            setMessageObserver.onResult(new ExecutionResult(sEvent));
        } catch (Throwable ex) {
          LOGGER.log(Level.SEVERE, "An exception occurred emitting the message set event:", ex);
View Full Code Here

TOP

Related Classes of com.betfair.baseline.v2.events.BaselineJMSServiceBindingDescriptor

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.