Coverage Report - org.acegisecurity.ui.cas.ServiceProperties
 
Classes in this File Line Coverage Branch Coverage Complexity
ServiceProperties
100% 
100% 
1.4
 
 1  
 /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
 2  
  *
 3  
  * Licensed under the Apache License, Version 2.0 (the "License");
 4  
  * you may not use this file except in compliance with the License.
 5  
  * You may obtain a copy of the License at
 6  
  *
 7  
  *     http://www.apache.org/licenses/LICENSE-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing, software
 10  
  * distributed under the License is distributed on an "AS IS" BASIS,
 11  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12  
  * See the License for the specific language governing permissions and
 13  
  * limitations under the License.
 14  
  */
 15  
 
 16  
 package org.acegisecurity.ui.cas;
 17  
 
 18  
 import org.springframework.beans.factory.InitializingBean;
 19  
 
 20  
 
 21  
 /**
 22  
  * Stores properties related to this CAS service.<P>Each web application capable of processing CAS tickets is known
 23  
  * as a service. This class stores the properties that are relevant to the local CAS service, being the application
 24  
  * that is being secured by the Acegi Security System for Spring.</p>
 25  
  *
 26  
  * @author Ben Alex
 27  
  * @version $Id: ServiceProperties.java 1496 2006-05-23 13:38:33Z benalex $
 28  
  */
 29  9
 public class ServiceProperties implements InitializingBean {
 30  
     //~ Instance fields ================================================================================================
 31  
 
 32  
     private String service;
 33  9
     private boolean sendRenew = false;
 34  
 
 35  
     //~ Methods ========================================================================================================
 36  
 
 37  
     public void afterPropertiesSet() throws Exception {
 38  2
         if ((service == null) || "".equals(service)) {
 39  1
             throw new IllegalArgumentException("service must be specified");
 40  
         }
 41  1
     }
 42  
 
 43  
     /**
 44  
      * Represents the service the user is authenticating to.<p>This service is the callback URL belonging to
 45  
      * the local Acegi Security System for Spring secured application. For example,</p>
 46  
      *  <code>https://www.mycompany.com/application/j_acegi_cas_security_check</code>
 47  
      *
 48  
      * @return the URL of the service the user is authenticating to
 49  
      */
 50  
     public String getService() {
 51  6
         return service;
 52  
     }
 53  
 
 54  
     /**
 55  
      * Indicates whether the <code>renew</code> parameter should be sent to the CAS login URL and CAS
 56  
      * validation URL.<p>If <code>true</code>, it will force CAS to authenticate the user again (even if the
 57  
      * user has previously authenticated). During ticket validation it will require the ticket was generated as a
 58  
      * consequence of an explicit login. High security applications would probably set this to <code>true</code>.
 59  
      * Defaults to <code>false</code>, providing automated single sign on.</p>
 60  
      *
 61  
      * @return whether to send the <code>renew</code> parameter to CAS
 62  
      */
 63  
     public boolean isSendRenew() {
 64  7
         return sendRenew;
 65  
     }
 66  
 
 67  
     public void setSendRenew(boolean sendRenew) {
 68  5
         this.sendRenew = sendRenew;
 69  5
     }
 70  
 
 71  
     public void setService(String service) {
 72  4
         this.service = service;
 73  4
     }
 74  
 }