Clover Coverage Report - Kuali Student 1.2-M2-SNAPSHOT (Aggregated)
Coverage timestamp: Fri Apr 22 2011 04:03:20 EST
../../../../../../img/srcFileCovDistChart0.png 53% of files have more coverage
12   56   4   12
0   28   0.33   1
1     4  
1    
 
  PrincipalAccessor       Line # 27 12 0% 4 13 0% 0.0
 
No Tests
 
1    /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10    * software distributed under the License is distributed on an "AS IS"
11    * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12    * or implied. See the License for the specific language governing
13    * permissions and limitations under the License.
14    */
15   
16    package org.kuali.student.common.ws.security;
17   
18    import javax.xml.ws.WebServiceContext;
19   
20    import org.apache.log4j.Logger;
21   
22    /**
23    *
24    * @author Will Gomes
25    *
26    */
 
27    public class PrincipalAccessor {
28   
29    final static Logger logger = Logger.getLogger(PrincipalAccessor.class);
30   
 
31  0 toggle public static PrincipalWrapper getPrincipalFromWebServiceContext(WebServiceContext wsContext){
32  0 Class<?> principalWrapperImpl = null;
33  0 PrincipalWrapper principal = null;
34   
35  0 try {
36  0 principalWrapperImpl =
37    (Class.forName("org.kuali.student.common.cxf.security.PrincipalWrapperImpl"));
38    } catch (ClassNotFoundException cnfe){
39  0 try{
40  0 principalWrapperImpl =
41    Class.forName("org.kuali.student.common.metro.security.PrincipalWrapperImpl");
42    } catch (ClassNotFoundException cnfe2){
43  0 logger.error("PrincpalWraper implementaion could not be found.");
44    }
45    }
46   
47  0 try{
48  0 principal = (PrincipalWrapper)principalWrapperImpl.newInstance();
49  0 principal.setPrincipal(wsContext);
50    } catch (Exception e){
51  0 logger.error("Exception occured: ", e);
52    }
53   
54  0 return principal;
55    }
56    }