Package co.cask.cdap.security.authentication.client

Examples of co.cask.cdap.security.authentication.client.AccessToken


  public void getEvents(String streamId, long startTime, long endTime, int limit,
                        Function<? super StreamEvent, Boolean> callback) throws IOException, StreamNotFoundException {
    URL url = config.resolveURL(String.format("streams/%s/events?start=%d&end=%d&limit=%d",
                                              streamId, startTime, endTime, limit));
    HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
    AccessToken accessToken = config.getAccessToken();
    if (accessToken != null) {
      urlConn.setRequestProperty(HttpHeaders.AUTHORIZATION, accessToken.getTokenType() + " " + accessToken.getValue());
    }

    if (urlConn instanceof HttpsURLConnection && !config.getDefaultConfig().isVerifySSLCert()) {
      try {
        HttpRequests.disableCertCheck((HttpsURLConnection) urlConn);
View Full Code Here

TOP

Related Classes of co.cask.cdap.security.authentication.client.AccessToken

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.