Package com.betfair.baseline.v2

Examples of com.betfair.baseline.v2.BaselineSyncClientImpl


            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


                throw new SimpleException(response, errCode, message);
            }
            catch (IllegalArgumentException e) {
                try {
                    WotsitExceptionErrorCodeEnum errCode = WotsitExceptionErrorCodeEnum.valueOf(message.toUpperCase(Locale.ENGLISH));
                    throw new WotsitException(e,
                            response,
                            errCode, (message.hashCode() % 2) != 0 ? WotsitExceptionTypeEnum.CHEESY : WotsitExceptionTypeEnum.SPICY,
                            String.valueOf(responseCode));
                }
                catch (IllegalArgumentException ex) {
View Full Code Here

          message);
    } catch (IllegalArgumentException e) {
      try {
        WotsitExceptionErrorCodeEnum errCode = WotsitExceptionErrorCodeEnum
            .valueOf(message);
        throw new WotsitException(e,
            ResponseCode.Forbidden,
            errCode,
            (message.hashCode() % 2 != 0) ? WotsitExceptionTypeEnum.CHEESY
                : WotsitExceptionTypeEnum.SPICY, message);
      } catch (IllegalArgumentException ex) {
View Full Code Here

        new Pair<String, Class<?>>("message",BodyParamEnumObject.class)
    };   
   
    ExecutionVenue ev = createExecutionVenue(enumOperationKey,parameters, EnumOperationResponseObject.class);

    BodyParamEnumObject bodyObject = new BodyParamEnumObject(body);
    final CountDownLatch cl = new CountDownLatch(1);
    System.out.print("Starting testServerAddedValues : ");
    e.execute(ec, enumOperationKey, new Object[] {header,query,bodyObject}, new ExecutionObserver() {

      @Override
View Full Code Here

        new Pair<String, Class<?>>("message",BodyParamEnumObject.class)
    };   
   
    ExecutionVenue ev = createExecutionVenue(enumOperationKey,parameters,EnumOperationResponseObject.class);

    BodyParamEnumObject bodyObject = new BodyParamEnumObject(body);
    final CountDownLatch cl = new CountDownLatch(1);
    System.out.print("Starting testServerRemovedValues : ");
    e.execute(ec, enumOperationKey, new Object[] {header,query,bodyObject}, new ExecutionObserver() {

      @Override
View Full Code Here

        new Pair<String, Class<?>>("message",BodyParamEnumObject.class)
    };   
   
    ExecutionVenue ev = createExecutionVenue(enumOperationKey,parameters, EnumOperationResponseObject.class);

    BodyParamEnumObject bodyObject = new BodyParamEnumObject(body);
    final CountDownLatch cl = new CountDownLatch(1);
    System.out.print("Starting testServerRemovedValues : ");
    e.execute(ec, enumOperationKey, new Object[] {header,query,bodyObject}, new ExecutionObserver() {

      @Override
View Full Code Here

  public BoolOperationResponseObject boolOperation(RequestContext ctx, Boolean headerParam, Boolean queryParam,
      BodyParamBoolObject message, TimeConstraints timeConstraints) throws SimpleException {

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

    BoolOperationResponseObject returnObject = new BoolOperationResponseObject();

    returnObject.setBodyParameter(message.getBodyParameter());
    returnObject.setHeaderParameter(headerParam);
    returnObject.setQueryParameter(queryParam);

    return returnObject;
  }
View Full Code Here

  public ByteOperationResponseObject byteOperation(RequestContext ctx, Byte headerParam, Byte queryParam,
      BodyParamByteObject message, TimeConstraints timeConstraints) throws SimpleException {

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

    ByteOperationResponseObject returnObject = new ByteOperationResponseObject();

    returnObject.setBodyParameter(message.getBodyParameter());
    returnObject.setHeaderParameter(headerParam);
    returnObject.setQueryParameter(queryParam);

    return returnObject;

  }
View Full Code Here

  }

    @Override
    public CallSecurity checkSecurity(RequestContext ctx, TimeConstraints timeConstraints) {
        ctx.setRequestLogExtension(new BaselineLogExtension("", null, null));
        CallSecurity ret = new CallSecurity();
        for (Identity id : ctx.getIdentity().getIdentities()) {
            if (id.getPrincipal().getName().contains(SSLAwareTokenResolver.SSL_CERT_INFO)) {
                ret.setClientSubject(id.getCredential().getValue().toString());
            }
        }
        ret.setSecurityStrengthFactor(ctx.getTransportSecurityStrengthFactor());
        return ret;
    }
View Full Code Here

    Object[] requestMapKeys = requestMap.keySet().toArray();
    Arrays.sort(requestMapKeys);

    if (requestMap.size() == 1 && requestMapKeys[0].toString().equalsIgnoreCase("DELEGATE")) {
      ComplexMapOperationResponseObjectDelegate delegate = new ComplexMapOperationResponseObjectDelegateImpl();
      return new ComplexMapOperationResponseObject(delegate);
    }
    else {

      Map<String,SomeComplexObject> responseMap = new LinkedHashMap<String,SomeComplexObject>();

      for (Object key : requestMapKeys) {
        SomeComplexObject responseComplexObject = new SomeComplexObject();
        SomeComplexObject requestComplexObject = requestMap.get(key.toString());
        responseComplexObject.setDateTimeParameter(requestComplexObject.getDateTimeParameter());
        responseComplexObject.setListParameter(requestComplexObject.getListParameter());
        responseComplexObject.setEnumParameter(requestComplexObject.getEnumParameter());
        responseComplexObject.setStringParameter(requestComplexObject.getStringParameter());
        responseMap.put(key.toString(), responseComplexObject);
      }

      ComplexMapOperationResponseObject response = new ComplexMapOperationResponseObject();
      response.setResponseMap(responseMap);
      return response;
    }
  }
View Full Code Here

TOP

Related Classes of com.betfair.baseline.v2.BaselineSyncClientImpl

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.