Package com.ibm.sbt.services.endpoints

Examples of com.ibm.sbt.services.endpoints.Endpoint


    private PeopleData readPeopleData(PersonImpl person) throws ClientServicesException {
        if(!person.isAuthenticatedUser()){
            //should never happen as this should be guarded
            return null;
        }
        Endpoint ep = EndpointFactory.getEndpointUnchecked(EndpointFactory.SERVER_SMARTCLOUD);
        if(ep!=null) {
            if(ep.isAuthenticated()){
          // Find the SmartCloud id
          GenericService service = new GenericService(ep);
//                    service.get("/manage/oauth/getUserIdentity",null, "json");
//                   
          //TODO - Padraic
View Full Code Here


        UIFacebookClient.enableClient(rootEx, true);
       
        UIFacebookClient dialog = (UIFacebookClient)component;

        String endpoint = dialog.getEndpoint();
    Endpoint _bean = EndpointFactory.getEndpoint(endpoint, EndpointFactory.SERVER_FACEBOOK);
    if(!(_bean instanceof OAuthEndpoint)) {
        throw new FacesExceptionEx("The Facebook endpopint must be a OAuthEndPoint");
    }
    OAuthEndpoint bean = (OAuthEndpoint)_bean;
   
View Full Code Here

        String name = getEndpoint();
        String def = null;
        if(StringUtil.isEmpty(name)) {
            def = ((RestDataSource)getDataSource()).getDefaultEndpoint();
        }
        Endpoint ep =  EndpointFactory.getEndpoint(name, def);
        return ep;
    }
View Full Code Here

        // Find the Sametime Endpoint
        String endpointName = stClient.getEndpoint();
        if(StringUtil.isEmpty(endpointName)) {
            endpointName = EndpointFactory.SERVER_SAMETIME;
        }
        Endpoint stServer = EndpointFactory.getEndpointUnchecked(endpointName);
        if(stServer==null) {
            //Platform.getInstance().log("Sametime server URL is undefined.");
            return;
        }

        // Get the url of the Lotus Sametime proxy server
        String linkurl = stServer.getUrl();
        if(StringUtil.isEmpty(linkurl)) {
            //Platform.getInstance().log("Sametime server URL is undefined.");
            return;
        }   
        if(linkurl.endsWith("/")) {
View Full Code Here

         */
        @Override
        protected Block loadBlock(int index, int blockSize) {
            String statusUrl = getUrl();
            try {
                Endpoint provider = findEndpointBean();
                Map<String, String> params = getParameters(index, blockSize);
                List<TwitterEntry> entries = new ArrayList<TwitterEntry>();
                String svcUrl= getServiceUrl();
                if(StringUtil.isEmpty(hashTag)){
                    ClientService svc = createClientService(provider, svcUrl);
View Full Code Here

            String name = searchEndpoint;
            String def = null;
            if(StringUtil.isEmpty(name)) {
                def = ((TwitterDataSource)getDataSource()).getSearchEndpoint();
            }
            Endpoint ep =  EndpointFactory.getEndpoint(name, def);
            return ep;
        }
View Full Code Here

    return authenticated;
  }

  @Override
  public ClientService getClientService() throws ClientServicesException {
    Endpoint ep = endpoint != null ? endpoint : EndpointFactory
        .getEndpoint(innerEndpoint);
    if (StringUtil.isNotEmpty(this.getUrl()) && ep instanceof AbstractEndpoint) {
      ((AbstractEndpoint)ep).setUrl(this.getUrl());
    }
    if (ep instanceof BasicEndpoint) {
      if(StringUtil.isNotEmpty(this.getUser()))  ((BasicEndpoint)ep).setUser(this.getUser());
      if(StringUtil.isNotEmpty(this.getPassword())) ((BasicEndpoint)ep).setPassword(this.getPassword());
    }
    return new MockService(ep.getClientService(), mockMode);
  }
View Full Code Here

    NamedUrlPart[] serviceMappings = service.getServiceMappings();
    NamedUrlPart[] namedParts = Arrays.copyOf(args, args.length + 2 + serviceMappings.length);
    namedParts[args.length] = service.getAuthType();

    String isAuthenticated = "anonymous";
    Endpoint ep = service.getEndpoint();

    if(ep != null){
      try {
        if(ep.isAuthenticated()){
          isAuthenticated = "";
        }
      } catch (ClientServicesException e) {
        e.printStackTrace();
      }
View Full Code Here

   * @param user The username to authenticate with.
   * @param password The Password to authenticate with.
   * @return The Request Object.
   */
  public Request basicAuth(String user, String password) {
    Endpoint endpoint = baseService.getEndpoint();
    if (endpoint instanceof BasicEndpoint) {
      ((BasicEndpoint)endpoint).setUser(user);
      ((BasicEndpoint)endpoint).setPassword(password);
    } else {
      throw new IllegalStateException("The login method is only supported when using basic authentication.");
View Full Code Here

        // is an alias in use?
        if (endpointAlias == null) {
          endpointAlias = endpointName;
        }

        Endpoint theEndpoint = EndpointFactory.getEndpointUnchecked(endpointName);
        JsonObject jsonEndpoint = createJsonForEndpoint(request, theEndpoint, endpointAlias, endpointName);
        jsonEndpoints.put(endpointAlias, jsonEndpoint);
      }
    }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.endpoints.Endpoint

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.