CAS Unit Tests
Clover coverage report - CAS Unit Tests
Coverage timestamp: Mon Jul 4 2005 18:13:17 CDT
file stats: LOC: 147   Methods: 16
NCLOC: 82   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ClientParams.java 0% 0% 0% 0%
coverage
 1    /*
 2    * Portions of this file Copyright 1999-2005 University of Chicago
 3    * Portions of this file Copyright 1999-2005 The University of Southern California.
 4    *
 5    * This file or a portion of this file is licensed under the
 6    * terms of the Globus Toolkit Public License, found at
 7    * http://www.globus.org/toolkit/download/license.html.
 8    * If you redistribute this file, with or without
 9    * modifications, you must include this notice in the file.
 10    */
 11    package org.globus.cas.impl.client;
 12   
 13    import org.globus.wsrf.impl.security.authentication.Constants;
 14   
 15    /**
 16    * This class is used to define parameters for generating CAS
 17    * assertions.
 18    */
 19    public class ClientParams {
 20   
 21    private int assertionLifetime = 24 * 60 * 60;
 22    private String proxyFilename = null;
 23    private String casProxyFilename = null;
 24    private String casProxyTag = null;
 25    private ResourceActionsMap[] resActions = null;
 26    private String securityType = Constants.GSI_SEC_MSG;
 27    private Object protectionType = Constants.SIGNATURE;
 28    /**
 29    * By default, assertion lifetime is set to 24 hours,
 30    * default proxy file is used, the cas proxy is named with a .cas
 31    * tag at the end of proxy file.
 32    */
 33  0 public ClientParams() {
 34    }
 35   
 36    /**
 37    * @param assertionLifetime
 38    * Requested lifetime of the generated CAS assertion
 39    */
 40  0 public void setAssertionLifetime(int assertionLifetime) {
 41  0 this.assertionLifetime = assertionLifetime;
 42    }
 43   
 44    /**
 45    * @param proxyFilename
 46    * Name of the file to get credential from.
 47    */
 48  0 public void setProxyFileName(String proxyFilename) {
 49  0 this.proxyFilename = proxyFilename;
 50    }
 51   
 52    /**
 53    * @param casProxyFilename
 54    * Name of the file store proxy with CAS assertions.
 55    */
 56  0 public void setCasProxyFileName(String casProxyFilename) {
 57  0 this.casProxyFilename = casProxyFilename;
 58    }
 59   
 60    /**
 61    * @param <code>ResourceActionsMap</code>
 62    * Array of resource:actions mapping to generate assertions on
 63    */
 64  0 public void setResourceActionsMap(ResourceActionsMap[] resActions) {
 65  0 this.resActions = resActions;
 66    }
 67   
 68    /**
 69    * @param tag
 70    * Tag to append to proxy file name to generate file name
 71    * for proxy with CAS assertion. Used only if
 72    * casProxyFileName is null.
 73    */
 74  0 public void setCasProxyTag(String tag) {
 75  0 this.casProxyTag = tag;
 76    }
 77   
 78  0 public void setSecurityType(String secType) {
 79  0 this.securityType = secType;
 80    }
 81   
 82  0 public void setProtectionType(Object protType) {
 83  0 if (protType != null) {
 84  0 this.protectionType = protType;
 85    }
 86    }
 87   
 88  0 public String getSecurityType() {
 89  0 return this.securityType;
 90    }
 91   
 92  0 public Object getProtectionType() {
 93  0 return this.protectionType;
 94    }
 95   
 96  0 public int getAssertionLifetime() {
 97  0 return this.assertionLifetime;
 98    }
 99   
 100  0 public String getProxyFileName() {
 101  0 return this.proxyFilename;
 102    }
 103   
 104  0 public String getCasProxyTag() {
 105  0 return this.casProxyTag;
 106    }
 107   
 108  0 public String getCasProxyFileName() {
 109  0 return this.casProxyFilename;
 110    }
 111   
 112  0 public ResourceActionsMap[] getResourceActionsMap() {
 113  0 return this.resActions;
 114    }
 115   
 116  0 public String toString() {
 117  0 String returnString;
 118  0 if (this.proxyFilename == null)
 119  0 returnString = "Proxy file name not set \n";
 120    else
 121  0 returnString = "Proxy file name is " + this.proxyFilename + "\n";
 122   
 123  0 if (this.casProxyFilename == null)
 124  0 returnString = returnString + "CAS Proxy file name not set \n";
 125    else
 126  0 returnString = returnString + "CAS Proxy file name is "
 127    + this.casProxyFilename + "\n";
 128   
 129  0 returnString = returnString + "Requested assertion life time is " +
 130    this.assertionLifetime + "\n";
 131   
 132  0 returnString = returnString + "Cas proxy tag is " + this.casProxyTag
 133    + "\n";
 134   
 135  0 returnString = returnString + "Security type " + this.securityType
 136    + "Protection type " + this.protectionType;
 137   
 138  0 if (this.resActions != null) {
 139  0 returnString = returnString + "Resource/Actions: \n";
 140  0 for (int i=0; i<resActions.length; i++) {
 141  0 returnString = returnString + resActions[i].toString();
 142    }
 143    }
 144  0 return returnString;
 145    }
 146    }
 147