Package com.betfair.testingservice.v1.socket

Examples of com.betfair.testingservice.v1.socket.TestingSocketServiceBindingDescriptor


                found = true;
            }
        }

        if (!found) {
            throw new TestingException(ResponseCode.NotFound,
                    TestingExceptionErrorCodeEnum.NOT_FOUND);
        } else {
            response.setResult("OK");
        }
        return response;
View Full Code Here


            try {
                while ((line = reader.readLine()) != null) {
                    sb.append(line + "\n");
                }
            } catch (IOException e) {
                throw new TestingException(e, ResponseCode.InternalError,
                        TestingExceptionErrorCodeEnum.GENERIC);
            } finally {
                try {
                    reader.close();
                } catch (IOException e) {
                    logger
                            .log(Level.WARNING, "Failed to close input stream",
                                    e);
                    // Swallow it in case the it overrides the main exception
                }
            }
            IDD idd = new IDD();
            idd.setName(name);
            idd.setContent(sb.toString());
            return idd;
        }
        logger.log(Level.FINE, "IDD %s not found", "idd/" + name);
        throw new TestingException(ResponseCode.NotFound,
                TestingExceptionErrorCodeEnum.NOT_FOUND);

    }
View Full Code Here

            logger.log(Level.INFO, "Refreshed all caches");
            response.setResult("OK");
            return response;
        }
        logger.log(Level.INFO, "No cache frameworks found");
        throw new TestingException(ResponseCode.InternalError,
                TestingExceptionErrorCodeEnum.GENERIC);
    }
View Full Code Here

        try {
            br = new BufferedReader(new FileReader(filename));
            loglineBuffer = getLogFilesBufferedReaderImpl(br, conditions, maxEntriesReturned);
        } catch (IOException iox) {
            logger.log(iox);
            throw new TestingException(iox,ResponseCode.NotFound,
                    TestingExceptionErrorCodeEnum.NOT_FOUND);
        } finally {
          if(br != null) {
        try {
          br.close();
View Full Code Here

                }
            }
            loglineBuffer = getLogFilesBufferedReaderImpl(br, null, numLines);
        } catch (IOException iox) {
            logger.log(iox);
            throw new TestingException(iox,ResponseCode.NotFound,
                    TestingExceptionErrorCodeEnum.NOT_FOUND);
        } finally {
          if(br != null) {
            try {
              br.close();
View Full Code Here

    }

    @Override
    public CallResponse refreshCache(RequestContext ctx, String name, TimeConstraints timeConstraints)
            throws TestingException {
        CallResponse response = new CallResponse();
        boolean found = false;
        for (CacheFrameworkIntegration framework : cacheFrameworkRegistry.getFrameworks()) {
            if (framework.refreshNamedCache(name)) {
                found = true;
            }
        }

        if (!found) {
            throw new TestingException(ResponseCode.NotFound,
                    TestingExceptionErrorCodeEnum.NOT_FOUND);
        } else {
            response.setResult("OK");
        }
        return response;
    }
View Full Code Here

    }

    @Override
    public CallResponse refreshAllCaches(RequestContext ctx, TimeConstraints timeConstraints)
            throws TestingException {
        CallResponse response = new CallResponse();
        boolean done = false;
        for (CacheFrameworkIntegration framework : cacheFrameworkRegistry.getFrameworks()) {
            done = true;
            framework.refreshAllCaches();
        }
        if (done) {
            logger.log(Level.INFO, "Refreshed all caches");
            response.setResult("OK");
            return response;
        }
        logger.log(Level.INFO, "No cache frameworks found");
        throw new TestingException(ResponseCode.InternalError,
                TestingExceptionErrorCodeEnum.GENERIC);
View Full Code Here

                            .log(Level.WARNING, "Failed to close input stream",
                                    e);
                    // Swallow it in case the it overrides the main exception
                }
            }
            IDD idd = new IDD();
            idd.setName(name);
            idd.setContent(sb.toString());
            return idd;
        }
        logger.log(Level.FINE, "IDD %s not found", "idd/" + name);
        throw new TestingException(ResponseCode.NotFound,
                TestingExceptionErrorCodeEnum.NOT_FOUND);
View Full Code Here

                        + " to date");
            }
        }
        logLines = getLogFilesConditionalImpl(physicalLogFileName, conditions,
                this.getDefaultMaxNumberOfResults());
        LogFileResponse lfr = new LogFileResponse();
        lfr.setResult(logLines);
        return lfr;
    }
View Full Code Here

        logLines = getLogFilesSkippingReader(physicalLogFileName, numberOfLines
                .intValue());
        long end = System.nanoTime();
        logger.log(Level.INFO, "Took " + (end - start) + " ns");

        LogFileResponse lfr = new LogFileResponse();
        lfr.setResult(logLines);
        return lfr;
    }
View Full Code Here

TOP

Related Classes of com.betfair.testingservice.v1.socket.TestingSocketServiceBindingDescriptor

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.