Package com.ibm.sbt.services.endpoints

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


      throws ServletException, IOException {                                                                                                               
           String endpointName = request.getParameter(AbstractType.PARAM_ENDPOINT_NAME);                                                      
           if (StringUtil.isEmpty(endpointName)) {                                                                               
               endpointName = TYPE;                                                                                              
           }                                                                                                                     
           Endpoint bean = (Endpoint) ManagedBeanUtil.getBean(FacesContext.getCurrentInstance(), endpointName);                  
                                                                                                                                 
           if (bean == null) {                                                                                                   
               throw new ServletException("AuthorizationBean not found in application scope");                                   
           }                                                                                                                     
                                                                                                                                 
View Full Code Here


        try {
            String endpointName = request.getParameter(AbstractType.PARAM_ENDPOINT_NAME);
            if(StringUtil.isEmpty(endpointName)){
                endpointName = TYPE;
            }
            Endpoint bean = EndpointFactory.getEndpoint(endpointName);

            if (bean == null) {
                throw new ServletException("AuthorizationBean not found in application scope");
            }
View Full Code Here

    if (pathInfo.length() <= len) {
      ServiceServlet.service500(req, resp, "Empty endpoint name");
      return;
    }
    String epName = pathInfo.substring(len);
    Endpoint ep = EndpointFactory.getEndpoint(epName);
    if (ep == null) {
      ServiceServlet.service500(req, resp, "Cannot find endpoint {0}", epName);
      return;
    }

    try {
      // If the endpoint is not authenticated, then authenticate
      // else redirect the main page
      if (!ep.isAuthenticationValid()) {
        ep.authenticate(true);
      } else {
        generateCloseScript(req, resp);
      }
    } catch (ClientServicesException ex) {
      throw new ServletException(ex);
View Full Code Here

  }
 
  static public int getCommunityMembershipCount(String user) {
    int ret = -1;
    try {
      Endpoint endpoint = createEndpoint(user);
      if (endpoint != null) {
        CommunityService service = new CommunityService(endpoint);
     
        EntityList<Community> list = service.getMyCommunities();
        return list.getTotalResults();
View Full Code Here

    }
    return ret;
  }
 
  static private Endpoint createEndpoint(String user) throws ClientServicesException {
    Endpoint endpoint = getEndpoint("connections");
    if (endpoint instanceof SmartCloudOAuthEndpoint) {
      SmartCloudOAuthEndpoint smartcloud = (SmartCloudOAuthEndpoint)endpoint;
      SmartCloudOAuthEndpoint cloned = new SmartCloudOAuthEndpoint();
      cloned.setApiVersion(smartcloud.getApiVersion());
      cloned.setUrl(smartcloud.getUrl());
View Full Code Here

 
  /*
   * Return the service name to use.
   */
  static private String getServiceName() {
    Endpoint endpoint = getEndpoint("connecitons");
    if (endpoint instanceof OAuth2Endpoint) {
      return ((OAuth2Endpoint)endpoint).getServiceName();
    }
    if (endpoint instanceof OAuthEndpoint) {
      return ((OAuthEndpoint)endpoint).getServiceName();
View Full Code Here

import com.ibm.sbt.services.endpoints.EndpointFactory;

public class Util {

    public static String getThemeUrl() {
      Endpoint endpoint = EndpointFactory.getEndpoint("smartcloud");
      return endpoint.getUrl() + "/theming/theme/css/3";
     
    }
View Full Code Here

      return endpoint.getUrl() + "/theming/theme/css/3";
     
    }
 
    public static String getNavBarUrl() {
      Endpoint endpoint = EndpointFactory.getEndpoint("smartcloud");
      return endpoint.getUrl() + "/manage/navbar/banner/smartcloudExt?oneui=3";
    }
View Full Code Here

 
  // For gadgets, the runtime platform is *not* enough, but it also needs to use one of the OAuth
  // endpoints. So we have to check that the Endpoint is actually an OAuth endpoint
  @Override
  protected boolean runtimeExists(PlaygroundEnvironment env, String name) {
    Endpoint ep = EndpointFactory.getEndpointUnchecked(name);
    if(ep!=null) {
      try {
        // Check if the endpoint is valid and return true if so.
        ep.checkValid();
        return true;
      } catch(Exception ex) {}
      return false;
    }
    return super.runtimeExists(env, name);
View Full Code Here

    }
    return data;
  }
 
    private ProfilesData readPeopleData(PersonImpl person) {
        Endpoint ep = EndpointFactory.getEndpointUnchecked(EndpointFactory.SERVER_CONNECTIONS);
        if(ep!=null) {
            try {
                //String id = person.getId();
                boolean currentUser = person.isViewer();
               
                // Find the Connections id
                String lcid = person.getIdentity(IdentityMapper.TARGET_CONNECTIONS);
               
                // If the id is not available, then look at the end point to get the current id
                boolean privateData = false;

                // If it is the current user, then find the user uuis
                if(lcid==null && currentUser) {
                    // Be sure that we are authenticated for Connections
                    if(!ep.isAuthenticated()) {
                        ep.authenticate(true);
                    }
                    try {
//                        ConnectionsService svc = new ConnectionsService(ep,"/profiles/atom/profileService.do");
                      ConnectionsService svc = new ConnectionsService(ep);
                      HandlerXml xml = new HandlerXml();
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.