Package com.betfair.cougar.transport.api

Examples of com.betfair.cougar.transport.api.ExecutionCommand


      }
    }
    final Object[] finalArgs = args;
        final TimeConstraints realTimeConstraints = DefaultTimeConstraints.rebaseFromNewStartTime(context.getRequestTime(), readRawTimeConstraints(command.getRequest()));
    final long bytesRead = iStream != null ? iStream.getCount() : 0;
    return new ExecutionCommand() {
            public Object[] getArgs() {
                return finalArgs;
            }

            public OperationKey getOperationKey() {
View Full Code Here


                                    // complex types are handled by the mapper, but for some reason, direct enums are not
                                    if (javaType.isEnumType() && args[i] != null && ((Enum)args[i]).name().equals("UNRECOGNIZED_VALUE")) {
                                        throw new IllegalArgumentException(new Exception(new EnumDerialisationException("UNRECOGNIZED_VALUE is not allowed as an input")));
                                    }
                                }
                                commands.add(new ExecutionCommand() {//2nd: index 0, 3rd: index 1, 4th: index 2
                                    @Override
                                    public void onResult(ExecutionResult executionResult) {
                                        JsonRpcResponse response = buildExecutionResultResponse(rpc, executionResult);
                                        synchronized(responses) {
                                            responses.add(response);
View Full Code Here

            final CommandResolver<HttpCommand> resolver = createCommandResolver(command);
            ctx = resolver.resolveExecutionContext();

            final TimeConstraints realTimeConstraints = DefaultTimeConstraints.rebaseFromNewStartTime(ctx.getRequestTime(), readRawTimeConstraints(command.getRequest()));
            final ExecutionContextWithTokens finalCtx = ctx;
            ExecutionCommand resolveCommand = new ExecutionCommand() {
                @Override
                public OperationKey getOperationKey() {
                    return IDENTITY_RESOLUTION_OPDEF.getOperationKey();
                }
View Full Code Here

            final HttpCommand command, final ExecutionContextWithTokens context,
            OMElement requestNode, ByteCountingInputStream in) {
        final Object[] args = readArgs(operationBinding, requestNode);
        final long bytesRead = in.getCount();
        final TimeConstraints realTimeConstraints = DefaultTimeConstraints.rebaseFromNewStartTime(context.getRequestTime(), readRawTimeConstraints(command.getRequest()));
        return new ExecutionCommand() {
            public Object[] getArgs() {
                return args;
            }

            public OperationKey getOperationKey() {
View Full Code Here

                final OperationKey operationKey = opDef.getOperationKey(); // safer to read it from locally
                final OperationDefinition operationDefinition = getExecutionVenue().getOperationDefinition(operationKey);
                final Object[] args = marshaller.readArgs(operationDefinition.getParameters(), in);
                TimeConstraints rawTimeConstraints = marshaller.readTimeConstraintsIfPresent(in, protocolVersion);
                final TimeConstraints timeConstraints = DefaultTimeConstraints.rebaseFromNewStartTime(context.getRequestTime(), rawTimeConstraints);
                final ExecutionCommand exec = new ExecutionCommand() {

                    @Override
                    public Object[] getArgs() {
                        return args;
                    }
View Full Code Here

                final OperationKey operationKey = opDef.getOperationKey(); // safer to read it from locally
                final OperationDefinition operationDefinition = getExecutionVenue().getOperationDefinition(operationKey);
                final Object[] args = marshaller.readArgs(operationDefinition.getParameters(), in);
                TimeConstraints rawTimeConstraints = marshaller.readTimeConstraintsIfPresent(in, protocolVersion);
                final TimeConstraints timeConstraints = DefaultTimeConstraints.rebaseFromNewStartTime(context.getRequestTime(), rawTimeConstraints);
                final ExecutionCommand exec = new ExecutionCommand() {

                    @Override
                    public Object[] getArgs() {
                        return args;
                    }
View Full Code Here

            final HttpCommand command, final ExecutionContextWithTokens context,
            OMElement requestNode, ByteCountingInputStream in) {
        final Object[] args = readArgs(operationBinding, requestNode);
        final long bytesRead = in.getCount();
        final TimeConstraints realTimeConstraints = DefaultTimeConstraints.rebaseFromNewStartTime(context.getRequestTime(), readRawTimeConstraints(command.getRequest()));
        return new ExecutionCommand() {
            public Object[] getArgs() {
                return args;
            }

            public OperationKey getOperationKey() {
View Full Code Here

                                for (int i=0;i<paramDefs.length;i++) {
                                    JsonNode paramValue = rpc.getParams().isArray() ? rpc.getParams().get(i) : rpc.getParams().get(paramDefs[i].getName());
                                    JavaType javaType = paramDefs[i].getJavaType();
                                    args[i] = mapper.convertValue(paramValue, javaType);
                                }
                                commands.add(new ExecutionCommand() {
                                    @Override
                                    public void onResult(ExecutionResult executionResult) {
                                        JsonRpcResponse response = buildExecutionResultResponse(rpc, executionResult);
                                        synchronized(responses) {
                                            responses.add(response);
View Full Code Here

            final CommandResolver<HttpCommand> resolver = createCommandResolver(command);
            ctx = resolver.resolveExecutionContext();

            final TimeConstraints realTimeConstraints = DefaultTimeConstraints.rebaseFromNewStartTime(ctx.getRequestTime(), readRawTimeConstraints(command.getRequest()));
            final ExecutionContextWithTokens finalCtx = ctx;
            ExecutionCommand resolveCommand = new ExecutionCommand() {
                @Override
                public OperationKey getOperationKey() {
                    return IDENTITY_RESOLUTION_OPDEF.getOperationKey();
                }
View Full Code Here

      }
    }
    final Object[] finalArgs = args;
        final TimeConstraints realTimeConstraints = DefaultTimeConstraints.rebaseFromNewStartTime(context.getRequestTime(), readRawTimeConstraints(command.getRequest()));
    final long bytesRead = iStream != null ? iStream.getCount() : 0;
    return new ExecutionCommand() {
            public Object[] getArgs() {
                return finalArgs;
            }

            public OperationKey getOperationKey() {
View Full Code Here

TOP

Related Classes of com.betfair.cougar.transport.api.ExecutionCommand

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.