Clover Coverage Report
Coverage timestamp: Sun Mar 23 2008 08:24:39 GMT
9   92   1   1.29
0   33   0.78   7
7     1  
1    
 
 
  DefaultDelegatableToken       Line # 47 9 1 81.2% 0.8125
 
  (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   
36    import issrg.pba.rbac.Revocable;
37    import issrg.pba.rbac.policies.Subtree;
38   
39    /**
40    * This is the default Delegatable Parsed Token implementation. It
41    * contains the
42    * Holder, the Issuer and the Credentials of the Holder, and points to the
43    * Issuer location as well as specifies the depth of delegation that is allowed.
44    * The credentials of the Holder are split into two categories: assertable
45    * credentials and delegatable credentials
46    */
 
47    public class DefaultDelegatableToken extends DefaultParsedToken implements DelegatableToken{
48    Subtree subjectDomain;
49    Credentials delegateableCredentials;
50    int depth;
51   
 
52  0 toggle protected DefaultDelegatableToken(){}
53   
54    /**
55    * This is the constructor that builds the Default Parsed Token given the
56    * Holder, the Issuer and the Credentials of the Holder issued to him by the Issuer.
57    *
58    * @param holder - the Holder entry
59    * @param issuer - the Issuer Token Locator
60    * @param creds - the Credentials of the Holder
61    * @param delegateableCredentials - the Credentials of the Holder
62    * @param subjectDomain - the domain of subjects to whom the holder can delegate the credentials
63    * @param depth - the depth of delegation chain that the delegateableCredentials can be delegated to
64    */
 
65  78 toggle public DefaultDelegatableToken(issrg.utils.repository.Entry holder, issrg.utils.repository.TokenLocator issuer,
66    Credentials creds, Credentials delegateableCredentials, Subtree subjectDomain, int depth){
67  78 this(holder,issuer,creds,delegateableCredentials,subjectDomain,depth,true);
68    }
 
69  948 toggle public DefaultDelegatableToken(issrg.utils.repository.Entry holder, issrg.utils.repository.TokenLocator issuer,
70    Credentials creds, Credentials delegateableCredentials, Subtree subjectDomain, int depth, boolean revocable){
71  948 super(holder, issuer, creds, revocable);
72  948 this.delegateableCredentials = delegateableCredentials;
73  948 this.subjectDomain = subjectDomain;
74  948 this.depth = depth;
75    }
76   
 
77  1071 toggle public Credentials getDelegateableCredentials() {
78  1071 return delegateableCredentials;
79    }
80   
 
81  894 toggle public Subtree getSubjectDomain(){
82  894 return subjectDomain;
83    }
84   
 
85  908 toggle public int getDepth() {
86  908 return depth;
87    }
88   
 
89  0 toggle public String toString(){
90  0 return "Authorisation token issued by "+getIssuerTokenLocator().getEntry().getEntryName().getName()+" to "+getHolder().getEntryName().getName()+": "+getCredentials().toString() + "; the holder can delegate "+ getDelegateableCredentials() + " " + getDepth() + " levels down to subjects from domain "+subjectDomain;
91    }
92    }