001: /*
002: * The contents of this file are subject to the
003: * Mozilla Public License Version 1.1 (the "License");
004: * you may not use this file except in compliance with the License.
005: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006: *
007: * Software distributed under the License is distributed on an "AS IS"
008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
009: * See the License for the specific language governing rights and
010: * limitations under the License.
011: *
012: * The Initial Developer of the Original Code is Simulacra Media Ltd.
013: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014: *
015: * All Rights Reserved.
016: *
017: * Contributor(s):
018: */
019: package org.openharmonise.rm.security.authorization;
020:
021: import java.util.List;
022: import java.util.logging.*;
023:
024: import org.openharmonise.commons.dsi.AbstractDataStoreInterface;
025: import org.openharmonise.rm.DataAccessException;
026: import org.openharmonise.rm.metadata.Profile;
027: import org.openharmonise.rm.resources.*;
028:
029: /**
030: * Profile specifically for holding role based security metadata properties.
031: *
032: * @author Michael Bell
033: * @version $Revision: 1.2 $
034: *
035: */
036: public class AuthorityProfile extends Profile {
037:
038: public static final String SECURITY_PROFILE_NAME = "Security";
039:
040: /**
041: * Logger for this class
042: */
043: private static final Logger m_logger = Logger
044: .getLogger(AuthorityProfile.class.getName());
045:
046: {
047: try {
048: super .setName(SECURITY_PROFILE_NAME);
049: } catch (InvalidNameException e) {
050: //shouldn't be a problem but write log anyway
051: m_logger.log(Level.WARNING, e.getLocalizedMessage(), e);
052: }
053: }
054:
055: /**
056: * Empty constructor.
057: *
058: */
059: public AuthorityProfile() {
060: super ();
061: }
062:
063: /**
064: * @param dbintrf
065: */
066: public AuthorityProfile(AbstractDataStoreInterface dbintrf) {
067: super (dbintrf);
068: }
069:
070: /**
071: * @param dbintrf
072: * @param obj
073: */
074: public AuthorityProfile(AbstractDataStoreInterface dbintrf,
075: AbstractProfiledObject obj) {
076: super (dbintrf, obj);
077: }
078:
079: /**
080: * @param dbintrf
081: * @param nId
082: * @param obj
083: */
084: public AuthorityProfile(AbstractDataStoreInterface dbintrf,
085: int nId, AbstractProfiledObject obj) {
086: super (dbintrf, nId, obj);
087: }
088:
089: /* (non-Javadoc)
090: * @see org.openharmonise.rm.resources.AbstractObject#getName()
091: */
092: public String getName() throws DataAccessException {
093: return SECURITY_PROFILE_NAME;
094: }
095:
096: /* (non-Javadoc)
097: * @see org.openharmonise.rm.resources.AbstractObject#setName(java.lang.String)
098: */
099: public void setName(String sName) {
100: //no nothing, can't set name
101: }
102:
103: /* (non-Javadoc)
104: * @see org.openharmonise.rm.metadata.Profile#isValid(org.openharmonise.rm.resources.AbstractProfiledObject)
105: */
106: public boolean isValid(AbstractProfiledObject profObj)
107: throws DataAccessException {
108:
109: //don't make any restriction - at most should only allow RBS props
110: return true;
111: }
112:
113: /* (non-Javadoc)
114: * @see org.openharmonise.rm.metadata.Profile#getAvailableProperties()
115: */
116: public List getAvailableProperties() throws DataAccessException {
117: return AuthorizationValidator.getSecurityProperties(m_dsi);
118: }
119:
120: }
|