View Javadoc

1   /*
2   Copyright 2010 James Pether Sörling Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 
3   	$Id
4   */
5   
6   package com.hack23.cia.service.api.common;
7   
8   import com.hack23.cia.model.application.dto.common.UserSessionDTO;
9   
10  /***
11   * The Class ErrorResponse.
12   */
13  public class ErrorResponse extends AbstractServiceResponse {
14  
15      /*** The Constant serialVersionUID. */
16      private static final long serialVersionUID = 1L;
17  
18      /*** The error message. */
19      private final String errorMessage;
20  
21      /***
22       * Instantiates a new error response.
23       *
24       * @param userSessionDTO the user session dto
25       * @param errorMessage the error message
26       */
27      public ErrorResponse(final UserSessionDTO userSessionDTO,
28              final String errorMessage) {
29         super(userSessionDTO);
30          this.errorMessage = errorMessage;
31      }
32  
33      /***
34       * Gets the error message.
35       *
36       * @return the error message
37       */
38      public final String getErrorMessage() {
39          return this.errorMessage;
40      }
41  
42      /*
43       * (non-Javadoc)
44       * 
45       * @see com.hack23.cia.service.api.ServiceResponse#getResult()
46       */
47      @Override
48      public final ServiceResult getResult() {
49          return ServiceResult.FAILURE;
50      }
51  
52  }