001    package railo.runtime.net.s3;
002    
003    import railo.commons.io.res.type.s3.S3;
004    import railo.commons.io.res.type.s3.S3Constants;
005    import railo.runtime.type.Struct;
006    import railo.runtime.type.StructImpl;
007    
008    
009    public final class PropertiesImpl implements Properties {
010            private String accessKeyId;
011            private String secretAccessKey;
012            private int defaultLocation=S3Constants.STORAGE_UNKNOW;
013            private String host=S3.HOST;
014            
015            
016    
017            public Struct toStruct() {
018                    Struct sct=new StructImpl();
019    
020                    sct.setEL("accessKeyId", accessKeyId);
021                    sct.setEL("awsSecretKey", accessKeyId);
022                    sct.setEL("defaultLocation", S3.toStringStorage(defaultLocation,""));
023                    sct.setEL("host", host);
024                    
025                    
026                    return sct;
027            }
028            
029            /**
030             * @return the accessKeyId
031             */
032            public String getAccessKeyId() {
033                    return accessKeyId;
034            }
035            /**
036             * @return the host
037             */
038            public String getHost() {
039                    return host;
040            }
041            /**
042             * @param host the host to set
043             */
044            public void setHost(String host) {
045                    this.host = host;
046            }
047            /**
048             * @return the defaultLocation
049             */
050            public int getDefaultLocation() {
051                    return defaultLocation;
052            }
053            /**
054             * @param defaultLocation the defaultLocation to set
055             */
056            public void setDefaultLocation(String defaultLocation) {
057                    this.defaultLocation = S3.toIntStorage(defaultLocation,S3Constants.STORAGE_UNKNOW);
058            }
059            /**
060             * @param accessKeyId the accessKeyId to set
061             */
062            public void setAccessKeyId(String accessKeyId) {
063                    this.accessKeyId = accessKeyId;
064            }
065            /**
066             * @return the secretAccessKey
067             */
068            public String getSecretAccessKey() {
069                    return secretAccessKey;
070            }
071            /**
072             * @param secretAccessKey the secretAccessKey to set
073             */
074            public void setSecretAccessKey(String secretAccessKey) {
075                    this.secretAccessKey = secretAccessKey;
076            }
077            
078            @Override
079            public String toString(){
080                    return "accessKeyId:"+accessKeyId+";defaultLocation:"+defaultLocation+";host:"+host+";secretAccessKey:"+secretAccessKey;
081            }
082    }