Package com.betfair.cougar.core.api.ev

Examples of com.betfair.cougar.core.api.ev.ConnectedResponse


        client.closeAllSubscriptions(ctx, complexObjectUri);

        //first pre timestamp
        Date pre = Calendar.getInstance().getTime();

        ConnectedResponse simpleConnectedObjectResponse = client.simpleConnectedObject(ctx);
        Heap simpleConnectedObjectHeap = protocol == TestConnectedObjectsProtocolEnum.IN_PROCESS ? new ImmutableHeap(simpleConnectedObjectResponse.getHeap().getUri(),simpleConnectedObjectResponse.getHeap(),true) : simpleConnectedObjectResponse.getHeap();
        Subscription simpleConnectedObjectSub = simpleConnectedObjectResponse.getSubscription();

        String subId1 = getSubscriptionId(simpleConnectedObjectSub, socketProtocol);

        //try subscription log check
        {
            //Test Data
            int stepCount = 0;
            TestResult tr = new TestResult();
            tr.setDescription("Testing a new subscription for a simple connected object is logged (redundant if protocol=IN_PROCESS)");

            assertEquals(tr, stepCount++, true, isLogged(file, subId1, simpleObjectUri, startReason, pre, socketProtocol), "Subscription not logged for " + simpleObjectUri);
            results.add(tr);
        }

        ConnectedResponse simpleConnectedListResponse = client.simpleConnectedList(ctx);
        Heap simpleConnectedListHeap = protocol == TestConnectedObjectsProtocolEnum.IN_PROCESS ? new ImmutableHeap(simpleConnectedListResponse.getHeap().getUri(),simpleConnectedListResponse.getHeap(),true) : simpleConnectedListResponse.getHeap();
        Subscription simpleConnectedListSub = simpleConnectedListResponse.getSubscription();

        String subId2 = getSubscriptionId(simpleConnectedListSub, socketProtocol);
        //try subscription log check
        {
            //Test Data
            int stepCount = 0;
            TestResult tr = new TestResult();
            tr.setDescription("Testing a new subscription for a simple connected object is logged (redundant if protocol=IN_PROCESS)");

            assertEquals(tr, stepCount++, true, isLogged(file, subId2, simpleListUri, startReason, pre, socketProtocol), "Subscription not logged for " + simpleListUri);
            results.add(tr);
        }

        ConnectedResponse complexConnectedObjectResponse = client.complexConnectedObject(ctx);
        Heap complexConnectedObjectHeap = protocol == TestConnectedObjectsProtocolEnum.IN_PROCESS ? new ImmutableHeap(complexConnectedObjectResponse.getHeap().getUri(),complexConnectedObjectResponse.getHeap(),true) : complexConnectedObjectResponse.getHeap();

        Subscription complexConnectedObjectSub = complexConnectedObjectResponse.getSubscription();

        String subId3 = getSubscriptionId(complexConnectedObjectSub, socketProtocol);
        //try subscription log check
        {
            //Test Data
View Full Code Here


                public void execute(ExecutionContext ctx, OperationKey key,
                        Object[] args, ExecutionObserver observer,
                        ExecutionVenue executionVenue, TimeConstraints timeConstraints) {

                try {
                    ConnectedResponse result = service.simpleConnectedObject((RequestContext)ctx, timeConstraints);
                    observer.onResult(new ExecutionResult(result));
                } catch (CougarException ce) {
                    observer.onResult(new ExecutionResult(ce));
                };
            }
        });

      executableMap.put(BaselineServiceDefinition.appendSimpleConnectedObjectKey,
            new Executable() {
                @Override
                public void execute(ExecutionContext ctx, OperationKey key,
                        Object[] args, ExecutionObserver observer,
                        ExecutionVenue executionVenue, TimeConstraints timeConstraints) {

                try {
                    service.appendSimpleConnectedObject((RequestContext)ctx, (SimpleConnectedObject)args[0], timeConstraints);
                    observer.onResult(new ExecutionResult());
                } catch (CougarException ce) {
                    observer.onResult(new ExecutionResult(ce));
                };
            }
        });

      executableMap.put(BaselineServiceDefinition.updateSimpleConnectedListKey,
            new Executable() {
                @Override
                public void execute(ExecutionContext ctx, OperationKey key,
                        Object[] args, ExecutionObserver observer,
                        ExecutionVenue executionVenue, TimeConstraints timeConstraints) {

                try {
                    service.updateSimpleConnectedList((RequestContext)ctx, (List<SimpleConnectedObject>)args[0], timeConstraints);
                    observer.onResult(new ExecutionResult());
                } catch (CougarException ce) {
                    observer.onResult(new ExecutionResult(ce));
                };
            }
        });

      executableMap.put(BaselineServiceDefinition.simpleConnectedListKey,
            new Executable() {
                @Override
                public void execute(ExecutionContext ctx, OperationKey key,
                        Object[] args, ExecutionObserver observer,
                        ExecutionVenue executionVenue, TimeConstraints timeConstraints) {

                try {
                    ConnectedResponse result = service.simpleConnectedList((RequestContext)ctx, timeConstraints);
                    observer.onResult(new ExecutionResult(result));
                } catch (CougarException ce) {
                    observer.onResult(new ExecutionResult(ce));
                };
            }
        });

      executableMap.put(BaselineServiceDefinition.updateComplexConnectedObjectKey,
            new Executable() {
                @Override
                public void execute(ExecutionContext ctx, OperationKey key,
                        Object[] args, ExecutionObserver observer,
                        ExecutionVenue executionVenue, TimeConstraints timeConstraints) {

                try {
                    service.updateComplexConnectedObject((RequestContext)ctx, (VeryComplexObject)args[0], timeConstraints);
                    observer.onResult(new ExecutionResult());
                } catch (CougarException ce) {
                    observer.onResult(new ExecutionResult(ce));
                };
            }
        });

      executableMap.put(BaselineServiceDefinition.complexConnectedObjectKey,
            new Executable() {
                @Override
                public void execute(ExecutionContext ctx, OperationKey key,
                        Object[] args, ExecutionObserver observer,
                        ExecutionVenue executionVenue, TimeConstraints timeConstraints) {

                try {
                    ConnectedResponse result = service.complexConnectedObject((RequestContext)ctx, timeConstraints);
                    observer.onResult(new ExecutionResult(result));
                } catch (CougarException ce) {
                    observer.onResult(new ExecutionResult(ce));
                };
            }
View Full Code Here

                        ExecutionVenue executionVenue, TimeConstraints timeConstraints) {

                ServiceExceptionHandlingObserver exceptionHandlingObserver = new ServiceExceptionHandlingObserver(observer);

                try {
                    ConnectedResponse result = service.simpleConnectedObject((RequestContext)ctx, timeConstraints);
                    observer.onResult(new ExecutionResult(result));
                } catch (CougarException ce) {
                    exceptionHandlingObserver.onResult(new ExecutionResult(ce));
                };
            }
        });

      executableMap.put(BaselineServiceDefinition.appendSimpleConnectedObjectKey,
            new Executable() {
                @Override
                public void execute(ExecutionContext ctx, OperationKey key,
                        Object[] args, ExecutionObserver observer,
                        ExecutionVenue executionVenue, TimeConstraints timeConstraints) {

                ServiceExceptionHandlingObserver exceptionHandlingObserver = new ServiceExceptionHandlingObserver(observer);

                try {
                    service.appendSimpleConnectedObject((RequestContext)ctx, (SimpleConnectedObject)args[0], timeConstraints);
                    exceptionHandlingObserver.onResult(new ExecutionResult());
                } catch (CougarException ce) {
                    exceptionHandlingObserver.onResult(new ExecutionResult(ce));
                };
            }
        });

      executableMap.put(BaselineServiceDefinition.updateSimpleConnectedListKey,
            new Executable() {
                @Override
                public void execute(ExecutionContext ctx, OperationKey key,
                        Object[] args, ExecutionObserver observer,
                        ExecutionVenue executionVenue, TimeConstraints timeConstraints) {

                ServiceExceptionHandlingObserver exceptionHandlingObserver = new ServiceExceptionHandlingObserver(observer);

                try {
                    service.updateSimpleConnectedList((RequestContext)ctx, (List<SimpleConnectedObject>)args[0], timeConstraints);
                    exceptionHandlingObserver.onResult(new ExecutionResult());
                } catch (CougarException ce) {
                    exceptionHandlingObserver.onResult(new ExecutionResult(ce));
                };
            }
        });

      executableMap.put(BaselineServiceDefinition.simpleConnectedListKey,
            new Executable() {
                @Override
                public void execute(ExecutionContext ctx, OperationKey key,
                        Object[] args, ExecutionObserver observer,
                        ExecutionVenue executionVenue, TimeConstraints timeConstraints) {

                ServiceExceptionHandlingObserver exceptionHandlingObserver = new ServiceExceptionHandlingObserver(observer);

                try {
                    ConnectedResponse result = service.simpleConnectedList((RequestContext)ctx, timeConstraints);
                    observer.onResult(new ExecutionResult(result));
                } catch (CougarException ce) {
                    exceptionHandlingObserver.onResult(new ExecutionResult(ce));
                };
            }
        });

      executableMap.put(BaselineServiceDefinition.updateComplexConnectedObjectKey,
            new Executable() {
                @Override
                public void execute(ExecutionContext ctx, OperationKey key,
                        Object[] args, ExecutionObserver observer,
                        ExecutionVenue executionVenue, TimeConstraints timeConstraints) {

                ServiceExceptionHandlingObserver exceptionHandlingObserver = new ServiceExceptionHandlingObserver(observer);

                try {
                    service.updateComplexConnectedObject((RequestContext)ctx, (VeryComplexObject)args[0], timeConstraints);
                    exceptionHandlingObserver.onResult(new ExecutionResult());
                } catch (CougarException ce) {
                    exceptionHandlingObserver.onResult(new ExecutionResult(ce));
                };
            }
        });

      executableMap.put(BaselineServiceDefinition.complexConnectedObjectKey,
            new Executable() {
                @Override
                public void execute(ExecutionContext ctx, OperationKey key,
                        Object[] args, ExecutionObserver observer,
                        ExecutionVenue executionVenue, TimeConstraints timeConstraints) {

                ServiceExceptionHandlingObserver exceptionHandlingObserver = new ServiceExceptionHandlingObserver(observer);

                try {
                    ConnectedResponse result = service.complexConnectedObject((RequestContext)ctx, timeConstraints);
                    observer.onResult(new ExecutionResult(result));
                } catch (CougarException ce) {
                    exceptionHandlingObserver.onResult(new ExecutionResult(ce));
                };
            }
View Full Code Here

TOP

Related Classes of com.betfair.cougar.core.api.ev.ConnectedResponse

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.