Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
KualiTicketResponse |
|
| 2.0;2 |
1 | /* | |
2 | * Copyright 2007-2008 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl2.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | ||
17 | package org.kuali.rice.kim.client.acegi; | |
18 | ||
19 | import java.util.List; | |
20 | ||
21 | import org.acegisecurity.providers.cas.TicketResponse; | |
22 | ||
23 | ||
24 | /** | |
25 | * Adds <code>distributedSessionToken</code> to the | |
26 | * <code>TicketResponse</code>. | |
27 | * | |
28 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
29 | * | |
30 | */ | |
31 | public class KualiTicketResponse extends TicketResponse{ | |
32 | //~ Instance fields ================================================================================================ | |
33 | ||
34 | private String distributedSessionToken; | |
35 | ||
36 | //~ Constructors =================================================================================================== | |
37 | ||
38 | /** | |
39 | * Constructor. | |
40 | * | |
41 | * <P> | |
42 | * If <code>null</code> is passed into the <code>proxyList</code> or | |
43 | * <code>proxyGrantingTicketIou</code>, suitable defaults are established. | |
44 | * However, <code>null</code> cannot be passed for the <code>user</code> | |
45 | * or <code>distributedSessionToken</code>arguments. | |
46 | * </p> | |
47 | * | |
48 | * @param user the user as indicated by CAS (cannot be <code>null</code> or | |
49 | * an empty <code>String</code>) | |
50 | * @param proxyList as provided by CAS (may be <code>null</code>) | |
51 | * @param proxyGrantingTicketIou as provided by CAS (may be | |
52 | * <code>null</code>) | |
53 | * @param distributedSessionToken as provided by CAS (may be | |
54 | * <code>null</code>) | |
55 | * | |
56 | * @throws IllegalArgumentException DOCUMENT ME! | |
57 | */ | |
58 | public KualiTicketResponse(String user, List proxyList, String proxyGrantingTicketIou, String distributedSessionToken) { | |
59 | 0 | super(user,proxyList,proxyGrantingTicketIou); |
60 | ||
61 | 0 | if ((distributedSessionToken == null) || "".equals(distributedSessionToken)) { |
62 | 0 | throw new IllegalArgumentException("Cannot pass null or empty String for distributedSessionToken"); |
63 | } | |
64 | ||
65 | 0 | this.distributedSessionToken = distributedSessionToken; |
66 | 0 | } |
67 | ||
68 | //~ Methods ======================================================================================================== | |
69 | ||
70 | ||
71 | /** | |
72 | * Returns the distributed session token | |
73 | * | |
74 | * @return | |
75 | */ | |
76 | public String getDistributedSessionToken() { | |
77 | 0 | return distributedSessionToken; |
78 | } | |
79 | ||
80 | public String toString() { | |
81 | 0 | StringBuffer sb = new StringBuffer(); |
82 | 0 | sb.append(super.toString()); |
83 | 0 | sb.append("; SessionID: " + this.distributedSessionToken); |
84 | ||
85 | 0 | return sb.toString(); |
86 | } | |
87 | } |