KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > rm > security > authorization > AuthorityProfile


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.rm.security.authorization;
20
21 import java.util.List JavaDoc;
22 import java.util.logging.*;
23
24 import org.openharmonise.commons.dsi.AbstractDataStoreInterface;
25 import org.openharmonise.rm.DataAccessException;
26 import org.openharmonise.rm.metadata.Profile;
27 import org.openharmonise.rm.resources.*;
28
29
30 /**
31  * Profile specifically for holding role based security metadata properties.
32  *
33  * @author Michael Bell
34  * @version $Revision: 1.2 $
35  *
36  */

37 public class AuthorityProfile extends Profile {
38
39     public static final String JavaDoc SECURITY_PROFILE_NAME = "Security";
40     
41     /**
42      * Logger for this class
43      */

44     private static final Logger m_logger = Logger.getLogger(AuthorityProfile.class.getName());
45     
46     {
47         try {
48             super.setName(SECURITY_PROFILE_NAME);
49         } catch (InvalidNameException e) {
50             //shouldn't be a problem but write log anyway
51
m_logger.log(Level.WARNING, e.getLocalizedMessage(), e);
52         }
53     }
54
55     /**
56      * Empty constructor.
57      *
58      */

59     public AuthorityProfile() {
60         super();
61     }
62
63     /**
64      * @param dbintrf
65      */

66     public AuthorityProfile(AbstractDataStoreInterface dbintrf) {
67         super(dbintrf);
68     }
69
70     /**
71      * @param dbintrf
72      * @param obj
73      */

74     public AuthorityProfile(
75         AbstractDataStoreInterface dbintrf,
76         AbstractProfiledObject obj) {
77         super(dbintrf, obj);
78     }
79
80     /**
81      * @param dbintrf
82      * @param nId
83      * @param obj
84      */

85     public AuthorityProfile(
86         AbstractDataStoreInterface dbintrf,
87         int nId,
88         AbstractProfiledObject obj) {
89         super(dbintrf, nId, obj);
90     }
91
92     /* (non-Javadoc)
93      * @see org.openharmonise.rm.resources.AbstractObject#getName()
94      */

95     public String JavaDoc getName() throws DataAccessException {
96         return SECURITY_PROFILE_NAME;
97     }
98
99     /* (non-Javadoc)
100      * @see org.openharmonise.rm.resources.AbstractObject#setName(java.lang.String)
101      */

102     public void setName(String JavaDoc sName) {
103         //no nothing, can't set name
104
}
105
106     /* (non-Javadoc)
107      * @see org.openharmonise.rm.metadata.Profile#isValid(org.openharmonise.rm.resources.AbstractProfiledObject)
108      */

109     public boolean isValid(AbstractProfiledObject profObj)
110         throws DataAccessException {
111
112         //don't make any restriction - at most should only allow RBS props
113
return true;
114     }
115
116     /* (non-Javadoc)
117      * @see org.openharmonise.rm.metadata.Profile#getAvailableProperties()
118      */

119     public List JavaDoc getAvailableProperties() throws DataAccessException {
120         return AuthorizationValidator.getSecurityProperties(m_dsi);
121     }
122
123 }
124
Popular Tags