Package com.ibm.sbt.services.client

Examples of com.ibm.sbt.services.client.ClientServicesException


  @Override
  public boolean isAuthenticated() throws ClientServicesException {
    try {
      return oAuthHandler.acquireToken() != null;
    } catch (OAuthException ex) {
      throw new ClientServicesException(ex);
    }
  }
View Full Code Here


  @Override
  public void authenticate(boolean force) throws ClientServicesException {
    try {
      oAuthHandler.acquireToken(true, force);
    } catch (OAuthException ex) {
      throw new ClientServicesException(ex);
    }
  }
View Full Code Here

      if ((token != null) && (oAuthHandler != null)) {
        HttpRequestInterceptor oauthInterceptor = new OAuthInterceptor(token, super.getUrl(),oAuthHandler);
        httpClient.addRequestInterceptor(oauthInterceptor, 0);
      }
    } catch (OAuthException ex) {
      throw new ClientServicesException(ex);
    }
  }
View Full Code Here

  protected <T extends BaseEntity> T getEntity(String url, Map<String, String> parameters, IFeedHandler<T> feedHandler) throws ClientServicesException {
    try {
      Response response = retrieveData(url, parameters);
      return feedHandler.createEntity(response);
    } catch (Exception e){
      throw new ClientServicesException(e);
    }
  }
View Full Code Here

  protected <T extends BaseEntity> EntityList<T> getEntities(String url, Map<String, String> parameters, IFeedHandler<T> feedHandler) throws ClientServicesException {
    try {
      Response dataHolder = retrieveData(url, parameters);
      return feedHandler.createEntityList(dataHolder);
    } catch (Exception e){
      throw new ClientServicesException(e);
    }
  }
View Full Code Here

    protected <T extends BaseEntity> EntityList<T> getEntities(String url, Map<String, String> parameters, Map<String, String> headers, IFeedHandler<T> feedHandler) throws ClientServicesException {
    try {
          Response dataHolder = retrieveData(url, parameters, headers, null);
          return feedHandler.createEntityList(dataHolder);
    } catch (Exception e){
      throw new ClientServicesException(e);
    }
    }
View Full Code Here

   protected void checkResponseCode(Response<?> response, HTTPCode expectedCode) throws ClientServicesException {
     if (response != null && response.getResponse() != null && response.getRequest()!=null) {
       if (response.getResponse().getStatusLine() != null && expectedCode.checkCode(response.getResponse().getStatusLine().getStatusCode())) {
         return;
       } else {
         throw new ClientServicesException(response.getResponse(), response.getRequest());
       }
     } else {
       throw new ClientServicesException(null, "Response is null");
     }
   }
View Full Code Here

    try {
      return getEntity(requestUrl, parameters, getAtomFeedHandler(false));
    } catch (ClientServicesException e) {
      throw e;
    } catch (Exception e) {
      throw new ClientServicesException(e);
    }
  }
View Full Code Here

          // set endpoint
          clientService.setEndpoint(this);

          return clientService;
       } catch(Exception ex) {
          throw new ClientServicesException(ex,"Cannot create ClientService class {0}",cls);
        }
      }
      return new GenericService(this);
    }
View Full Code Here

                    authPage = PathUtil.concat(authPage,"redirectURL",'&');
                    authPage = PathUtil.concat(authPage,redirectUrl,'=');
                    context.sendRedirect(authPage);
                     
                } catch (IOException e) {
                  throw new ClientServicesException(e,"LTPA token refresh failed because: "+e.getMessage());
                }
              } else {
                throw new ClientServicesException(null,"LTPA token expired or invalid. Cannot refresh: authentication page is not set");
              }
          }
    }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.client.ClientServicesException

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.