View Javadoc
1   /*
2    * Copyright (c) 2002-2014, Mairie de Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.plugins.mylutece.modules.persona.authentication;
35  
36  
37  /**
38   * PersonaAuthResponse
39   */
40  public class PersonaAuthValidation
41  {
42      public static final String STATUS_OK = "okay";
43      public static final String STATUS_FAILURE = "failure";
44  
45      // Variables declarations 
46      private String _strStatus;
47      private String _strEmail;
48      private String _strAudience;
49      private int _nExpires;
50      private String _strIssuer;
51      private String _strReason;
52  
53      /**
54       * Returns the Status
55       *
56       * @return The Status
57       */
58      public String getStatus(  )
59      {
60          return _strStatus;
61      }
62  
63      /**
64       * Sets the Status
65       *
66       * @param strStatus The Status
67       */
68      public void setStatus( String strStatus )
69      {
70          _strStatus = strStatus;
71      }
72  
73      /**
74       * Returns the Email
75       *
76       * @return The Email
77       */
78      public String getEmail(  )
79      {
80          return _strEmail;
81      }
82  
83      /**
84       * Sets the Email
85       *
86       * @param strEmail The Email
87       */
88      public void setEmail( String strEmail )
89      {
90          _strEmail = strEmail;
91      }
92  
93      /**
94       * Returns the Audience
95       *
96       * @return The Audience
97       */
98      public String getAudience(  )
99      {
100         return _strAudience;
101     }
102 
103     /**
104      * Sets the Audience
105      *
106      * @param strAudience The Audience
107      */
108     public void setAudience( String strAudience )
109     {
110         _strAudience = strAudience;
111     }
112 
113     /**
114      * Returns the Expires
115      *
116      * @return The Expires
117      */
118     public int getExpires(  )
119     {
120         return _nExpires;
121     }
122 
123     /**
124      * Sets the Expires
125      *
126      * @param nExpires The Expires
127      */
128     public void setExpires( int nExpires )
129     {
130         _nExpires = nExpires;
131     }
132 
133     /**
134      * Returns the Issuer
135      *
136      * @return The Issuer
137      */
138     public String getIssuer(  )
139     {
140         return _strIssuer;
141     }
142 
143     /**
144      * Sets the Issuer
145      *
146      * @param strIssuer The Issuer
147      */
148     public void setIssuer( String strIssuer )
149     {
150         _strIssuer = strIssuer;
151     }
152 
153     /**
154      * Returns the Reason
155      *
156      * @return The Reason
157      */
158     public String getReason(  )
159     {
160         return _strReason;
161     }
162 
163     /**
164      * Sets the Reason
165      *
166      * @param strReason The Reason
167      */
168     public void setReason( String strReason )
169     {
170         _strReason = strReason;
171     }
172 
173     /**
174      * Returns the authetication status
175      * @return true if Okay otherwise false
176      */
177     public boolean isOK(  )
178     {
179         return _strStatus.equalsIgnoreCase( STATUS_OK );
180     }
181 }