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

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


    this.bev = bev;
  }

  @Override
  public InterceptorResult invoke(ExecutionContext ctx, OperationKey key, Object[] args) {
    OperationDefinition operationDefinition = bev.getOperationDefinition(key);
    Parameter[] parms = operationDefinition.getParameters();

    for (int i = 0 ; i < args.length; i++) {

        if (args[i] == null) {
              if (parms[i].isMandatory()) {
View Full Code Here


      }
    }
  }

  public void bindOperation(ServiceBindingDescriptor serviceBindingDescriptor, OperationBindingDescriptor bindingDescriptor) {
    OperationDefinition operationDefinition = getOperationDefinition(bindingDescriptor.getOperationKey());
    if (operationDefinition!=null) {
      RescriptOperationBindingDescriptor rescriptOperationBindingDescriptor = (RescriptOperationBindingDescriptor) bindingDescriptor;

            HttpServiceBindingDescriptor httpServiceBindingDescriptor = (HttpServiceBindingDescriptor) serviceBindingDescriptor;
            String uri = stripMinorVersionFromUri(httpServiceBindingDescriptor.getServiceContextPath() + httpServiceBindingDescriptor.getServiceVersion());
View Full Code Here

                    String schemaContent = baos.toString();
                    Schema schema = schemaFactory.newSchema(new StreamSource(new StringReader(schemaContent)));
                    String uriVersionStripped = stripMinorVersionFromUri(soapServiceDesc.getServiceContextPath() + soapServiceDesc.getServiceVersion());
                    for (OperationBindingDescriptor desc : soapServiceDesc.getOperationBindings()) {
                        SoapOperationBindingDescriptor soapOpDesc = (SoapOperationBindingDescriptor) desc;
                        OperationDefinition opDef = getOperationDefinition(soapOpDesc.getOperationKey());
                        String operationName = uriVersionStripped + "/" + soapOpDesc.getRequestName().toLowerCase();
                        bindings.put(operationName,
                                new SoapOperationBinding(opDef, soapOpDesc,
                                        soapServiceDesc, schema));
                    }
View Full Code Here

    Parameter[] params = new Parameter[parameters.length];
    for (int i=0; i<parameters.length; i++) {
      params[i] = new Parameter(parameters[i].first, new ParameterType(parameters[i].second, null),true);
    }
   
    final OperationDefinition operationDef = new SimpleOperationDefinition( operationKey, params,new ParameterType(response, null ) );
   
   
    return new ExecutionVenue() {
      public void execute(ExecutionContext ctx, OperationKey key, Object[] args, ExecutionObserver observer, TimeConstraints timeConstraints) {}
      public void execute(ExecutionContext ctx, OperationKey key, Object[] args, ExecutionObserver observer, Executor executor, TimeConstraints timeConstraints) {}
View Full Code Here

    this.bev = bev;
  }

  @Override
  public InterceptorResult invoke(ExecutionContext ctx, OperationKey key, Object[] args) {
    OperationDefinition operationDefinition = bev.getOperationDefinition(key);
    Parameter[] parms = operationDefinition.getParameters();

    for (int i = 0 ; i < args.length; i++) {
     
        if (args[i] == null) {
              if (parms[i].isMandatory()) {
View Full Code Here

                }
                byte protocolVersion = CougarProtocol.getProtocolVersion(command.getSession());
                ExecutionContextWithTokens context = marshaller.readExecutionContext(in, command.getRemoteAddress(), clientCertChain, transportSecurityStrengthFactor, protocolVersion);
                final SocketRequestContextImpl requestContext = new SocketRequestContextImpl(context);
                OperationKey remoteOperationKey = marshaller.readOperationKey(in);
                OperationDefinition opDef = findCompatibleBinding(remoteOperationKey);
                if (opDef == null) {
                    throw new CougarFrameworkException("Can't find operation definition in bindings for operation named '" + remoteOperationKey.getOperationName() + "'");
                }
                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
View Full Code Here

        }

    }

    private OperationDefinition findCompatibleBinding(OperationKey remoteOperationKey) {
        OperationDefinition ret = bindings.get(remoteOperationKey);
        if (ret != null) {
            return ret;
        }
        // if the client is requesting the same major version of this method, then let it through..
        OperationKey myKeyForThisMethod = namedOperations.get(remoteOperationKey.toString(false));
View Full Code Here

    private Iterable<ServiceBindingDescriptor> getServiceBindingDescriptors() {
        return serviceBindingDescriptors.values();
    }

    public void bindOperation(OperationBindingDescriptor bindingDescriptor) {
        OperationDefinition operationDefinition = getOperationDefinition(bindingDescriptor.getOperationKey());
        if (operationDefinition != null) {
            bindings.put(operationDefinition.getOperationKey(), operationDefinition);
            // for version difference negotiation
            namedOperations.put(operationDefinition.getOperationKey().toString(false), operationDefinition.getOperationKey());
        }
    }
View Full Code Here

                }
                byte protocolVersion = CougarProtocol.getProtocolVersion(command.getSession());
                ExecutionContextWithTokens context = marshaller.readExecutionContext(in, command.getRemoteAddress(), clientCertChain, transportSecurityStrengthFactor, protocolVersion);
                final SocketRequestContextImpl requestContext = new SocketRequestContextImpl(context);
                OperationKey remoteOperationKey = marshaller.readOperationKey(in);
                OperationDefinition opDef = findCompatibleBinding(remoteOperationKey);
                if (opDef == null) {
                    throw new CougarFrameworkException("Can't find operation definition in bindings for operation named '" + remoteOperationKey.getOperationName() + "'");
                }
                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
View Full Code Here

        }

    }

    private OperationDefinition findCompatibleBinding(OperationKey remoteOperationKey) {
        OperationDefinition ret = bindings.get(remoteOperationKey);
        if (ret != null) {
            return ret;
        }
        // if the client is requesting the same major version of this method, then let it through..
        OperationKey myKeyForThisMethod = namedOperations.get(remoteOperationKey.toString(false));
View Full Code Here

TOP

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

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.