Package com.betfair.cougar.core.api.exception

Examples of com.betfair.cougar.core.api.exception.CougarClientException


                   new Object[] { inputList , inputMap },
                   observer,
                   timeConstraints);

        if (!observer.await(timeConstraints)) {
            throw new CougarClientException(ServerFaultCode.Timeout, "Operation mandatoryCollectionElementTest timed out!");
        }

        final ExecutionResult er = observer.getExecutionResult();
        switch (er.getResultType()) {
            case Success:
                return;

            case Fault:
                CougarException cex = er.getFault();

                if (cex.getServerFaultCode() == ServerFaultCode.ServiceCheckedException) {
                    List<String[]> exceptionParams = cex.getFault().getDetail().getFaultMessages();
                    String className = cex.getFault().getDetail().getDetailMessage();
                    if (className.equals("SimpleException")) {
                        throw new SimpleException(
                                                cex.getResponseCode(),
                                                   SimpleExceptionErrorCodeEnum.valueOf(exceptionParams.get(0)[1]),
                                                   (exceptionParams.get(1)[1])
                                              );
                    }

                    else {
                        throw new IllegalArgumentException("An unanticipated exception was received of class [" + className + "]");
                    }
                } else if (cex instanceof CougarFrameworkException) {
                    CougarFrameworkException cfe = (CougarFrameworkException) cex;
                    throw new CougarClientException(cfe.getServerFaultCode(), cfe.getMessage(), cfe.getCause());
                } else {
                  throw cex;
                }
            default:
                throw new IllegalArgumentException("The Server returned an illegal result type [" + er.getResultType() + "]");
View Full Code Here


                   new Object[] { preOrPostException },
                   observer,
                   timeConstraints);

        if (!observer.await(timeConstraints)) {
            throw new CougarClientException(ServerFaultCode.Timeout, "Operation interceptorCheckedExceptionOperation timed out!");
        }

        final ExecutionResult er = observer.getExecutionResult();
        switch (er.getResultType()) {
            case Success:
                return;

            case Fault:
                CougarException cex = er.getFault();

                if (cex.getServerFaultCode() == ServerFaultCode.ServiceCheckedException) {
                    List<String[]> exceptionParams = cex.getFault().getDetail().getFaultMessages();
                    String className = cex.getFault().getDetail().getDetailMessage();
                    if (className.equals("SimpleException")) {
                        throw new SimpleException(
                                                cex.getResponseCode(),
                                                   SimpleExceptionErrorCodeEnum.valueOf(exceptionParams.get(0)[1]),
                                                   (exceptionParams.get(1)[1])
                                              );
                    }

                    else {
                        throw new IllegalArgumentException("An unanticipated exception was received of class [" + className + "]");
                    }
                } else if (cex instanceof CougarFrameworkException) {
                    CougarFrameworkException cfe = (CougarFrameworkException) cex;
                    throw new CougarClientException(cfe.getServerFaultCode(), cfe.getMessage(), cfe.getCause());
                } else {
                  throw cex;
                }
            default:
                throw new IllegalArgumentException("The Server returned an illegal result type [" + er.getResultType() + "]");
View Full Code Here

                   new Object[] { inputList },
                   observer,
                   timeConstraints);

        if (!observer.await(timeConstraints)) {
            throw new CougarClientException(ServerFaultCode.Timeout, "Operation listOfComplexOperation timed out!");
        }

        final ExecutionResult er = observer.getExecutionResult();
        switch (er.getResultType()) {
            case Success:
                return;

            case Fault:
                CougarException cex = er.getFault();

                if (cex.getServerFaultCode() == ServerFaultCode.ServiceCheckedException) {
                    List<String[]> exceptionParams = cex.getFault().getDetail().getFaultMessages();
                    String className = cex.getFault().getDetail().getDetailMessage();
                    if (className.equals("SimpleException")) {
                        throw new SimpleException(
                                                cex.getResponseCode(),
                                                   SimpleExceptionErrorCodeEnum.valueOf(exceptionParams.get(0)[1]),
                                                   (exceptionParams.get(1)[1])
                                              );
                    }

                    else {
                        throw new IllegalArgumentException("An unanticipated exception was received of class [" + className + "]");
                    }
                } else if (cex instanceof CougarFrameworkException) {
                    CougarFrameworkException cfe = (CougarFrameworkException) cex;
                    throw new CougarClientException(cfe.getServerFaultCode(), cfe.getMessage(), cfe.getCause());
                } else {
                  throw cex;
                }
            default:
                throw new IllegalArgumentException("The Server returned an illegal result type [" + er.getResultType() + "]");
View Full Code Here

                   new Object[] { inputSet },
                   observer,
                   timeConstraints);

        if (!observer.await(timeConstraints)) {
            throw new CougarClientException(ServerFaultCode.Timeout, "Operation setOfComplexOperation timed out!");
        }

        final ExecutionResult er = observer.getExecutionResult();
        switch (er.getResultType()) {
            case Success:
                return;

            case Fault:
                CougarException cex = er.getFault();

                if (cex.getServerFaultCode() == ServerFaultCode.ServiceCheckedException) {
                    List<String[]> exceptionParams = cex.getFault().getDetail().getFaultMessages();
                    String className = cex.getFault().getDetail().getDetailMessage();
                    if (className.equals("SimpleException")) {
                        throw new SimpleException(
                                                cex.getResponseCode(),
                                                   SimpleExceptionErrorCodeEnum.valueOf(exceptionParams.get(0)[1]),
                                                   (exceptionParams.get(1)[1])
                                              );
                    }

                    else {
                        throw new IllegalArgumentException("An unanticipated exception was received of class [" + className + "]");
                    }
                } else if (cex instanceof CougarFrameworkException) {
                    CougarFrameworkException cfe = (CougarFrameworkException) cex;
                    throw new CougarClientException(cfe.getServerFaultCode(), cfe.getMessage(), cfe.getCause());
                } else {
                  throw cex;
                }
            default:
                throw new IllegalArgumentException("The Server returned an illegal result type [" + er.getResultType() + "]");
View Full Code Here

                   new Object[] { inputMap },
                   observer,
                   timeConstraints);

        if (!observer.await(timeConstraints)) {
            throw new CougarClientException(ServerFaultCode.Timeout, "Operation mapOfComplexOperation timed out!");
        }

        final ExecutionResult er = observer.getExecutionResult();
        switch (er.getResultType()) {
            case Success:
                return;

            case Fault:
                CougarException cex = er.getFault();

                if (cex.getServerFaultCode() == ServerFaultCode.ServiceCheckedException) {
                    List<String[]> exceptionParams = cex.getFault().getDetail().getFaultMessages();
                    String className = cex.getFault().getDetail().getDetailMessage();
                    if (className.equals("SimpleException")) {
                        throw new SimpleException(
                                                cex.getResponseCode(),
                                                   SimpleExceptionErrorCodeEnum.valueOf(exceptionParams.get(0)[1]),
                                                   (exceptionParams.get(1)[1])
                                              );
                    }

                    else {
                        throw new IllegalArgumentException("An unanticipated exception was received of class [" + className + "]");
                    }
                } else if (cex instanceof CougarFrameworkException) {
                    CougarFrameworkException cfe = (CougarFrameworkException) cex;
                    throw new CougarClientException(cfe.getServerFaultCode(), cfe.getMessage(), cfe.getCause());
                } else {
                  throw cex;
                }
            default:
                throw new IllegalArgumentException("The Server returned an illegal result type [" + er.getResultType() + "]");
View Full Code Here

                   new Object[] { inputList },
                   observer,
                   timeConstraints);

        if (!observer.await(timeConstraints)) {
            throw new CougarClientException(ServerFaultCode.Timeout, "Operation testSimpleDateListGet timed out!");
        }

        final ExecutionResult er = observer.getExecutionResult();
        switch (er.getResultType()) {
            case Success:
                return (List<Date>) er.getResult();

            case Fault:
                CougarException cex = er.getFault();

                if (cex.getServerFaultCode() == ServerFaultCode.ServiceCheckedException) {
                    List<String[]> exceptionParams = cex.getFault().getDetail().getFaultMessages();
                    String className = cex.getFault().getDetail().getDetailMessage();
                    if (className.equals("SimpleException")) {
                        throw new SimpleException(
                                                cex.getResponseCode(),
                                                   SimpleExceptionErrorCodeEnum.valueOf(exceptionParams.get(0)[1]),
                                                   (exceptionParams.get(1)[1])
                                              );
                    }

                    else {
                        throw new IllegalArgumentException("An unanticipated exception was received of class [" + className + "]");
                    }
                } else if (cex instanceof CougarFrameworkException) {
                    CougarFrameworkException cfe = (CougarFrameworkException) cex;
                    throw new CougarClientException(cfe.getServerFaultCode(), cfe.getMessage(), cfe.getCause());
                } else {
                  throw cex;
                }
            default:
                throw new IllegalArgumentException("The Server returned an illegal result type [" + er.getResultType() + "]");
View Full Code Here

                   new Object[] { inputMap },
                   observer,
                   timeConstraints);

        if (!observer.await(timeConstraints)) {
            throw new CougarClientException(ServerFaultCode.Timeout, "Operation testSimpleMapGet timed out!");
        }

        final ExecutionResult er = observer.getExecutionResult();
        switch (er.getResultType()) {
            case Success:
                return (Map<String,String>) er.getResult();

            case Fault:
                CougarException cex = er.getFault();

                if (cex.getServerFaultCode() == ServerFaultCode.ServiceCheckedException) {
                    List<String[]> exceptionParams = cex.getFault().getDetail().getFaultMessages();
                    String className = cex.getFault().getDetail().getDetailMessage();
                    if (className.equals("SimpleException")) {
                        throw new SimpleException(
                                                cex.getResponseCode(),
                                                   SimpleExceptionErrorCodeEnum.valueOf(exceptionParams.get(0)[1]),
                                                   (exceptionParams.get(1)[1])
                                              );
                    }

                    else {
                        throw new IllegalArgumentException("An unanticipated exception was received of class [" + className + "]");
                    }
                } else if (cex instanceof CougarFrameworkException) {
                    CougarFrameworkException cfe = (CougarFrameworkException) cex;
                    throw new CougarClientException(cfe.getServerFaultCode(), cfe.getMessage(), cfe.getCause());
                } else {
                  throw cex;
                }
            default:
                throw new IllegalArgumentException("The Server returned an illegal result type [" + er.getResultType() + "]");
View Full Code Here

                   new Object[] { inputList },
                   observer,
                   timeConstraints);

        if (!observer.await(timeConstraints)) {
            throw new CougarClientException(ServerFaultCode.Timeout, "Operation testSimpleListGet timed out!");
        }

        final ExecutionResult er = observer.getExecutionResult();
        switch (er.getResultType()) {
            case Success:
                return (List<String>) er.getResult();

            case Fault:
                CougarException cex = er.getFault();

                if (cex.getServerFaultCode() == ServerFaultCode.ServiceCheckedException) {
                    List<String[]> exceptionParams = cex.getFault().getDetail().getFaultMessages();
                    String className = cex.getFault().getDetail().getDetailMessage();
                    if (className.equals("SimpleException")) {
                        throw new SimpleException(
                                                cex.getResponseCode(),
                                                   SimpleExceptionErrorCodeEnum.valueOf(exceptionParams.get(0)[1]),
                                                   (exceptionParams.get(1)[1])
                                              );
                    }

                    else {
                        throw new IllegalArgumentException("An unanticipated exception was received of class [" + className + "]");
                    }
                } else if (cex instanceof CougarFrameworkException) {
                    CougarFrameworkException cfe = (CougarFrameworkException) cex;
                    throw new CougarClientException(cfe.getServerFaultCode(), cfe.getMessage(), cfe.getCause());
                } else {
                  throw cex;
                }
            default:
                throw new IllegalArgumentException("The Server returned an illegal result type [" + er.getResultType() + "]");
View Full Code Here

                   new Object[] { inputSet },
                   observer,
                   timeConstraints);

        if (!observer.await(timeConstraints)) {
            throw new CougarClientException(ServerFaultCode.Timeout, "Operation testSimpleSetGet timed out!");
        }

        final ExecutionResult er = observer.getExecutionResult();
        switch (er.getResultType()) {
            case Success:
                return (Set<String>) er.getResult();

            case Fault:
                CougarException cex = er.getFault();

                if (cex.getServerFaultCode() == ServerFaultCode.ServiceCheckedException) {
                    List<String[]> exceptionParams = cex.getFault().getDetail().getFaultMessages();
                    String className = cex.getFault().getDetail().getDetailMessage();
                    if (className.equals("SimpleException")) {
                        throw new SimpleException(
                                                cex.getResponseCode(),
                                                   SimpleExceptionErrorCodeEnum.valueOf(exceptionParams.get(0)[1]),
                                                   (exceptionParams.get(1)[1])
                                              );
                    }

                    else {
                        throw new IllegalArgumentException("An unanticipated exception was received of class [" + className + "]");
                    }
                } else if (cex instanceof CougarFrameworkException) {
                    CougarFrameworkException cfe = (CougarFrameworkException) cex;
                    throw new CougarClientException(cfe.getServerFaultCode(), cfe.getMessage(), cfe.getCause());
                } else {
                  throw cex;
                }
            default:
                throw new IllegalArgumentException("The Server returned an illegal result type [" + er.getResultType() + "]");
View Full Code Here

                   new Object[] { },
                   observer,
                   timeConstraints);

        if (!observer.await(timeConstraints)) {
            throw new CougarClientException(ServerFaultCode.Timeout, "Operation testSimpleGet timed out!");
        }

        final ExecutionResult er = observer.getExecutionResult();
        switch (er.getResultType()) {
            case Success:
                return (SimpleResponse) er.getResult();

            case Fault:
                CougarException cex = er.getFault();

                if (cex.getServerFaultCode() == ServerFaultCode.ServiceCheckedException) {
                    List<String[]> exceptionParams = cex.getFault().getDetail().getFaultMessages();
                    String className = cex.getFault().getDetail().getDetailMessage();
                    if (className.equals("SimpleException")) {
                        throw new SimpleException(
                                                cex.getResponseCode(),
                                                   SimpleExceptionErrorCodeEnum.valueOf(exceptionParams.get(0)[1]),
                                                   (exceptionParams.get(1)[1])
                                              );
                    }

                    else {
                        throw new IllegalArgumentException("An unanticipated exception was received of class [" + className + "]");
                    }
                } else if (cex instanceof CougarFrameworkException) {
                    CougarFrameworkException cfe = (CougarFrameworkException) cex;
                    throw new CougarClientException(cfe.getServerFaultCode(), cfe.getMessage(), cfe.getCause());
                } else {
                  throw cex;
                }
            default:
                throw new IllegalArgumentException("The Server returned an illegal result type [" + er.getResultType() + "]");
View Full Code Here

TOP

Related Classes of com.betfair.cougar.core.api.exception.CougarClientException

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.