KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > policyframework > NoPermissionException


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.policyframework;
21
22
23 /**
24  */

25 public class NoPermissionException extends Exception JavaDoc {
26     private final ResourceType resourceType;
27     private final Principal principal;
28
29     /**
30      * @param message
31      */

32     public NoPermissionException(String JavaDoc message) {
33         this(message, null, null, null);
34     }
35     
36     /**
37      * @param principal
38      * @param resourceType
39      */

40     public NoPermissionException(Principal principal, ResourceType resourceType) {
41         this("", null, principal, resourceType);
42     }
43
44     /**
45      * @param message
46      * @param principal
47      * @param resourceType
48      */

49     public NoPermissionException(String JavaDoc message, Principal principal, ResourceType resourceType) {
50         this(message, null, principal, resourceType);
51     }
52
53     /**
54      * @param message
55      * @param cause
56      * @param principal
57      * @param resourceType
58      */

59     public NoPermissionException(String JavaDoc message, Throwable JavaDoc cause, Principal principal, ResourceType resourceType) {
60         super(message, cause);
61         this.principal = principal;
62         this.resourceType = resourceType;
63     }
64
65     /**
66      * @return String
67      */

68     public String JavaDoc getPrincipalName() {
69         return principal == null ? "" : principal.getPrincipalName();
70     }
71
72     /**
73      * @return ResourceType
74      */

75     public ResourceType getResourceType() {
76         return resourceType;
77     }
78 }
Popular Tags