KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > controllers > kernel > impl > simple > UpdateListHandler


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  */

23
24 /*
25  * Created on 2003-apr-06
26  *
27  */

28 package org.infoglue.cms.controllers.kernel.impl.simple;
29
30 import java.util.Date JavaDoc;
31 import java.util.Vector JavaDoc;
32
33 /**
34  * This class holds the list of available updates. To expire this
35  * list and force a refresh from the server, set availableUpdates to null
36  * setAvalilableUpdates(null);
37  *
38  * To allways get a list from the server at first call, initialize availableUpdates
39  * with null, otherwise to start with an empty list initialize with new Vector();
40  *
41  * @author Stefan Sik
42  *
43  *
44  */

45 public class UpdateListHandler {
46     
47     // Start with empty vector so that we must do a refresh to get
48
// the updates from the updateserver
49
private static Vector JavaDoc availableUpdates=new Vector JavaDoc();
50     private static Vector JavaDoc installedUpdates=null;
51     private static Date JavaDoc latestRefresh = null;
52
53     /**
54      * @return
55      */

56     public static Vector JavaDoc getAvailableUpdates() {
57         return availableUpdates;
58     }
59
60     /**
61      * @return
62      */

63     public static Vector JavaDoc getInstalledUpdates() {
64         return installedUpdates;
65     }
66
67     /**
68      * @param vector
69      */

70     public static void setAvailableUpdates(Vector JavaDoc vector) {
71
72         if (vector != null)
73         {
74             setLatestRefresh(new Date JavaDoc());
75         }
76         
77         availableUpdates = vector;
78     }
79
80     /**
81      * @param vector
82      */

83     public static void setInstalledUpdates(Vector JavaDoc vector) {
84         installedUpdates = vector;
85     }
86
87
88     /**
89      * @return
90      */

91     public static Date JavaDoc getLatestRefresh() {
92         return latestRefresh;
93     }
94
95     /**
96      * @param date
97      */

98     public static void setLatestRefresh(Date JavaDoc date) {
99         latestRefresh = date;
100     }
101
102 }
103
Popular Tags