KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > notification > Recipient


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.notification;
21
22 public class Recipient implements Comparable JavaDoc {
23     public static final int EOF = 0;
24     
25     public static final int ADMINS = 1;
26
27     public static final int USER = 2;
28
29     public static final int ROLE = 3;
30
31     public static final int POLICY = 4;
32     
33     private int recipientType;
34     private String JavaDoc recipientAlias;
35     private String JavaDoc realmName;
36     
37     /**
38      * @param recipientType
39      * @param recipientAlias
40      * @param realmName
41      */

42     public Recipient(int recipientType, String JavaDoc recipientAlias, String JavaDoc realmName) {
43         this.recipientType = recipientType;
44         this.recipientAlias = recipientAlias;
45         this.realmName = realmName;
46     }
47     
48     /**
49      * @return Returns the recipientAlias.
50      */

51     public String JavaDoc getRecipientAlias() {
52         return recipientAlias;
53     }
54     /**
55      * @param recipientAlias The recipientAlias to set.
56      */

57     public void setRecipientAlias(String JavaDoc recipientAlias) {
58         this.recipientAlias = recipientAlias;
59     }
60     /**
61      * @return Returns the recipientType.
62      */

63     public int getRecipientType() {
64         return recipientType;
65     }
66     /**
67      * @param recipientType The recipientType to set.
68      */

69     public void setRecipientType(int recipientType) {
70         this.recipientType = recipientType;
71     }
72
73     public int compareTo(Object JavaDoc arg0) {
74         Recipient r = (Recipient)arg0;
75         int c = new Integer JavaDoc(recipientType).compareTo(new Integer JavaDoc(r.getRecipientType()));
76         return c == 0 ? recipientAlias.compareTo(r.getRecipientAlias()) : c;
77     }
78
79     /**
80      * @return String
81      */

82     public String JavaDoc getRealmName() {
83         return realmName;
84     }
85
86     /**
87      * @param realmName
88      */

89     public void setRealmName(String JavaDoc realmName) {
90         this.realmName = realmName;
91     }
92
93 }
94
Popular Tags