|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| PermissionMetaData.java | 16.7% | 12.5% | 16.7% | 14.3% |
|
||||||||||||||
| 1 |
/*
|
|
| 2 |
* Copyright (C) The Spice Group. All rights reserved.
|
|
| 3 |
*
|
|
| 4 |
* This software is published under the terms of the Spice
|
|
| 5 |
* Software License version 1.1, a copy of which has been included
|
|
| 6 |
* with this distribution in the LICENSE.txt file.
|
|
| 7 |
*/
|
|
| 8 |
package org.codehaus.spice.xmlpolicy.metadata;
|
|
| 9 |
|
|
| 10 |
/**
|
|
| 11 |
* This class defines a keystore that is used when locating
|
|
| 12 |
* signers of a codebase.
|
|
| 13 |
*
|
|
| 14 |
* @author Peter Donald
|
|
| 15 |
* @version $Revision: 1.1 $ $Date: 2003/12/02 09:16:06 $
|
|
| 16 |
*/
|
|
| 17 |
public class PermissionMetaData |
|
| 18 |
{
|
|
| 19 |
/**
|
|
| 20 |
* The class name of permission.
|
|
| 21 |
*/
|
|
| 22 |
private final String m_classname;
|
|
| 23 |
|
|
| 24 |
/**
|
|
| 25 |
* The target of permission. The interpretation of this is
|
|
| 26 |
* determined by underlying permission classname.
|
|
| 27 |
*/
|
|
| 28 |
private final String m_target;
|
|
| 29 |
|
|
| 30 |
/**
|
|
| 31 |
* The action(s) associated with permission.
|
|
| 32 |
* The interpretation of this field is relative to
|
|
| 33 |
* the permission and target.
|
|
| 34 |
*/
|
|
| 35 |
private final String m_action;
|
|
| 36 |
|
|
| 37 |
/**
|
|
| 38 |
* The signer of the permission.
|
|
| 39 |
* (ie who signed the permission class).
|
|
| 40 |
*/
|
|
| 41 |
private final String m_signedBy;
|
|
| 42 |
|
|
| 43 |
/**
|
|
| 44 |
* The keyStore to load signer from. May be null but if
|
|
| 45 |
* null then signedBy must also be null.
|
|
| 46 |
*/
|
|
| 47 |
private final String m_keyStore;
|
|
| 48 |
|
|
| 49 |
/**
|
|
| 50 |
* Construct the permission meta data.
|
|
| 51 |
*
|
|
| 52 |
* @param classname the name of permission class
|
|
| 53 |
* @param target the target of permission (may be null)
|
|
| 54 |
* @param action the action of permission (may be null)
|
|
| 55 |
*/
|
|
| 56 | 1 |
public PermissionMetaData( final String classname,
|
| 57 |
final String target, |
|
| 58 |
final String action, |
|
| 59 |
final String signedBy, |
|
| 60 |
final String keyStore ) |
|
| 61 |
{
|
|
| 62 | 1 |
if( null == classname ) |
| 63 |
{
|
|
| 64 | 1 |
throw new NullPointerException( "classname" ); |
| 65 |
} |
|
| 66 | 0 |
if( null == signedBy && null != keyStore ) |
| 67 |
{
|
|
| 68 | 0 |
throw new NullPointerException( "signedBy" ); |
| 69 |
} |
|
| 70 | 0 |
if( null == keyStore && null != signedBy ) |
| 71 |
{
|
|
| 72 | 0 |
throw new NullPointerException( "keyStore" ); |
| 73 |
} |
|
| 74 |
|
|
| 75 | 0 |
m_classname = classname; |
| 76 | 0 |
m_target = target; |
| 77 | 0 |
m_action = action; |
| 78 | 0 |
m_signedBy = signedBy; |
| 79 | 0 |
m_keyStore = keyStore; |
| 80 |
} |
|
| 81 |
|
|
| 82 |
/**
|
|
| 83 |
* Return the name of permission class.
|
|
| 84 |
*
|
|
| 85 |
* @return the name of permission class.
|
|
| 86 |
*/
|
|
| 87 | 0 |
public String getClassname()
|
| 88 |
{
|
|
| 89 | 0 |
return m_classname;
|
| 90 |
} |
|
| 91 |
|
|
| 92 |
/**
|
|
| 93 |
* Return the action of permission (may be null).
|
|
| 94 |
*
|
|
| 95 |
* @return the action of permission (may be null).
|
|
| 96 |
*/
|
|
| 97 | 0 |
public String getTarget()
|
| 98 |
{
|
|
| 99 | 0 |
return m_target;
|
| 100 |
} |
|
| 101 |
|
|
| 102 |
/**
|
|
| 103 |
* Return the action of permission (may be null).
|
|
| 104 |
*
|
|
| 105 |
* @return the action of permission (may be null)
|
|
| 106 |
*/
|
|
| 107 | 0 |
public String getAction()
|
| 108 |
{
|
|
| 109 | 0 |
return m_action;
|
| 110 |
} |
|
| 111 |
|
|
| 112 |
/**
|
|
| 113 |
* Return the principle name who signed the permission.
|
|
| 114 |
*
|
|
| 115 |
* @return the the principle name who signed the permission.
|
|
| 116 |
*/
|
|
| 117 | 0 |
public String getSignedBy()
|
| 118 |
{
|
|
| 119 | 0 |
return m_signedBy;
|
| 120 |
} |
|
| 121 |
|
|
| 122 |
/**
|
|
| 123 |
* Return the key store to load signer from.
|
|
| 124 |
*
|
|
| 125 |
* @return the key store to load signer from.
|
|
| 126 |
*/
|
|
| 127 | 0 |
public String getKeyStore()
|
| 128 |
{
|
|
| 129 | 0 |
return m_keyStore;
|
| 130 |
} |
|
| 131 |
} |
|
| 132 |
|
|
||||||||||