Package railo.runtime.net.proxy

Examples of railo.runtime.net.proxy.ProxyData


  }

  public ContentType getContentType() 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).getContentType();
    }
View Full Code Here


      String pUrl = client.getAttribute("proxy-server");
      int pPort = Caster.toIntValue(client.getAttribute("proxy-port"), -1);
      String pUser = client.getAttribute("proxy-username");
      String pPass = ConfigWebFactory.decrypt(client.getAttribute("proxy-password"));

      ProxyData pd = null;
      if (!StringUtil.isEmpty(pUrl, true)) {
        pd = new ProxyDataImpl();
        pd.setServer(pUrl);
        if (!StringUtil.isEmpty(pUser)) {
          pd.setUsername(pUser);
          pd.setPassword(pPass);
        }
        if (pPort > 0)
          pd.setPort(pPort);
      }
      list.add(new RemoteClientImpl(label, type, url, sUser, sPass, aPass, pd, aCode, usage));
    }
    if (list.size() > 0)
      config.setRemoteClients(list.toArray(new RemoteClient[list.size()]));
View Full Code Here

      // SNSN
      /*SerialNumber sn = config.getSerialNumber();
        if(sn.getVersion()==SerialNumber.VERSION_COMMUNITY)
            throw new SecurityException("can not verify remote client with "+sn.getStringVersion()+" version of railo");
      */
      ProxyData pd=null;
      String proxyServer=getString("proxyServer",null);
      if(!StringUtil.isEmpty(proxyServer)) {
        String proxyUsername=getString("proxyUsername",null);
        String proxyPassword=getString("proxyPassword",null);
        int proxyPort = getInt("proxyPort",-1);
        pd=new ProxyDataImpl();
          pd.setServer(proxyServer);
          if(!StringUtil.isEmpty(proxyUsername))pd.setUsername(proxyUsername);
          if(!StringUtil.isEmpty(proxyPassword))pd.setPassword(proxyPassword);
          if(proxyPort!=-1)pd.setPort(proxyPort);
     
      RemoteClient client = new RemoteClientImpl(
          getString("admin",action,"label"),
          type==TYPE_WEB?"web":"server",
          getString("admin",action,"url"),
View Full Code Here

        for(int i=0;i<clients.length;i++) {
          client=clients[i];
           
            if(client.getUrl().equalsIgnoreCase(url)) {
                Struct sct=new StructImpl();
                ProxyData pd = client.getProxyData();
                sct.setEL("label",client.getLabel());
                sct.setEL("usage",client.getUsage());
                sct.setEL("securityKey",client.getSecurityKey());
                sct.setEL("adminPassword",client.getAdminPassword());
                sct.setEL("ServerUsername",client.getServerUsername());
                sct.setEL("ServerPassword",client.getServerPassword());
                sct.setEL("type",client.getType());
                sct.setEL("url",client.getUrl());
                sct.setEL("proxyServer",pd==null?"":StringUtil.emptyIfNull(pd.getServer()));
                sct.setEL("proxyUsername",pd==null?"":StringUtil.emptyIfNull(pd.getUsername()));
                sct.setEL("proxyPassword",pd==null?"":StringUtil.emptyIfNull(pd.getPassword()));
                sct.setEL("proxyPort",pd==null?"":(pd.getPort()==-1?"":Caster.toString(pd.getPort())));
               
               
                pageContext.setVariable(getString("admin",action,"returnVariable"),sct);
                return;
            }
View Full Code Here

  }

  private void doGetRemoteClients() throws PageException {
        RemoteClient[] clients = config.getRemoteClients();
        RemoteClient client;
        ProxyData pd;
        railo.runtime.type.Query qry=new QueryImpl(new String[]{"label","usage","securityKey","adminPassword","serverUsername","serverPassword","type","url",
            "proxyServer","proxyUsername","proxyPassword","proxyPort"},clients.length,"query");
       
        int row=0;

        for(int i=0;i<clients.length;i++) {
            client=clients[i];
            pd=client.getProxyData();
            row=i+1;
            qry.setAt("label",row,client.getLabel());
            qry.setAt("usage",row,client.getUsage());
            qry.setAt("securityKey",row,client.getSecurityKey());
            qry.setAt("adminPassword",row,client.getAdminPassword());
            qry.setAt("ServerUsername",row,client.getServerUsername());
            qry.setAt("ServerPassword",row,client.getServerPassword());
            qry.setAt("type",row,client.getType());
            qry.setAt("url",row,client.getUrl());
            qry.setAt("proxyServer",row,pd==null?"":pd.getServer());
            qry.setAt("proxyUsername",row,pd==null?"":pd.getUsername());
            qry.setAt("proxyPassword",row,pd==null?"":pd.getPassword());
            qry.setAt("proxyPort",row,pd==null?"":Caster.toString(pd.getPort()));
           
        }
        pageContext.setVariable(getString("admin",action,"returnVariable"),qry);
    }
View Full Code Here

  @Override
  public int doStartTag() throws PageException {
    if(source instanceof HTTPResource) {
      HTTPResource httpSource = (HTTPResource)source;
      if(!StringUtil.isEmpty(proxyServer,true)){
        ProxyData data=new ProxyDataImpl(proxyServer,proxyPort,proxyUser,proxyPassword);
        httpSource.setProxyData(data);
      }
      if(!StringUtil.isEmpty(userAgent))
        httpSource.setUserAgent(userAgent);
      if(timeout>-1)httpSource.setTimeout(timeout*1000);
 
View Full Code Here

            pageContext.setVariable(name,CreateObject.doCOM(pageContext,clazz));
        }
        else if(type.equals("webservice")) {
            checkAccess(pageContext,type);
            checkWebservice();
            ProxyData proxy=null;
            if(proxyServer!=null){
              proxy=new ProxyDataImpl(proxyServer,proxyPort,proxyUser,proxyPassword);
            }
            pageContext.setVariable(name,CreateObject.doWebService(pageContext,webservice,username,password,proxy));
        }
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.