Finishes a link request. Does nothing if {@link #mIsLinkRequested} is false prior to this call.

@return true if linking is successful; false otherwise.
558066
private boolean finishLinkRequest() {
        boolean isSuccessful = false;

        if (mIsLinkRequested) {
            synchronized (mDropboxApiLock) {
                if (mDropboxApi != null) {
                    AndroidAuthSession session = mDropboxApi.getSession();
                    if (session.authenticationSuccessful()) {
                        try {
                            // Set access token on the session.
                            session.finishAuthentication();
                            isSuccessful = true;
                        } catch (IllegalStateException e) {
                            // Do nothing.
                        }
                    }
                }
            }

            // Reset flag.
            mIsLinkRequested = false;
        }
        return isSuccessful;
    }
183806
public boolean checkResponseForException() {
    if (!finished && rsp != null) {
      Exception e;
      if ((e = rsp.getException()) != null) {
        setError(e.getMessage());
        setFinished();
        return true;
      }
    }
    return false;
  }
219585
public FinishRequest toFinishRequest(boolean includeHeaders) {
        if (includeHeaders) {
            return new FinishRequest(body, copyHeaders(headers), statusCode);
        } else {
            String mime = null;
            if (body!=null) {
                mime = "text/plain";
                if (headers!=null && (headers.containsKey("Content-Type") || headers.containsKey("content-type"))) {
                    mime = headers.get("Content-Type");
                    if (mime==null) {
                        mime = headers.get("content-type");
                    }
                }
            }

            return new FinishRequest(body, mime, statusCode);
        }
    }
1324038
protected boolean isWeb() {
		ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
		if (attributes == null) {
			return false;
		}
		HttpServletRequest request = attributes.getRequest();
		if (request == null) {
			return false;
		}
		return true;
	}
122781
public boolean completed() {
		if (engine == null) {
			return false;
		}

		if (length.isEnabled()) {
			if (timeout > 0) {
				return false;
			}
			return completed;
		}
		if (emitCount.isEnabled()) {
			if (leftToEmit > 0) {
				return false;
			}
			return completed;
		}

		if (wrapUp) {
			return completed;
		}
		
		return false;
	}
325190
public synchronized boolean cancel() {
    if (this.taskFuture != null && this.taskFuture.cancel(true)) {
      this.taskStateTracker.onTaskRunCompletion(this);
      this.completeShutdown();
      return true;
    } else {
      return false;
    }
  }
426728
public boolean limit() {

        //get connection
        Object connection = getConnection();

        Object result = limitRequest(connection);

        if (FAIL_CODE != (Long) result) {
            return true;
        } else {
            return false;
        }
    }
1275091
public boolean isSatisfiedby(Collection<ClientlibLink> links) {
        for (ClientlibLink link : links) if (isSatisfiedby(link)) return true;
        return false;
    }
1208125
private static boolean isLink(Object data) {
    try {
      final Map<String, Object> map = (Map<String, Object>) data;
      final Map<String, Object> sys = (Map<String, Object>) map.get("sys");
      final String type = (String) sys.get("type");
      final String linkType = (String) sys.get("linkType");
      final String id = (String) sys.get("id");

      if ("Link".equals(type)
          && ("Entry".equals(linkType) || "Asset".equals(linkType)
          && id != null)) {
        return true;
      }
    } catch (ClassCastException cast) {
      return false;
    }
    return false;
  }
1372372
public boolean continueAfterUnprotectedURI(WebRequest webRequest) {

        if (taiServiceRef.getService() != null) {
            TAIService taiService = taiServiceRef.getService();
            if (!taiService.isContinueAfterUnprotectedURI() && taiService.isInvokeForUnprotectedURI() && webRequest.isUnprotectedURI()
                && !webRequest.isProviderSpecialUnprotectedURI()) {
                webRequest.setContinueAfterUnprotectedURI(false);
            } else {
                webRequest.setContinueAfterUnprotectedURI(true);
            }
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "continueAfterUnprotectedURI from configuration=" + taiService.isContinueAfterUnprotectedURI() +
                             " Caclulated value: isContinueAfterUnprotectedURI= " + webRequest.isContinueAfterUnprotectedURI());
            }
        }

        return webRequest.isContinueAfterUnprotectedURI();
    }
954821
public boolean endLink(final Object endVertex, final MouseEvent mouseEvent) {
        logger.debug("endLink({})", endVertex);
        boolean result = false;
        if (_startVertex != null && endVertex != null) {
            if (mouseEvent.getButton() == MouseEvent.BUTTON1) {
                final boolean created = createLink(_startVertex, endVertex, mouseEvent);
                if (created && _graphContext.getVisualizationViewer().isVisible()) {
                    _graphContext.getJobGraph().refresh();
                }
                result = true;
            }
        }
        stopDrawing();
        return result;
    }
560596
public static void if_keepAliveRequest_then_resumeReading_else_closeOnComplete(
            final HttpRequest request, final Channel channel, final ChannelFuture channelFuture
    ) {
        // TODO:
        // Add Connection: Close, or Keep-Alive?
        // res.headers().set(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE);
        if (HttpUtil.isKeepAlive(request)) {
            channelFuture.addListener(new ChannelFutureListener() {
                public void operationComplete(ChannelFuture future) {
                    resumeReading(channel);
                }
            });
        } else {
            channelFuture.addListener(ChannelFutureListener.CLOSE);
        }
    }
1186171
public static void endRequest() {
        final List<RequestScopedItem> result = CACHE.get();
        if (result != null) {
            CACHE.remove();
            for (final RequestScopedItem item : result) {
                item.invalidate();
            }
        }
    }
535263
@Override
    public boolean requestPermissionToFinishWrite() {
        boolean rc = true;
        synchronized (this) {
            if ((currentState & FINISH_NOT_ALLOWED_MASK) != 0) {
                rc = false;
            } else {
                currentState = (currentState | WRITE_FINISHING) & WRITE_FINISHING_CLEAR_OUT;
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "requestPermissionToFinishWrite returning " + rc);
        }
        return rc;
    }
133308
@SuppressWarnings("unused")
    public void complete(VirtualConnection vc, TCPWriteRequestContext wsc) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "complete() called for vc=" + vc);
        }
        HttpInboundLink link = (HttpInboundLink) vc.getStateMap().get(CallbackIDs.CALLBACK_HTTPICL);
        // we've written the 100 continue response, now we can call up to the
        // app channels above us

        // reset the values on the response message first
        link.getHTTPContext().resetMsgSentState();
        HttpResponseMessage msg = link.getHTTPContext().getResponse();
        msg.setStatusCode(StatusCodes.OK);
        msg.removeHeader(HttpHeaderKeys.HDR_CONTENT_LENGTH);
        link.handleDiscrimination();
    }
18738
@Override
    protected boolean performRequest() {

        boolean cancelledDone = false;
        // If we were worken up because we have work to do, do it.
        Set<SelectionKey> keySet = selector.selectedKeys();
        Iterator<SelectionKey> selectedIterator = keySet.iterator();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "performRequest - processing " + keySet.size() + " items");
        }
        while (selectedIterator.hasNext()) {
            SelectionKey selectedKey = selectedIterator.next();
            // safely remove key from set while looping
            selectedIterator.remove();
            ConnectInfo connectInfo = (ConnectInfo) selectedKey.attachment();
            connectInfo.setFinish();
            if (wqm.dispatchConnect(connectInfo)) {
                selectedKey.cancel();
                cancelledDone = true;
            }
        }
        return cancelledDone;
    }
702464
E unlinkLast() {
    final E l = last;
    final E prev = l.getPrevious();
    l.setPrevious(null);
    last = prev;
    if (prev == null) {
      first = null;
    } else {
      prev.setNext(null);
    }
    return l;
  }