checkResponseCode(response);
checkResponseCode(response = doConnect(opts));
checkResponseCode(response = doConnect(opts)); } finally { if (response != null)
/** * Destroy a KB instance. * * @param namespace * The namespace of the KB instance. * @param uuid * The {@link UUID} to be assigned to the request.a * * @throws Exception */ public void deleteRepository(final String namespace, final UUID uuid) throws Exception { final ConnectOptions opts = newConnectOptions(getRepositoryBaseURLForNamespace(namespace), uuid, null/* txId */); opts.method = "DELETE"; JettyResponseListener response = null; try { checkResponseCode(response = doConnect(opts)); } finally { if (response != null) response.abort(); } }
checkResponseCode(response = doConnect(opts)); } finally { if (response != null)
/** * List the currently running queries on the server * */ public Collection<RunningQuery> showQueries() throws Exception { final ConnectOptions opts = newUpdateConnectOptions(baseServiceURL, null, null/* txId */); opts.addRequestParam(SHOW_QUERIES); opts.setAcceptHeader(IMimeTypes.MIME_APPLICATION_JSON); JettyResponseListener response = null; try { // Issue request, check response status code. checkResponseCode(response = doConnect(opts)); final String contentType = response.getContentType(); if (!IMimeTypes.MIME_APPLICATION_JSON.equals(contentType)) throw new RuntimeException("Expected MIME_TYPE " + IMimeTypes.MIME_APPLICATION_JSON + " but received : " + contentType + "."); final InputStream is = response.getInputStream(); final List<RunningQuery> runningQueries = JsonHelper.readRunningQueryList(is); return runningQueries; } finally { /* * Ensure that the http response entity is consumed so that the http * connection will be released in a timely fashion. */ if (response != null) response.abort(); } }
try { checkResponseCode(response = doConnect(opts)); } finally {
checkResponseCode(response = doConnect(opts)); } finally { if (response != null)
/** * Resets the mapgraph runtime for the compute mode. * * @param computeMode the desired compute mode */ public void resetMapgraphRuntime(final ComputeMode computeMode) throws Exception { assertMapgraphRuntimeAvailable(); if (computeMode==null) { throw new IllegalArgumentException("Compute mode must not be null"); } final String repositoryUrl = getSparqlEndpointUrlForNamespaceOrDefault(null /* default namespace */); final ConnectOptions opts = newConnectOptions(repositoryUrl, UUID.randomUUID(), null/* tx */); JettyResponseListener response = null; // Setup the request entity. { opts.addRequestParam(MAPGRAPH, MAPGRAPH_RESET); opts.addRequestParam(COMPUTE_MODE, computeMode.toString()); opts.method = "POST"; } try { checkResponseCode(response = doConnect(opts)); } finally { if (response != null) response.abort(); } }
checkResponseCode(response = doConnect(opts));
checkResponseCode(response = doConnect(opts));
checkResponseCode(response = doConnect(opts));
try { checkResponseCode(response = doConnect(opts));
try { checkResponseCode(response = doConnect(opts));
checkResponseCode(response);
checkResponseCode(response);
checkResponseCode(response);