Package railo.runtime.net.proxy

Examples of railo.runtime.net.proxy.ProxyData


        if(StringUtil.isEmpty(strCharset))strCharset="iso-8859-1";
        URL url = HTTPUtil.toURL(src,true);
     
      // set Proxy
      if(StringUtil.isEmpty(proxyserver) && config.isProxyEnableFor(url.getHost())) {
        ProxyData pd = config.getProxyData();
        proxyserver=pd==null?null:pd.getServer();
        proxyport=pd==null?0:pd.getPort();
        proxyuser=pd==null?null:pd.getUsername();
        proxypassword=pd==null?null:pd.getPassword();
      }
     
      HTTPResponse method = HTTPEngine.get(url, authUser, authPassword, -1,HTTPEngine.MAX_REDIRECT, null, userAgent,
          ProxyDataImpl.getInstance(proxyserver, proxyport, proxyuser, proxypassword),null);
     
View Full Code Here


    }
 
  // set Proxy
    if(StringUtil.isEmpty(http.proxyserver) && http.pageContext.getConfig().isProxyEnableFor(_url.getHost())) {

      ProxyData pd = http.pageContext.getConfig().getProxyData();
      http.proxyserver=pd==null?null:pd.getServer();
      http.proxyport=pd==null?0:pd.getPort();
      http.proxyuser=pd==null?null:pd.getUsername();
      http.proxypassword=pd==null?null:pd.getPassword();
    }
    if(!StringUtil.isEmpty(http.proxyserver)) {
            config.setProxy(http.proxyserver,http.proxyport);
            if(!StringUtil.isEmpty(http.proxyuser)) {
                state.setProxyCredentials(null,null,new UsernamePasswordCredentials(http.proxyuser,http.proxypassword));
View Full Code Here

          }
          else httpContext=HTTPEngine4Impl.setCredentials(client, httpHost, this.username, this.password,preauth);
        }
     
      // set Proxy
        ProxyData proxy=null;
        if(!StringUtil.isEmpty(this.proxyserver)) {
          proxy=ProxyDataImpl.getInstance(this.proxyserver, this.proxyport, this.proxyuser, this.proxypassword) ;
        }
        if(pageContext.getConfig().isProxyEnableFor(host)) {
          proxy=pageContext.getConfig().getProxyData();
View Full Code Here

          pass=credentials.getPassword();
            //get.addRequestHeader("Authorization","Basic admin:spwwn1p");
        }
       
        // Proxy
        ProxyData proxy=task.getProxyData();
        if(!ProxyDataImpl.isValid(proxy) && config.isProxyEnableFor(task.getUrl().getHost())) {
          proxy=config.getProxyData();
        }
       
        HTTPResponse rsp=null;
View Full Code Here

        su.setString(el,"url",task.getUrl().toExternalForm());
        su.setInt(el,"port",task.getUrl().getPort());
        su.setString(el,"interval",task.getIntervalAsString());
        su.setInt(el,"timeout",(int)task.getTimeout());
        su.setCredentials(el,"username","password",task.getCredentials());
        ProxyData pd = task.getProxyData();
        su.setString(el,"proxyHost",StringUtil.emptyIfNull(pd==null?"":pd.getServer()));
        su.setString(el,"proxyUser",StringUtil.emptyIfNull(pd==null?"":pd.getUsername()));
        su.setString(el,"proxyPassword",StringUtil.emptyIfNull(pd==null?"":pd.getPassword()));
        su.setInt(el,"proxyPort",pd==null?0:pd.getPort());
        su.setBoolean(el,"resolveUrl",task.isResolveURL())
        su.setBoolean(el,"publish",task.isPublish());  
        su.setBoolean(el,"hidden",((ScheduleTaskImpl)task).isHidden())
        su.setBoolean(el,"readonly",((ScheduleTaskImpl)task).isReadonly())
        su.setBoolean(el,"autoDelete",((ScheduleTaskImpl)task).isAutoDelete())
View Full Code Here

              query.setAt("valid",row,Caster.toString(task.isValid()));
              if(task.hasCredentials()) {
                  query.setAt("username",row,task.getCredentials().getUsername());
                  query.setAt("password",row,task.getCredentials().getPassword());
              }
              ProxyData pd = task.getProxyData();
              if(ProxyDataImpl.isValid(pd)){
                query.setAt("proxyserver",row,pd.getServer());
                if(pd.getPort()>0)query.setAt("proxyport",row,Caster.toString(pd.getPort()));
                if(ProxyDataImpl.hasCredentials(pd)) {
                    query.setAt("proxyuser",row,pd.getUsername());
                    query.setAt("proxypassword",row,pd.getPassword());
                }
              }
              query.setAt("resolveurl",row,Caster.toString(task.isResolveURL()));

              query.setAt("paused",row,Caster.toBoolean(task.isPaused()));
View Full Code Here

   */
  private void doWebService(String webservice) throws PageException {
        if(username!=null)   {
            if(password==null)password = "";
        }
        ProxyData pd=StringUtil.isEmpty(proxy.getServer())?null:proxy;
        RPCClient ws = username!=null?new RPCClient(webservice,username,password,pd):new RPCClient(webservice,pd);
        Object rtn = ws.callWithNamedValues(pageContext,method,data);
       
        // return
        if(!StringUtil.isEmpty(returnvariable)) pageContext.setVariable(returnvariable,rtn);
View Full Code Here

  }
   
    private void doGetProxy() throws PageException  {
        Struct sct=new StructImpl();
        pageContext.setVariable(getString("admin",action,"returnVariable"),sct);
        ProxyData pd = config.getProxyData();
        String port=pd==null || pd.getPort()<=0?"":Caster.toString(pd.getPort());
       
        //sct.set("enabled",Caster.toBoolean(config.isProxyEnable()));
        sct.set("port",port);
        sct.set("server",pd==null?"":emptyIfNull(pd.getServer()));
        sct.set("username",pd==null?"":emptyIfNull(pd.getUsername()));
        sct.set("password",pd==null?"":emptyIfNull(pd.getPassword()));
    }
View Full Code Here

  private HTTPResponse getHTTPResponse(boolean create) throws IOException {
    if(create || http==null) {
      //URL url = HTTPUtil.toURL("http://"+data.host+":"+data.port+"/"+data.path);
      URL url = new URL(provider.getProtocol(),data.host,data.port,data.path);
      // TODO Support for proxy
      ProxyData pd=data.hasProxyData()?data.proxyData:ProxyDataImpl.NO_PROXY;
       
      http = HTTPEngine.get(url, data.username, data.password, _getTimeout(),HTTPEngine.MAX_REDIRECT,null, data.userAgent,
          pd,
          null);
    }
View Full Code Here

  }

  private int getStatusCode() throws IOException {
    if(http==null) {
      URL url = new URL(provider.getProtocol(),data.host,data.port,data.path);
      ProxyData pd=data.hasProxyData()?data.proxyData:ProxyDataImpl.NO_PROXY;
      return HTTPEngine.head(url, data.username, data.password, _getTimeout(),HTTPEngine.MAX_REDIRECT,
          null, data.userAgent,
          pd,
          null).getStatusCode();
    }
View Full Code Here

TOP

Related Classes of railo.runtime.net.proxy.ProxyData

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.