Package com.betfair.cougar.core.api.transcription

Examples of com.betfair.cougar.core.api.transcription.Parameter


            }
        }
        try {
            for (int i = 0; i < args.length; ++i) {
                RescriptParamBindingDescriptor descriptor = paramBindings[i];
                Parameter param = operationDefinition.getParameters()[i];
                switch (descriptor.getSource()) {
                    case HEADER :
                        String key = descriptor.getName();
                        args[i] = resolveArgument(headersWithNullValues.contains(key.toLowerCase()) ? "" : request.getHeader(key), param, descriptor, format);
                        break;
                    case QUERY :
                        args[i] = resolveArgument(request.getParameter(descriptor.getName()), param, descriptor, format);
                        break;
                    case BODY :
                        if (body != null) {
                            args[i] = body.getValue(descriptor.getName());
                            // non-null enums get stored as their raw string value so need converting to the true enum value
                            if (param.getParameterType().getType() == ParameterType.Type.ENUM) {
                                if (args[i] != null) {
                                    args[i] = EnumUtils.readEnum(param.getParameterType().getImplementationClass(), (String) args[i]);
                                }
                            }
                        }
                        break;
                    default :
View Full Code Here


 
  private ExecutionVenue createExecutionVenue(OperationKey operationKey, Pair<String,Class<?>>[] parameters, Class response) {
   
    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 ) );
   
   
View Full Code Here

        String detailMessage = in.readObject(FaultDetail.detailMessageParam, true);
        String className = (String) in.readObject(FaultDetail.faultClassNameParam, true);
        Throwable exception = null;
        if (className != null) {
            ParameterType type = new ParameterType(Class.forName(ClassnameCompatibilityMapper.toMajorOnlyPackaging(className)), null);
            exception = (Throwable)in.readObject(new Parameter("exception", type, false), true);
        }
        return new FaultDetail(detailMessage, exception);
    }
View Full Code Here

        out.writeObject(detail.getDetailMessage(), FaultDetail.detailMessageParam, false);
        if (detail.getCause() != null && detail.getCause() instanceof Transcribable) {
            Transcribable tCause = (Transcribable) detail.getCause();
            out.writeObject(ClassnameCompatibilityMapper.toMajorMinorPackaging(tCause.getClass(), tCause.getServiceVersion()), FaultDetail.faultClassNameParam, false);
            ParameterType type = new ParameterType(detail.getCause().getClass(), null);
            out.writeObject(detail.getCause(), new Parameter("exception", type, false), false);
        } else {
            out.writeObject(null, FaultDetail.faultClassNameParam, false);
        }
    }
View Full Code Here

        String detailMessage = in.readObject(FaultDetail.detailMessageParam);
        String className = (String) in.readObject(FaultDetail.faultClassNameParam);
        Throwable exception = null;
        if (className != null) {
            ParameterType type = new ParameterType(Class.forName(ClassnameCompatibilityMapper.toMajorOnlyPackaging(className)), null);
            exception = (Throwable)in.readObject(new Parameter("exception", type, false));
        }
        return new FaultDetail(detailMessage, exception);
    }
View Full Code Here

        out.writeObject(detail.getDetailMessage(), FaultDetail.detailMessageParam);
        if (detail.getCause() != null && detail.getCause() instanceof Transcribable) {
            Transcribable tCause = (Transcribable) detail.getCause();
            out.writeObject(ClassnameCompatibilityMapper.toMajorMinorPackaging(tCause.getClass(), tCause.getServiceVersion()), FaultDetail.faultClassNameParam);
            ParameterType type = new ParameterType(detail.getCause().getClass(), null);
            out.writeObject(detail.getCause(), new Parameter("exception", type, false));
        } else {
            out.writeObject(null, FaultDetail.faultClassNameParam);
        }
    }
View Full Code Here

                headersWithNullValues.add(header.toLowerCase());
            }
        }
        for (int i = 0; i < args.length; ++i) {
            RescriptParamBindingDescriptor descriptor = paramBindings[i];
            Parameter param = operationDefinition.getParameters()[i];
            switch (descriptor.getSource()) {
                case HEADER :
                    String key = descriptor.getName();
                    args[i] = resolveArgument(headersWithNullValues.contains(key.toLowerCase()) ? "" : request.getHeader(key), param, descriptor);
                    break;
                case QUERY :
                    args[i] = resolveArgument(request.getParameter(descriptor.getName()), param, descriptor);
                    break;
                case BODY :
                    if (body != null) {
                        args[i] = body.getValue(descriptor.getName());
                        // non-null enums get stored as their raw string value so need converting to the true enum value
                        if (param.getParameterType().getType() == ParameterType.Type.ENUM) {
                            if (args[i] != null) {
                                args[i] = EnumUtils.readEnum(param.getParameterType().getImplementationClass(), (String) args[i]);
                            }
                        }
                    }
                  break;
                default :
View Full Code Here

TOP

Related Classes of com.betfair.cougar.core.api.transcription.Parameter

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.