KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > deliver > applications > databeans > CacheEvictionBean


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 package org.infoglue.deliver.applications.databeans;
25
26 /**
27  * This class is meant to store information about a cache update.
28  *
29  * @author mattias
30  */

31
32 public class CacheEvictionBean
33 {
34     public final static int TRANS_CREATE = 0;
35     public final static int TRANS_UPDATE = 1;
36     public final static int TRANS_DELETE = 2;
37     public final static int PUBLISHING = 10;
38     public final static int DENIED_PUBLISHING = 20;
39     public final static int UNPUBLISHING = 30;
40     
41     public final static String JavaDoc TRANS_CREATE_TEXT = "create";
42     public final static String JavaDoc TRANS_UPDATE_TEXT = "update";
43     public final static String JavaDoc TRANS_DELETE_TEXT = "delete";
44     public final static String JavaDoc PUBLISHING_TEXT = "publishing";
45     public final static String JavaDoc DENIED_PUBLISHING_TEXT = "publishing denied";
46     public final static String JavaDoc UNPUBLISHING_TEXT = "unpublishing";
47
48     private String JavaDoc className = null;
49     private String JavaDoc objectId = null;
50     private String JavaDoc objectName = null;
51     private String JavaDoc typeId = null;
52
53     public CacheEvictionBean(String JavaDoc className, String JavaDoc typeId, String JavaDoc objectId, String JavaDoc objectName)
54     {
55         this.className = className;
56         this.typeId = typeId;
57         this.objectId = objectId;
58         this.objectName = objectName;
59     }
60     
61     public String JavaDoc getClassName()
62     {
63         return className;
64     }
65
66     public String JavaDoc getObjectId()
67     {
68         return objectId;
69     }
70     
71     public String JavaDoc getObjectName()
72     {
73         return objectName;
74     }
75     
76     public String JavaDoc getTypeId()
77     {
78         return typeId;
79     }
80
81     public static String JavaDoc getTransactionTypeName(Integer JavaDoc transactionType)
82     {
83         switch (transactionType.intValue())
84         {
85             case (int) (TRANS_CREATE):
86                 return TRANS_CREATE_TEXT;
87             case (TRANS_DELETE):
88                 return TRANS_DELETE_TEXT;
89             case (TRANS_UPDATE):
90                 return TRANS_UPDATE_TEXT;
91             case (PUBLISHING):
92                 return PUBLISHING_TEXT;
93             case (DENIED_PUBLISHING):
94                 return DENIED_PUBLISHING_TEXT;
95         }
96         return "unknown - map " + transactionType + " to correct text";
97     }
98 }
Popular Tags