Changeset 2471

Show
Ignore:
Timestamp:
09/22/08 11:46:36 (4 months ago)
Author:
dbuss
Message:

some minor beautification.

Location:
trunk/otis/src/org/bandit/otis
Files:
20 modified

Legend:

Unmodified
Added
Removed
  • trunk/otis/src/org/bandit/otis/api/ActivationException.java

    r2227 r2471  
    1919{ 
    2020        public String remedialAction; 
     21 
    2122        /** 
    2223         *  
     
    3435                super(e); 
    3536        } 
    36          
    37         public ActivationException(String message) 
     37 
     38        public ActivationException( 
     39                String message) 
    3840        { 
    3941                super(message); 
    4042        } 
    4143 
    42         public ActivationException(String message, Throwable cause) 
     44        public ActivationException( 
     45                String message, 
     46                Throwable cause) 
    4347        { 
    4448                super(message, cause); 
    4549        } 
    46          
    47         public ActivationException(Throwable cause) 
     50 
     51        public ActivationException( 
     52                Throwable cause) 
    4853        { 
    4954                super(cause); 
    5055        } 
    51          
    52          
    53         public ActivationException(String message, String action) 
     56 
     57        public ActivationException( 
     58                String message, 
     59                String action) 
    5460        { 
    5561                super(message); 
     
    5763        } 
    5864 
    59         public ActivationException(String message, String action, Throwable cause) 
     65        public ActivationException( 
     66                String message, 
     67                String action, 
     68                Throwable cause) 
    6069        { 
    6170                super(message, cause); 
    6271                remedialAction = action; 
    6372        } 
    64          
     73 
    6574} 
  • trunk/otis/src/org/bandit/otis/api/AuthSessionException.java

    r1944 r2471  
    3333                super(e); 
    3434        } 
    35          
    36         public AuthSessionException(String message) 
     35 
     36        public AuthSessionException( 
     37                String message) 
    3738        { 
    3839                super(message); 
    3940        } 
    4041 
    41         public AuthSessionException(String message, Throwable cause) 
     42        public AuthSessionException( 
     43                String message, 
     44                Throwable cause) 
    4245        { 
    4346                super(message, cause); 
    4447        } 
    45          
    46         public AuthSessionException(Throwable cause) 
     48 
     49        public AuthSessionException( 
     50                Throwable cause) 
    4751        { 
    4852                super(cause); 
  • trunk/otis/src/org/bandit/otis/api/AuthenticationException.java

    r1944 r2471  
    2929        } 
    3030 
    31         public AuthenticationException(String message) 
     31        public AuthenticationException( 
     32                String message) 
    3233        { 
    3334                super(message); 
    3435        } 
    3536 
    36         public AuthenticationException(String message, Throwable cause) 
     37        public AuthenticationException( 
     38                String message, 
     39                Throwable cause) 
    3740        { 
    3841                super(message, cause); 
    3942        } 
    4043 
    41         public AuthenticationException(Throwable cause) 
     44        public AuthenticationException( 
     45                Throwable cause) 
    4246        { 
    4347                super(cause); 
  • trunk/otis/src/org/bandit/otis/api/IConfigurable.java

    r1946 r2471  
    1313        See the License for the specific language governing permissions and 
    1414        limitations under the License. 
    15 */ 
     15 */ 
    1616package org.bandit.otis.api; 
    1717 
     
    2222        /** 
    2323         * Allow this object to be configured, if called after the object has used 
    24          * settings from the configuration then calls from that point on should 
    25          * use the new configuration.  
    26          * @param mapSettings a map of potential settings 
    27          * @throws AuthSessionException on error 
     24         * settings from the configuration then calls from that point on should use 
     25         * the new configuration. 
     26         *  
     27         * @param mapSettings 
     28         *           a map of potential settings 
     29         * @throws AuthSessionException 
     30         *            on error 
    2831         */ 
    29         public void configure(  Map<String, ?> mapSettings) throws AuthSessionException; 
     32        public void configure( 
     33                Map<String, ?> mapSettings) throws AuthSessionException; 
    3034} 
  • trunk/otis/src/org/bandit/otis/api/IObligation.java

    r2447 r2471  
    1313        See the License for the specific language governing permissions and 
    1414        limitations under the License. 
    15 */ 
     15 */ 
    1616package org.bandit.otis.api; 
    17  
    1817 
    1918public abstract interface IObligation 
    2019{ 
    21         /**  
     20        /** 
    2221         * Obligation field names 
    2322         */ 
    2423        public static final String OBLIGATION_ID = "Id"; 
     24 
    2525        public static final String OBLIGATION_OBLEGATEE = "Obligatee"; 
     26 
    2627        public static final String OBLIGATION_OBLIGATION = "Obligation"; 
    27          
     28 
    2829        /** 
    2930         * Obligation ids 
    3031         */ 
    3132        public static final String OBLIGATION_MESSAGE_HTML = "Obligation User Message (HTML)"; 
     33 
    3234        public static final String OBLIGATION_MESSAGE = "Obligation User Message"; 
     35 
    3336        public static final String OBLIGATION_REDIRECT = "Obligation Redirect"; 
    34          
     37 
    3538        /** 
    3639         * Oblegatees 
    3740         */ 
    38         public static final String OBLIGATEE_USER ="Obligatee User"; 
    39         public static final String OBLIGATEE_CONSUMER ="Obligatee Consumer"; 
    40         public static final String OBLIGATEE_OTIS ="Obligatee OTIS"; 
    41          
     41        public static final String OBLIGATEE_USER = "Obligatee User"; 
     42 
     43        public static final String OBLIGATEE_CONSUMER = "Obligatee Consumer"; 
     44 
     45        public static final String OBLIGATEE_OTIS = "Obligatee OTIS"; 
     46 
    4247        /** 
    4348         *  
    44          * @return String  
     49         * @return String 
    4550         * @throws AuthSessionException 
    4651         */ 
    4752        public String getId() throws AuthSessionException; 
    48          
     53 
    4954        public String getObligatee() throws AuthSessionException; 
    50          
     55 
    5156        public String getObligationData() throws AuthSessionException; 
    52          
     57 
    5358} 
  • trunk/otis/src/org/bandit/otis/api/IRole.java

    r2461 r2471  
    1313        See the License for the specific language governing permissions and 
    1414        limitations under the License. 
    15 */ 
     15 */ 
    1616package org.bandit.otis.api; 
    1717 
     
    2121/** 
    2222 * The IRole interface provides abstraction of resources representing roles. 
    23  * Roles are associated with an {@link org.bandit.otis.api.IAuthSession IAuthSession} 
    24  * object and may be enumerated by calling the {@link org.bandit.otis.api.IAuthSession#getAssumableRoles() 
    25  * getAssumeableRoles} or {@link org.bandit.otis.api.IAuthSession#getActiveRoles() getActiveRoles} 
     23 * Roles are associated with an 
     24 * {@link org.bandit.otis.api.IAuthSession IAuthSession} object and may be 
     25 * enumerated by calling the 
     26 * {@link org.bandit.otis.api.IAuthSession#getAssumableRoles() 
     27 * getAssumeableRoles} or 
     28 * {@link org.bandit.otis.api.IAuthSession#getActiveRoles() getActiveRoles} 
    2629 * methods. 
    2730 */ 
     
    2932{ 
    3033        /** 
    31          * Identifier for list of roles which are active on the session. 
    32          * This is a subset of {@link #ASSUMABLE_ROLES} 
     34         * Identifier for list of roles which are active on the session. This is a 
     35         * subset of {@link #ASSUMABLE_ROLES} 
    3336         */ 
    34         public static final String ACTIVE_ROLES = "Active Roles"; 
    35          
     37        public static final String ACTIVE_ROLES = "Active Roles"; 
     38 
    3639        /** 
    37          * Identifier for a common list of roles which may be activatable on the session. 
    38          * This is a superset of {@link #ACTIVE_ROLES} 
     40         * Identifier for a common list of roles which may be activatable on the 
     41         * session. This is a superset of {@link #ACTIVE_ROLES} 
    3942         */ 
    4043        public static final String ASSUMABLE_ROLES = "Assumable Roles"; 
    41          
     44 
    4245        public static final String PROVISION_ROLES = "Provision Roles"; 
     46 
    4347        public static final String DEPROVISION_ROLES = "Deprovision Roles"; 
    44          
    45          
     48 
    4649        /** 
    47          * Property name for a role's identifier. 
    48          * This Identifier must be in a format which can be placed in a URI 
     50         * Property name for a role's identifier. This Identifier must be in a format 
     51         * which can be placed in a URI 
    4952         */ 
    50         public static final String  roleId = "RoleIdentifier"; 
    51          
     53        public static final String roleId = "RoleIdentifier"; 
     54 
    5255        /** 
    53          * Property name for a role's name.  
     56         * Property name for a role's name. 
    5457         */ 
    55         public static final String  roleName = "RoleName"; 
    56          
     58        public static final String roleName = "RoleName"; 
     59 
    5760        /** 
    58          * Property name for a role's description.  
     61         * Property name for a role's description. 
    5962         */ 
    60         public static final String  roleDescription = "RoleDescription"; 
    61          
     63        public static final String roleDescription = "RoleDescription"; 
     64 
    6265        /** 
    63          * Property name for a role's types.  
     66         * Property name for a role's types. 
    6467         */ 
    65         public static final String  roleTypes = "RoleTypes"; 
    66          
     68        public static final String roleTypes = "RoleTypes"; 
     69 
    6770        /** 
    68          * Property name for a role's activation method.  
     71         * Property name for a role's activation method. 
    6972         */ 
    70         public static final String  roleActivationMethod = "RoleActivationMethod"; 
    71          
     73        public static final String roleActivationMethod = "RoleActivationMethod"; 
     74 
    7275        /** 
    73          * Was this role activated because of a token?   If we release that token 
    74          * then the role should no longer be active. 
     76         * Was this role activated because of a token? If we release that token then 
     77         * the role should no longer be active. 
    7578         */ 
    76         public static final String  roleTokenAssociations = "TokenAssociations"; 
    77          
     79        public static final String roleTokenAssociations = "TokenAssociations"; 
     80 
    7881        /** 
    79          * List of role property names  
     82         * List of role property names 
    8083         */ 
    81         public static final String[] rolePropertyNames = {IRole.roleId, IRole.roleName, IRole.roleDescription,  
    82                                                 IRole.roleTypes, IRole.roleActivationMethod, IRole.roleTokenAssociations}; 
    83          
     84        public static final String[] rolePropertyNames = 
     85        {IRole.roleId, IRole.roleName, IRole.roleDescription, IRole.roleTypes, 
     86                IRole.roleActivationMethod, IRole.roleTokenAssociations}; 
     87 
    8488        /** 
    85          * Return the role's identifier.  The identifier returned may not be the same  
    86          * identifier as used in the base role system.   It may have been mapped to make it   
    87          * unique across the various role systems configured in OTIS.  Thus, because of configuration differences, 
    88          * two instances of OTIS might return different role identifiers for the same role as found in the 
    89          * base system.  The identifier may not be easily human readable.  A human readable or display   
    90          * name may be obtained by calling the {@link #getRoleName() getRoleName} method.    
    91          * The identifier may be a URI, URN, or URL, however the  system makes no promises about the  
    92          * ability of that identifier to be resolvable or reachable. 
     89         * Return the role's identifier. The identifier returned may not be the same 
     90         * identifier as used in the base role system. It may have been mapped to 
     91         * make it unique across the various role systems configured in OTIS. Thus, 
     92         * because of configuration differences, two instances of OTIS might return 
     93         * different role identifiers for the same role as found in the base system. 
     94         * The identifier may not be easily human readable. A human readable or 
     95         * display name may be obtained by calling the 
     96         * {@link #getRoleName() getRoleName} method. The identifier may be a URI, 
     97         * URN, or URL, however the system makes no promises about the ability of 
     98         * that identifier to be resolvable or reachable. 
    9399         *  
    94100         * @return identifier, will never be null 
    95101         */ 
    96102        public String getRoleId() throws AuthSessionException; 
    97          
     103 
    98104        /** 
    99          * Return's a display name for the role.  Will return null if no display name is available. 
    100          *     
    101          * @return display string if present 
    102          * TODO what should we do about language? 
     105         * Return's a display name for the role. Will return null if no display name 
     106         * is available. 
     107         *  
     108         * @return display string if present TODO what should we do about language? 
    103109         */ 
    104110        public String getRoleName() throws AuthSessionException; 
    105          
    106         /** 
    107          * Return a longer description of the role.  Will return null if no description is available. 
    108          * @return null or a human readable description.    
    109          * TODO what should we do about language? 
    110          */ 
    111         public String getRoleDescription()  throws AuthSessionException; 
    112111 
    113112        /** 
    114          * Returns an iterator to get the role's types.  Roles may be of may different types for different purposes. 
    115          * This may be system dependent. 
    116          * @return Iterator which iterators over a list of strings that represent the role's types. 
     113         * Return a longer description of the role. Will return null if no 
     114         * description is available. 
     115         *  
     116         * @return null or a human readable description. TODO what should we do about 
     117         *         language? 
     118         */ 
     119        public String getRoleDescription() throws AuthSessionException; 
     120 
     121        /** 
     122         * Returns an iterator to get the role's types. Roles may be of may different 
     123         * types for different purposes. This may be system dependent. 
     124         *  
     125         * @return Iterator which iterators over a list of strings that represent the 
     126         *         role's types. 
    117127         */ 
    118128        public Iterable<String> getRoleTypes() throws AuthSessionException; 
    119          
     129 
    120130        /** 
    121          * If a role has has been been activated in the current session, this will identify how the 
    122          * role was activated.   Examples include, system activation, manual activation, and activation based 
    123          * on hierarchy. 
    124          * @return null if not an active role or if no role activation information is tracked. 
     131         * If a role has has been been activated in the current session, this will 
     132         * identify how the role was activated. Examples include, system activation, 
     133         * manual activation, and activation based on hierarchy. 
     134         *  
     135         * @return null if not an active role or if no role activation information is 
     136         *         tracked. 
    125137         */ 
    126         public String getRoleActivationMethod()  throws AuthSessionException; 
    127          
     138        public String getRoleActivationMethod() throws AuthSessionException; 
     139 
    128140        /** 
    129          * Get one of the properties of the role.  
    130          * @param propertyName name of the property to be returned. 
     141         * Get one of the properties of the role. 
     142         *  
     143         * @param propertyName 
     144         *           name of the property to be returned. 
    131145         * @return Object which is the value of the property. 
    132146         */ 
    133         public Object getProperty( String propertyName) throws AuthSessionException; 
    134          
     147        public Object getProperty( 
     148                String propertyName) throws AuthSessionException; 
     149 
    135150        /** 
    136          * Get a list of role properties, which are essentially name/value pairs.  The iterator 
    137          * iterates over a set of Map.Entry objects.  The property's name may be obtained by calling 
    138          * the entry's getKey() method, and the property's value may be obtained by calling the 
    139          * entry's getValue() method.  Values may be of one of the following Java Object types: 
     151         * Get a list of role properties, which are essentially name/value pairs. The 
     152         * iterator iterates over a set of Map.Entry objects. The property's name may 
     153         * be obtained by calling the entry's getKey() method, and the property's 
     154         * value may be obtained by calling the entry's getValue() method. Values may 
     155         * be of one of the following Java Object types: 
    140156         * <ul> 
    141157         * <li>String</li> 
     
    151167         * <li>Date</li> 
    152168         * <li>Map&lt;String, Object&gt;.</li> 
    153          * <li>List&lt;Object&gt;.  A List is returned when the property is multi-valued.  The list should be 
    154          * a list of one of the types shown above.</li> 
     169         * <li>List&lt;Object&gt;. A List is returned when the property is 
     170         * multi-valued. The list should be a list of one of the types shown above.</li> 
    155171         * </ul> 
     172         *  
    156173         * @return an iterator that enumerates the role's properties. 
    157174         */ 
    158         public Iterator<Map.Entry<String, Object>> getRoleProperties() throws AuthSessionException; 
    159          
     175        public Iterator<Map.Entry<String, Object>> getRoleProperties() 
     176                throws AuthSessionException; 
     177 
    160178} 
    161  
  • trunk/otis/src/org/bandit/otis/api/NotAuthenticatedException.java

    r1944 r2471  
    1818 * Thrown when the state of an object is not authenticated, yet methods are 
    1919 * being called which require the state to be authenticated 
     20 *  
    2021 * @author jimse 
    21  * 
     22 *  
    2223 */ 
    2324public class NotAuthenticatedException extends AuthSessionException 
     
    2829         */ 
    2930        private static final long serialVersionUID = 5757580288308632772L; 
    30          
     31 
    3132        public NotAuthenticatedException() 
    3233        { 
     
    3435        } 
    3536 
    36         public NotAuthenticatedException(String message) 
     37        public NotAuthenticatedException( 
     38                String message) 
    3739        { 
    3840                super(message); 
    3941        } 
    4042 
    41         public NotAuthenticatedException(String message, Throwable cause) 
     43        public NotAuthenticatedException( 
     44                String message, 
     45                Throwable cause) 
    4246        { 
    4347                super(message, cause); 
    4448        } 
    4549 
    46         public NotAuthenticatedException(Throwable cause) 
     50        public NotAuthenticatedException( 
     51                Throwable cause) 
    4752        { 
    4853                super(cause); 
  • trunk/otis/src/org/bandit/otis/impl/CommonObligation.java

    r2447 r2471  
    1313        See the License for the specific language governing permissions and 
    1414        limitations under the License. 
    15 */ 
     15 */ 
    1616package org.bandit.otis.impl; 
    17  
    1817 
    1918import java.util.HashMap; 
     
    2423import org.bandit.otis.api.AuthSessionException; 
    2524 
    26  
    2725/** 
    28  * Implementation of an IRole 
     26 * Implementation of an IObligation 
     27 *  
    2928 * @exclude 
    3029 */ 
    31 public  class CommonObligation implements IObligation 
     30public class CommonObligation implements IObligation 
    3231{ 
    33         private Map<String, String>     m_members; 
    34          
     32        private Map<String, String> m_members; 
     33 
    3534        public CommonObligation( 
    3635                String id, 
    37                 String obligatee,  
    38                 String obligation 
    39                 )   throws AuthSessionException 
     36                String obligatee, 
     37                String obligation) throws AuthSessionException 
    4038        { 
    4139                m_members = new HashMap<String, String>(); 
     
    4341                m_members.put(IObligation.OBLIGATION_OBLEGATEE, obligatee); 
    4442                m_members.put(IObligation.OBLIGATION_OBLIGATION, obligation); 
    45                  
    46                 if ( id == null         || obligatee  == null || obligation  == null) 
    47                         throw new AuthSessionException("Null not allowed in constroctor to " +  CommonObligation.class.getName()); 
     43 
     44                if (id == null || obligatee == null || obligation == null) 
     45                        throw new AuthSessionException("Null not allowed in constroctor to " 
     46                                + CommonObligation.class.getName()); 
    4847        } 
    49          
     48 
    5049        public CommonObligation( 
    51                 Map<String, String> propertyMap 
    52                 )   throws AuthSessionException 
     50                Map<String, String> propertyMap) throws AuthSessionException 
    5351        { 
    5452                m_members = propertyMap; 
    55                 if ( m_members == null 
    56                         || m_members.get(IObligation.OBLIGATION_ID) == null  
    57                         ||  m_members.get(IObligation.OBLIGATION_OBLEGATEE) == null  
    58                         ||  m_members.get(IObligation.OBLIGATION_OBLIGATION) == null) 
    59                         throw new AuthSessionException("Null not allowed in constroctor to " + CommonObligation.class.getName()); 
     53                if (m_members == null || m_members.get(IObligation.OBL