Examples of BoxRealTimeServer


Examples of com.box.boxjavalibv2.dao.BoxRealTimeServer

            public void run() {

                final ObjectMapper mapper = new ObjectMapper();

                long currentStreamPosition = startStreamPosition;
                BoxRealTimeServer realTimeServer = null;

                boolean retry = false;
                int retries = 0;
                int maxRetries = 1;

                while (!done) {
                    try {
                        // set to true if no exceptions thrown
                        retry = false;

                        if (realTimeServer == null) {

                            // get RTS URL
                            realTimeServer = getBoxRealTimeServer(currentStreamPosition, eventsManager);

                            // update HTTP timeout
                            final int requestTimeout = Integer.parseInt(
                                realTimeServer.getExtraData(RETRY_TIMEOUT).toString());
                            final HttpParams params = httpClient.getParams();
                            HttpConnectionParams.setSoTimeout(params, requestTimeout * 1000);

                            // update maxRetries
                            maxRetries = Integer.parseInt(realTimeServer.getExtraData(MAX_RETRIES).toString());
                        }

                        // create HTTP request for RTS
                        httpGet = getPollRequest(realTimeServer.getUrl(), currentStreamPosition);

                        // execute RTS poll
                        HttpResponse httpResponse = null;
                        try {
                            httpResponse = httpClient.execute(httpGet, (HttpContext) null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.