KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > security > AccessDeniedException


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/security/AccessDeniedException.java,v 1.8 2004/07/28 09:34:48 ib Exp $
3  * $Revision: 1.8 $
4  * $Date: 2004/07/28 09:34:48 $
5  *
6  * ====================================================================
7  *
8  * Copyright 1999-2002 The Apache Software Foundation
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */

23
24 package org.apache.slide.security;
25
26 import org.apache.slide.util.Messages;
27
28 /**
29  * Access denied.
30  *
31  * @version $Revision: 1.8 $
32  */

33 public class AccessDeniedException extends SecurityException JavaDoc {
34     
35     
36     // ----------------------------------------------------------- Constructors
37

38     
39     /**
40      * Constructor.
41      *
42      * @param objectUri Object on which the access was denied
43      * @param subjectUri Subject
44      * @param actionUri Action which was attempted
45      */

46     public AccessDeniedException(String JavaDoc objectUri, String JavaDoc subjectUri,
47                                  String JavaDoc actionUri) {
48         super(Messages.format(AccessDeniedException.class.getName(),
49                               objectUri, subjectUri, actionUri));
50         this.objectUri = objectUri;
51         this.subjectUri = subjectUri;
52         this.actionUri = actionUri;
53     }
54     
55     
56     // ----------------------------------------------------- Instance Variables
57

58     
59     /**
60      * Object Uri.
61      */

62     private String JavaDoc objectUri;
63     
64     /**
65      * Subject Uri.
66      */

67     private String JavaDoc subjectUri;
68     
69     /**
70      * Action Uri.
71      */

72     private String JavaDoc actionUri;
73     
74     
75     // ------------------------------------------------------------- Properties
76

77     
78     /**
79      * Object Uri accessor.
80      *
81      * @return String object Uri
82      */

83     public String JavaDoc getObjectUri() {
84         if (objectUri == null) {
85             return new String JavaDoc();
86         } else {
87             return objectUri;
88         }
89     }
90     
91    /**
92      * Subject Uri accessor.
93      *
94      * @return String object Uri
95      */

96     public String JavaDoc getSubjectUri() {
97         if (subjectUri == null) {
98             return new String JavaDoc();
99         } else {
100             return subjectUri;
101         }
102     }
103     
104    /**
105      * Object Uri accessor.
106      *
107      * @return String object Uri
108      */

109     public String JavaDoc getActionUri() {
110         if (actionUri == null) {
111             return new String JavaDoc();
112         } else {
113             return actionUri;
114         }
115     }
116 }
117
Popular Tags