View Javadoc
1   /*
2    * Copyright 2010 James Pether Sörling
3    *
4    * Licensed under the Apache 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.apache.org/licenses/LICENSE-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 implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   *	$Id$
17   *  $HeadURL$
18  */
19  package com.hack23.cia.service.api.action.user;
20  
21  import java.util.ArrayList;
22  import java.util.List;
23  import java.util.stream.Collectors;
24  
25  import com.hack23.cia.service.api.action.common.AbstractResponse;
26  
27  
28  /**
29   * The Class SetGoogleAuthenticatorCredentialResponse.
30   */
31  public final class SetGoogleAuthenticatorCredentialResponse extends AbstractResponse {
32  
33  	/** The Constant serialVersionUID. */
34  	private static final long serialVersionUID = 1L;
35  
36  
37      /** The google auth key. */
38      private String googleAuthKey;
39  
40      /** The google auth verification code. */
41      private Integer googleAuthVerificationCode;
42  
43      /** The google auth scratch codes. */
44      private List<Integer> googleAuthScratchCodes = new ArrayList<>();
45  
46      /** The otp auth totp url. */
47      private String otpAuthTotpURL;
48  
49  	/**
50  	 * Instantiates a new sets the google authenticator credential response.
51  	 *
52  	 * @param result
53  	 *            the result
54  	 */
55  	public SetGoogleAuthenticatorCredentialResponse(final ServiceResult result) {
56  		super(result);
57  	}
58  
59  	/**
60  	 * Gets the google auth key.
61  	 *
62  	 * @return the google auth key
63  	 */
64  	public String getGoogleAuthKey() {
65  		return googleAuthKey;
66  	}
67  
68  	/**
69  	 * Sets the google auth key.
70  	 *
71  	 * @param googleAuthKey
72  	 *            the new google auth key
73  	 */
74  	public void setGoogleAuthKey(String googleAuthKey) {
75  		this.googleAuthKey = googleAuthKey;
76  	}
77  
78  	/**
79  	 * Gets the google auth verification code.
80  	 *
81  	 * @return the google auth verification code
82  	 */
83  	public Integer getGoogleAuthVerificationCode() {
84  		return googleAuthVerificationCode;
85  	}
86  
87  	/**
88  	 * Sets the google auth verification code.
89  	 *
90  	 * @param googleAuthVerificationCode
91  	 *            the new google auth verification code
92  	 */
93  	public void setGoogleAuthVerificationCode(Integer googleAuthVerificationCode) {
94  		this.googleAuthVerificationCode = googleAuthVerificationCode;
95  	}
96  
97  	/**
98  	 * Gets the google auth scratch codes.
99  	 *
100 	 * @return the google auth scratch codes
101 	 */
102 	public List<Integer> getGoogleAuthScratchCodes() {
103 		return googleAuthScratchCodes.stream().collect(Collectors.toList());
104 	}
105 
106 	/**
107 	 * Sets the google auth scratch codes.
108 	 *
109 	 * @param googleAuthScratchCodes
110 	 *            the new google auth scratch codes
111 	 */
112 	public void setGoogleAuthScratchCodes(List<Integer> googleAuthScratchCodes) {
113 		if (googleAuthScratchCodes != null) {
114 			this.googleAuthScratchCodes = googleAuthScratchCodes.stream().collect(Collectors.toList());
115 		}
116 	}
117 
118 	/**
119 	 * Gets the otp auth totp url.
120 	 *
121 	 * @return the otp auth totp url
122 	 */
123 	public String getOtpAuthTotpURL() {
124 		return otpAuthTotpURL;
125 	}
126 
127 	/**
128 	 * Sets the otp auth totp url.
129 	 *
130 	 * @param otpAuthTotpURL
131 	 *            the new otp auth totp url
132 	 */
133 	public void setOtpAuthTotpURL(String otpAuthTotpURL) {
134 		this.otpAuthTotpURL = otpAuthTotpURL;
135 	}
136 
137 }