001    package railo.runtime.net.proxy;
002    
003    import railo.commons.lang.StringUtil;
004    
005    public class ProxyDataImpl implements ProxyData {
006            
007            public static final ProxyData NO_PROXY = new ProxyDataImpl();
008            
009            private String server;
010            private int port=-1;
011            private String username;
012            private String password;
013            
014    
015            public ProxyDataImpl(String server, int port, String username, String password) {
016                    if(!StringUtil.isEmpty(server,true))this.server = server;
017                    if(port>0)this.port = port;
018                    if(!StringUtil.isEmpty(username,true))this.username = username;
019                    if(!StringUtil.isEmpty(password,true))this.password = password;
020            }
021            public ProxyDataImpl() {}
022    
023            public void release() {
024                    server=null;
025                    port=-1;
026                    username=null;
027                    password=null;
028            }
029            
030            /**
031             * @return the password
032             */
033            public String getPassword() {
034                    return password;
035            }
036            /**
037             * @param password the password to set
038             */
039            public void setPassword(String password) {
040                    this.password = password;
041            }
042            /**
043             * @return the port
044             */
045            public int getPort() {
046                    return port;
047            }
048            /**
049             * @param port the port to set
050             */
051            public void setPort(int port) {
052                    this.port = port;
053            }
054            /**
055             * @return the server
056             */
057            public String getServer() {
058                    return server;
059            }
060            /**
061             * @param server the server to set
062             */
063            public void setServer(String server) {
064                    this.server = server;
065            }
066            /**
067             * @return the username
068             */
069            public String getUsername() {
070                    return username;
071            }
072            /**
073             * @param username the username to set
074             */
075            public void setUsername(String username) {
076                    this.username = username;
077            }
078    }