001    package org.apache.archiva.web.model;
002    /*
003     * Licensed to the Apache Software Foundation (ASF) under one
004     * or more contributor license agreements.  See the NOTICE file
005     * distributed with this work for additional information
006     * regarding copyright ownership.  The ASF licenses this file
007     * to you under the Apache License, Version 2.0 (the
008     * "License"); you may not use this file except in compliance
009     * with the License.  You may obtain a copy of the License at
010     *
011     *   http://www.apache.org/licenses/LICENSE-2.0
012     *
013     * Unless required by applicable law or agreed to in writing,
014     * software distributed under the License is distributed on an
015     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016     * KIND, either express or implied.  See the License for the
017     * specific language governing permissions and limitations
018     * under the License.
019     */
020    
021    import javax.xml.bind.annotation.XmlRootElement;
022    import java.io.Serializable;
023    import java.util.Calendar;
024    
025    /**
026     * @author Olivier Lamy
027     * @since 1.4-M3
028     */
029    @XmlRootElement(name = "applicationRuntimeInfo")
030    public class ApplicationRuntimeInfo
031        implements Serializable
032    {
033        private boolean devMode = false;
034    
035        private boolean javascriptLog = false;
036    
037        private String version;
038    
039        private String buildNumber;
040    
041        private long timestamp;
042    
043        private String copyrightRange;
044    
045        private boolean logMissingI18n;
046    
047        private String baseUrl;
048    
049        private String timestampStr;
050    
051        private CookieInformation cookieInformation;
052    
053        public ApplicationRuntimeInfo()
054        {
055            this.devMode = Boolean.getBoolean( "archiva.devMode" );
056    
057            this.javascriptLog = Boolean.getBoolean( "archiva.javascriptLog" );
058    
059            this.logMissingI18n = Boolean.getBoolean( "archiva.logMissingI18n" );
060    
061            this.copyrightRange = "2005 - " + Calendar.getInstance().get( Calendar.YEAR );
062        }
063    
064        public boolean isDevMode()
065        {
066            return devMode;
067        }
068    
069        public void setDevMode( boolean devMode )
070        {
071            this.devMode = devMode;
072        }
073    
074        public boolean isJavascriptLog()
075        {
076            return javascriptLog;
077        }
078    
079        public void setJavascriptLog( boolean javascriptLog )
080        {
081            this.javascriptLog = javascriptLog;
082        }
083    
084        public String getVersion()
085        {
086            return version;
087        }
088    
089        public void setVersion( String version )
090        {
091            this.version = version;
092        }
093    
094        public String getBuildNumber()
095        {
096            return buildNumber;
097        }
098    
099        public void setBuildNumber( String buildNumber )
100        {
101            this.buildNumber = buildNumber;
102        }
103    
104        public long getTimestamp()
105        {
106            return timestamp;
107        }
108    
109        public void setTimestamp( long timestamp )
110        {
111            this.timestamp = timestamp;
112        }
113    
114        public String getCopyrightRange()
115        {
116            return copyrightRange;
117        }
118    
119        public void setCopyrightRange( String copyrightRange )
120        {
121            this.copyrightRange = copyrightRange;
122        }
123    
124        public boolean isLogMissingI18n()
125        {
126            return logMissingI18n;
127        }
128    
129        public void setLogMissingI18n( boolean logMissingI18n )
130        {
131            this.logMissingI18n = logMissingI18n;
132        }
133    
134        public String getBaseUrl()
135        {
136            return baseUrl;
137        }
138    
139        public void setBaseUrl( String baseUrl )
140        {
141            this.baseUrl = baseUrl;
142        }
143    
144        public String getTimestampStr()
145        {
146            return timestampStr;
147        }
148    
149        public void setTimestampStr( String timestampStr )
150        {
151            this.timestampStr = timestampStr;
152        }
153    
154        public CookieInformation getCookieInformation()
155        {
156            return cookieInformation;
157        }
158    
159        public void setCookieInformation( CookieInformation cookieInformation )
160        {
161            this.cookieInformation = cookieInformation;
162        }
163    
164        @Override
165        public String toString()
166        {
167            final StringBuilder sb = new StringBuilder();
168            sb.append( "ApplicationRuntimeInfo" );
169            sb.append( "{devMode=" ).append( devMode );
170            sb.append( ", javascriptLog=" ).append( javascriptLog );
171            sb.append( ", version='" ).append( version ).append( '\'' );
172            sb.append( ", buildNumber='" ).append( buildNumber ).append( '\'' );
173            sb.append( ", timestamp=" ).append( timestamp );
174            sb.append( ", copyrightRange='" ).append( copyrightRange ).append( '\'' );
175            sb.append( ", logMissingI18n=" ).append( logMissingI18n );
176            sb.append( ", baseUrl='" ).append( baseUrl ).append( '\'' );
177            sb.append( ", timestampStr='" ).append( timestampStr ).append( '\'' );
178            sb.append( ", cookieInformation=" ).append( cookieInformation );
179            sb.append( '}' );
180            return sb.toString();
181        }
182    }