KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > data > applications > ApplicationBean


1 package org.jahia.data.applications;
2
3 import java.util.Comparator JavaDoc;
4 import java.io.Serializable JavaDoc;
5
6 /**
7  * This object contains all the data relative to an application, notably the
8  * context in which it should run, it's type (servlet or JSP) and additionnal
9  * information such as rights, etc...
10  * @author Serge Huber
11  * @version 1.0
12  */

13 public class ApplicationBean implements Serializable JavaDoc, Comparator JavaDoc, Cloneable JavaDoc {
14
15     private int ID;
16     private int jahiaID;
17     private String JavaDoc name;
18     private String JavaDoc context;
19     private int visible = 0;
20     private boolean shared = false;
21     private int rights;
22     private String JavaDoc filename = ""; // the file name of the .war or .ear package
23
private String JavaDoc desc = "";
24
25     /**
26      *
27      */

28     public ApplicationBean( int ID,
29                             int jahiaID,
30                             String JavaDoc name,
31                             String JavaDoc context,
32                             int visible,
33                             boolean shared,
34                             int rights,
35                             String JavaDoc filename,
36                             String JavaDoc desc
37                           ) {
38         setID( ID );
39         this.jahiaID = jahiaID;
40         this.name = name;
41         this.context = context;
42         this.visible = visible;
43         this.shared = shared;
44         this.rights = rights;
45         this.filename = filename;
46         this.desc = desc;
47     } // end constructor
48

49
50
51     /**
52      * accessor methods
53      * {
54      */

55     public int getID() { return ID; }
56     public int getJahiaID() { return jahiaID; }
57     public String JavaDoc getName() { return name; }
58     public String JavaDoc getContext() { return context; }
59     public int getVisibleStatus() { return visible; }
60     public boolean isShared() { return shared; }
61     public int getRights() { return rights; }
62     public String JavaDoc getFilename() { return filename; }
63     public String JavaDoc getdesc() { return desc; }
64
65     public void setID( int ID ) { this.ID = ID; }
66     public void setName( String JavaDoc name ) { this.name = name; }
67     public void setVisible( int visible ) { this.visible = visible; }
68     public void setShared( boolean shared ) { this.shared = shared; }
69     public void setRights( int rights ) { this.rights = rights; }
70     public void setFilename( String JavaDoc filename ) { this.filename = filename; }
71     public void setdesc( String JavaDoc descr ) { this.desc = descr; }
72
73
74     // end accessor methods
75

76     //-------------------------------------------------------------------------
77
/**
78      * Compare between two objects, sort by their name
79      *
80      * @param Object
81      * @param Object
82      */

83     public int compare(Object JavaDoc c1, Object JavaDoc c2) throws ClassCastException JavaDoc {
84
85         return ((ApplicationBean)c1)
86                     .getName().compareToIgnoreCase(((ApplicationBean)c2).getName());
87
88     }
89
90     public Object JavaDoc clone() {
91         try {
92             return super.clone();
93         } catch (CloneNotSupportedException JavaDoc cnse) {
94             // should never happen as we do support Cloneable in the interface
95
return null;
96         }
97     }
98 } // end ApplicationBean
99
Popular Tags