View Javadoc
1   /*
2    * Copyright 2006 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  package org.kuali.ole.fp.exception;
17  
18  import java.util.Properties;
19  
20  import org.kuali.rice.core.api.exception.KualiException;
21  
22  
23  
24  public class CashDrawerStateException extends KualiException {
25      private final String campusCode;
26      private final String controllingDocumentId;
27      private final String currentDrawerStatus;
28      private final String desiredDrawerStatus;
29      
30      private final static String CASH_DRAWER_STATE_EXCEPTION_SESSION_KEY = "CASH_DRAWER_STATE_EXCEPTION";
31  
32  
33      public CashDrawerStateException(String campusCode, String controllingDocumentId, String currentDrawerStatus, String desiredDrawerStatus) {
34          super("Cash Drawer State Exception; this exception should simply serve to redirect the page to the Cash Drawer Status page");
35          this.campusCode = campusCode;
36          this.controllingDocumentId = controllingDocumentId;
37          this.currentDrawerStatus = currentDrawerStatus;
38          this.desiredDrawerStatus = desiredDrawerStatus;
39      }
40  
41  
42      /**
43       * @return current value of campusCode.
44       */
45      public String getCampusCode() {
46          return campusCode;
47      }
48  
49      /**
50       * @return current value of currentDrawerStatus.
51       */
52      public String getCurrentDrawerStatus() {
53          return currentDrawerStatus;
54      }
55  
56      /**
57       * @return current value of desiredDrawerStatus.
58       */
59      public String getDesiredDrawerStatus() {
60          return desiredDrawerStatus;
61      }
62  
63      /**
64       * @return current value of controllingDocumentId.
65       */
66      public String getControllingDocumentId() {
67          return controllingDocumentId;
68      }
69      
70      /**
71       * Creates a Properties object, based on the properties in this exception
72       * @return a Properties object
73       */
74      public Properties toProperties() {
75          Properties properties = new Properties();
76          properties.setProperty("verificationUnit", getCampusCode());
77          properties.setProperty("controllingDocumentId", getControllingDocumentId());
78          properties.setProperty("currentDrawerStatus", getCurrentDrawerStatus());
79          properties.setProperty("desiredDrawerStatus", getDesiredDrawerStatus());
80          properties.setProperty("methodToCall", "displayPage");
81          return properties;
82      }
83  }