View Javadoc
1   /*
2    * Licensed under the GPL License. You may not use this file except in compliance with the License.
3    * You may obtain a copy of the License at
4    *
5    *   https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
6    *
7    * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
8    * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
9    * PURPOSE.
10   */
11  package psiprobe.model.jsp;
12  
13  import java.io.Serializable;
14  import java.sql.Timestamp;
15  import java.util.Date;
16  
17  /**
18   * The Class Item.
19   */
20  public class Item implements Serializable {
21  
22    /** The Constant serialVersionUID. */
23    private static final long serialVersionUID = 1L;
24  
25    /** Item is Out Of Date and requires recompilation. */
26    public static final int STATE_OOD = 1;
27  
28    /** Item is compiled and ready to use. */
29    public static final int STATE_READY = 2;
30  
31    /** Item failed to compile. */
32    public static final int STATE_FAILED = 3;
33  
34    /** The name. */
35    private String name;
36  
37    /** The exception. */
38    private Exception exception;
39  
40    /** The compile time. */
41    private long compileTime = -1;
42  
43    /** The state. */
44    private int state = STATE_OOD;
45  
46    /** The level. */
47    private int level;
48  
49    /** The missing. */
50    private boolean missing = true;
51  
52    /** The size. */
53    private long size;
54  
55    /** The last modified. */
56    private long lastModified;
57  
58    /** The timestamp. */
59    private Date timestamp;
60  
61    /** The encoding. */
62    private String encoding;
63  
64    /**
65     * Gets the name.
66     *
67     * @return the name
68     */
69    public String getName() {
70      return name;
71    }
72  
73    /**
74     * Sets the name.
75     *
76     * @param name the new name
77     */
78    public void setName(String name) {
79      this.name = name;
80    }
81  
82    /**
83     * Gets the exception.
84     *
85     * @return the exception
86     */
87    public Exception getException() {
88      return exception;
89    }
90  
91    /**
92     * Sets the exception.
93     *
94     * @param exception the new exception
95     */
96    public void setException(Exception exception) {
97      this.exception = exception;
98    }
99  
100   /**
101    * Gets the compile time.
102    *
103    * @return the compile time
104    */
105   public long getCompileTime() {
106     return compileTime;
107   }
108 
109   /**
110    * Sets the compile time.
111    *
112    * @param compileTime the new compile time
113    */
114   public void setCompileTime(long compileTime) {
115     this.compileTime = compileTime;
116   }
117 
118   /**
119    * Gets the state.
120    *
121    * @return the state
122    */
123   public int getState() {
124     return state;
125   }
126 
127   /**
128    * Sets the state.
129    *
130    * @param state the new state
131    */
132   public void setState(int state) {
133     this.state = state;
134   }
135 
136   /**
137    * Gets the level.
138    *
139    * @return the level
140    */
141   public int getLevel() {
142     return level;
143   }
144 
145   /**
146    * Sets the level.
147    *
148    * @param level the new level
149    */
150   public void setLevel(int level) {
151     this.level = level;
152   }
153 
154   /**
155    * Checks if is missing.
156    *
157    * @return true, if is missing
158    */
159   public boolean isMissing() {
160     return missing;
161   }
162 
163   /**
164    * Sets the missing.
165    *
166    * @param missing the new missing
167    */
168   public void setMissing(boolean missing) {
169     this.missing = missing;
170   }
171 
172   /**
173    * Gets the size.
174    *
175    * @return the size
176    */
177   public long getSize() {
178     return size;
179   }
180 
181   /**
182    * Sets the size.
183    *
184    * @param size the new size
185    */
186   public void setSize(long size) {
187     this.size = size;
188   }
189 
190   /**
191    * Gets the last modified.
192    *
193    * @return the last modified
194    */
195   public long getLastModified() {
196     return lastModified;
197   }
198 
199   /**
200    * Sets the last modified.
201    *
202    * @param lastModified the new last modified
203    */
204   public void setLastModified(long lastModified) {
205     this.lastModified = lastModified;
206     this.timestamp = new Timestamp(lastModified);
207   }
208 
209   /**
210    * Gets the timestamp.
211    *
212    * @return the timestamp
213    */
214   public Date getTimestamp() {
215     return timestamp == null ? null : new Date(timestamp.getTime());
216   }
217 
218   /**
219    * Gets the encoding.
220    *
221    * @return the encoding
222    */
223   public String getEncoding() {
224     return encoding;
225   }
226 
227   /**
228    * Sets the encoding.
229    *
230    * @param encoding the new encoding
231    */
232   public void setEncoding(String encoding) {
233     this.encoding = encoding;
234   }
235 
236 }