1 /* 2 * Copyright 2011 The Kuali Foundation 3 * 4 * Licensed under the Educational Community License, Version 2.0 (the 5 * "License"); you may not use this file except in compliance with the 6 * License. You may obtain a copy of the License at 7 * 8 * http://www.osedu.org/licenses/ECL-2.0 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 13 * implied. See the License for the specific language governing 14 * permissions and limitations under the License. 15 */ 16 17 package org.kuali.student.r2.common.infc; 18 19 import java.util.Date; 20 21 /* 22 * This is a generic context container to be used by services to pass 23 * user identity and preferences 24 * 25 * Note: 26 * 1. ISO3 standard can now be interpreted by looking at the 27 * language and country codes 28 * 2. Time zone is defined in GMT +/- hours and minutes format 29 * 3. Should Locale contain currency? 30 * 31 * References: 32 * ftp://ftp.rfc-editor.org/in-notes/bcp/bcp47.txt 33 * http://download.oracle.com/javase/1.4.2/docs/api/java/util/TimeZone.html 34 * 35 * @author Kamal 36 * 37 * @Version 2.0 38 * @Author Sri komandur@uw.edu 39 */ 40 41 public interface Context 42 extends HasAttributes { 43 44 /** 45 * The Principal Id of the currently authenticated user. 46 * 47 * @name Authenticated Principal Id 48 */ 49 public String getAuthenticatedPrincipalId(); 50 51 /** 52 * The Principal Id of the principal on whose behalf the 53 * authenticated principal is acting. If the authenticated 54 * principal is not acting on behalf of a different user, then 55 * this Id should be the same as the Authenticated Principal Id. 56 * 57 * (1) User is authorized to only act on behalf of 58 * itself. Principal Id must equal the Authenticated Principal Id 59 * and the authorization is performed on that Id. If the Principal 60 * Id differs from the Authenticated Principal Id, then the user 61 * is not authorized to perform the requested operation. 62 * 63 * (2) User is authorized to act on behalf of another user. The 64 * Principal Id differs from the Authentication Principal 65 * Id. Authorization is checked to see if Authenticated Principal 66 * Id can perform the operation on behalf of Principal Id. Then, 67 * authorization is checked to see if Principal Id can perform the 68 * operation. 69 * 70 * @name Principal Id 71 */ 72 public String getPrincipalId(); 73 74 /** 75 * The current date in this context. This date is used to instruct 76 * the provider to peform operations as if this date were the 77 * current date. 78 * 79 * @name Current Date 80 */ 81 public Date getCurrentDate(); 82 83 /** 84 * The locale information requested by the user. 85 * 86 * @name Locale 87 */ 88 public Locale getLocale(); 89 90 /** 91 * The time zone requested by the user. 92 * 93 * @name Time Zone 94 */ 95 public String getTimeZone(); 96 } 97