Clover Coverage Report
Coverage timestamp: Sun Mar 23 2008 08:24:39 GMT
10   92   1   1.25
0   34   0.8   8
8     1  
1    
 
 
  DefaultParsedToken       Line # 40 10 1 72.2% 0.7222222
 
  (1)
 
1    /*
2    * Copyright (c) 2000-2005, University of Salford
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions are met:
7    *
8    * Redistributions of source code must retain the above copyright notice, this
9    * list of conditions and the following disclaimer.
10    *
11    * Redistributions in binary form must reproduce the above copyright notice,
12    * this list of conditions and the following disclaimer in the documentation
13    * and/or other materials provided with the distribution.
14    *
15    * Neither the name of the University of Salford nor the names of its
16    * contributors may be used to endorse or promote products derived from this
17    * software without specific prior written permission.
18    *
19    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21    * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22    * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23    * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24    * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25    * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26    * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27    * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28    * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29    * POSSIBILITY OF SUCH DAMAGE.
30    */
31   
32    package issrg.pba;
33   
34    import java.util.Vector;
35    import issrg.pba.rbac.*;
36    /**
37    * This is the default Parsed Token implementation. It simply contains the
38    * Holder, the Issuer, the Credentials of the Holder and the URL to the revoked certificate.
39    */
 
40    public class DefaultParsedToken implements ParsedToken {
41    issrg.utils.repository.Entry holder;
42    issrg.utils.repository.TokenLocator issuer;
43    Credentials creds;
44    boolean noRevAvail;
45   
46   
 
47  0 toggle protected DefaultParsedToken(){}
48   
49    /**
50    * This is the constructor that builds the Default Parsed Token given the
51    * Holder, the Issuer and the Credentials of the Holder issued to him by the Issuer.
52    *
53    * @param holder - the Holder entry
54    * @param issuer - the Issuer entry
55    * @param creds - the Credentials of the Holder
56    * @param revLoc - the location of the revoked certificate
57    */
 
58  666 toggle public DefaultParsedToken(issrg.utils.repository.Entry holder, issrg.utils.repository.TokenLocator issuer, Credentials creds){
59  666 this(holder,issuer,creds,true);
60    }
 
61  2523 toggle public DefaultParsedToken(issrg.utils.repository.Entry holder, issrg.utils.repository.TokenLocator issuer, Credentials creds, boolean revocable){
62  2523 this.holder=holder;
63  2523 this.issuer=issuer;
64  2523 this.creds = creds;
65  2523 noRevAvail = revocable;
66    }
67   
 
68  1699 toggle public Credentials getCredentials(){
69  1699 return creds;
70    }
71   
 
72  3224 toggle public issrg.utils.repository.Entry getHolder(){
73  3224 return holder;
74    }
75   
 
76  2181 toggle public issrg.utils.repository.TokenLocator getIssuerTokenLocator(){
77  2181 return issuer;
78    }
79   
 
80  0 toggle public String toString(){
81  0 return "Authorisation Token issued by "+getIssuerTokenLocator().getEntry().getEntryName().getName()+" to "+getHolder().getEntryName().getName();
82    }
83   
 
84  0 togglepublic boolean isRevocable() {
85  0 return noRevAvail;
86    }
87   
88   
89   
90   
91   
92    }