Clover coverage report - XMLPolicy - 1.1
Coverage timestamp: Tue Dec 2 2003 20:21:22 EST
file stats: LOC: 120   Methods: 5
NCLOC: 53   Classes: 1
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
GrantMetaData.java 0% 0% 0% 0%
coverage
 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 GrantMetaData
 18   
 {
 19   
     /**
 20   
      * The codebase that grant applies to.
 21   
      */
 22   
     private final String m_codebase;
 23   
 
 24   
     /**
 25   
      * The signer of codebase. May be null but if null then
 26   
      * keyStore must also be null.
 27   
      */
 28   
     private final String m_signedBy;
 29   
 
 30   
     /**
 31   
      * The keyStore to load signer from. May be null but if
 32   
      * null then signedBy must also be null.
 33   
      */
 34   
     private final String m_keyStore;
 35   
 
 36   
     /**
 37   
      * The set of permissions to grant codebase.
 38   
      */
 39   
     private final PermissionMetaData[] m_permissions;
 40   
 
 41   
     /**
 42   
      * Construct a grant.
 43   
      *
 44   
      * @param codebase the codebase grant is about
 45   
      * @param signedBy who signed the codebase
 46   
      * @param keyStore the name of the keystore the signer is loaded from
 47   
      * @param permissions the set of permissions associated with grant
 48   
      */
 49  0
     public GrantMetaData( final String codebase,
 50   
                           final String signedBy,
 51   
                           final String keyStore,
 52   
                           final PermissionMetaData[] permissions )
 53   
     {
 54  0
         if( null == permissions )
 55   
         {
 56  0
             throw new NullPointerException( "permissions" );
 57   
         }
 58  0
         if( null == signedBy && null != keyStore )
 59   
         {
 60  0
             throw new NullPointerException( "signedBy" );
 61   
         }
 62  0
         if( null == keyStore && null != signedBy )
 63   
         {
 64  0
             throw new NullPointerException( "keyStore" );
 65   
         }
 66  0
         for( int i = 0; i < permissions.length; i++ )
 67   
         {
 68  0
             if( null == permissions[ i ] )
 69   
             {
 70  0
                 throw new NullPointerException( "permissions[" + i + "]" );
 71   
             }
 72   
         }
 73   
 
 74  0
         m_codebase = codebase;
 75  0
         m_signedBy = signedBy;
 76  0
         m_keyStore = keyStore;
 77  0
         m_permissions = permissions;
 78   
     }
 79   
 
 80   
     /**
 81   
      * Return the code base for grant.
 82   
      *
 83   
      * @return the code base for grant.
 84   
      */
 85  0
     public String getCodebase()
 86   
     {
 87  0
         return m_codebase;
 88   
     }
 89   
 
 90   
     /**
 91   
      * Return the signer for grant.
 92   
      *
 93   
      * @return the signer for grant.
 94   
      */
 95  0
     public String getSignedBy()
 96   
     {
 97  0
         return m_signedBy;
 98   
     }
 99   
 
 100   
     /**
 101   
      * Return the key store to load signer from.
 102   
      *
 103   
      * @return the key store to load signer from.
 104   
      */
 105  0
     public String getKeyStore()
 106   
     {
 107  0
         return m_keyStore;
 108   
     }
 109   
 
 110   
     /**
 111   
      * Return the set of permissions associated with grant.
 112   
      *
 113   
      * @return the set of permissions associated with grant.
 114   
      */
 115  0
     public PermissionMetaData[] getPermissions()
 116   
     {
 117  0
         return m_permissions;
 118   
     }
 119   
 }
 120