Package com.ibm.sbt.service.proxy

Examples of com.ibm.sbt.service.proxy.Proxy


      // Calling app has provided the complete url, do not do url manipulation in clientservice
      b.append(args.getServiceUrl());
    }
   
    if(endpoint!=null) { // The endpoint can be null
      Proxy proxy = null;
      try {
        proxy = ProxyFactory.getProxyConfig(endpoint.getProxyConfig());
      } catch (ProxyConfigException e) {
        if (logger.isLoggable(Level.FINE)) {
          String msg = "Exception ocurred while fetching proxy information : composeRequestUrl";
          logger.log(Level.FINE, msg, e);
        }
      }
      StringBuilder proxyUrl = new StringBuilder(proxy.rewriteUrl(b.toString()));
      addUrlParameters(proxyUrl, args);
      return proxyUrl.toString();
    }
    return b.toString();
  }
View Full Code Here


     * @see com.ibm.sbt.services.endpoints.Endpoint#getProxy(java.lang.String, java.lang.String)
     */
    @Override
    public JSReference getProxy(String endpointName, String moduleId) {
      String proxyModuleId = moduleId;
      Proxy proxy = null;
     
      if(this.getProxyConfig() != null){
        try {
          proxy = ProxyFactory.getProxyConfig(this.getProxyConfig());
          if(proxy != null && proxy.getProxyModule() != null){
            proxyModuleId = proxy.getProxyModule();
          }
        } catch (ProxyConfigException ex) {
          Logger logger = Logger.getLogger(AbstractEndpoint.class.getName());
          if (logger.isLoggable(Level.SEVERE)) {
            logger.severe(ex.getMessage());
View Full Code Here

  protected JsonReference createProxyRef(LibraryRequest request, Endpoint endpoint, String logicalName)
      throws LibraryException {
   
    // If a proxy config has been defined explicitly for the endpoint use it
    if(endpoint.getProxyConfig()!=null){
      Proxy proxy;
      try {
        proxy = ProxyFactory.getProxyConfig(endpoint.getProxyConfig());
        String proxyUrl = proxy.getProxyUrl();
        if(!(UrlUtil.isAbsoluteUrl(proxyUrl))){ // if proxy url specified in proxy config is relative, assume server same as of SBT
          // Url is relative, append server to it
          proxyUrl = UrlUtil.makeUrlAbsolute(request.getHttpRequest(),proxyUrl);
        }
        proxyUrl = addMakeAbsoluteUrl(proxyUrl).getRef();
        String proxyClass = proxy.getProxyModule();
        return new JsonReference("new "+proxyClass+"({proxyUrl:" + proxyUrl + "})");
      } catch (ProxyConfigException e) {
        if (logger.isLoggable(Level.SEVERE)) {
          logger.entering(sourceClass, "createProxyRef failed", e.getMessage());
        }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.service.proxy.Proxy

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.