View Javadoc

1   /**
2    * Copyright (C) 2005-2009 Alfresco Software Limited.
3    *
4    * This file is part of the Spring Surf Extension project.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *  http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  package org.springframework.extensions.webscripts;
20  
21  
22  /**
23   * Web Script Status (version 2.x)
24   * 
25   * NOTE: PROVIDED FOR BACKWARDS COMPATIBILITY ONLY - see org.alfresco.web.scripts.Statust
26   * 
27   * @author davidc
28   * @deprecated
29   */
30  public class WebScriptStatus
31  {
32      private Status status;;
33      
34      /**
35       * Construct
36       * 
37       * @param status
38       */
39      public WebScriptStatus(Status status)
40      {
41          this.status = status;
42      }
43      
44      /**
45       * @param exception
46       */
47      public void setException(Throwable exception)
48      {
49          status.setException(exception);
50      }
51  
52      /**
53       * @return  exception
54       */
55      public Throwable getException()
56      {
57          return status.getException();
58      }
59      
60      /**
61       * @param message
62       */
63      public void setMessage(String message)
64      {
65          status.setMessage(message);
66      }
67  
68      /**
69       * @return  message
70       */
71      public String getMessage()
72      {
73          return status.getMessage();
74      }
75  
76      /**
77       * @param redirect  redirect to status code response
78       */
79      public void setRedirect(boolean redirect)
80      {
81          status.setRedirect(redirect);
82      }
83  
84      /**
85       * @return redirect to status code response
86       */
87      public boolean getRedirect()
88      {
89          return status.getRedirect();
90      }
91  
92      /**
93       * @see javax.servlet.http.HTTPServletResponse
94       * 
95       * @param code  status code
96       */
97      public void setCode(int code)
98      {
99          status.setCode(code);
100     }
101 
102     /**
103      * @return  status code
104      */
105     public int getCode()
106     {
107         return status.getCode();
108     }
109 
110     /**
111      * Gets the short name of the status code
112      * 
113      * @return  status code name
114      */
115     public String getCodeName()
116     {
117         return status.getCodeName();
118     }
119     
120     /**
121      * Gets the description of the status code
122      * 
123      * @return  status code description
124      */
125     public String getCodeDescription()
126     {
127         return status.getCodeDescription();
128     }
129     
130 }