13
13
14
14
package com .amazon .ask .servlet ;
15
15
16
- import javax .servlet .http .HttpServlet ;
17
- import javax .servlet .http .HttpServletRequest ;
18
- import javax .servlet .http .HttpServletResponse ;
19
-
20
- import java .io .ByteArrayInputStream ;
21
- import java .io .ByteArrayOutputStream ;
22
- import java .io .InputStream ;
23
- import java .io .IOException ;
24
- import java .io .NotSerializableException ;
25
- import java .io .ObjectInputStream ;
26
- import java .io .ObjectOutputStream ;
27
- import java .io .OutputStream ;
28
- import java .net .Proxy ;
29
- import java .util .ArrayList ;
30
- import java .util .List ;
31
-
32
16
import com .amazon .ask .Skill ;
33
17
import com .amazon .ask .exception .AskSdkException ;
34
18
import com .amazon .ask .model .RequestEnvelope ;
35
19
import com .amazon .ask .model .services .Serializer ;
36
20
import com .amazon .ask .request .impl .BaseSkillRequest ;
37
21
import com .amazon .ask .response .SkillResponse ;
38
22
import com .amazon .ask .servlet .util .ServletUtils ;
39
- import com .amazon .ask .servlet .verifiers .AlexaHttpRequest ;
40
- import com .amazon .ask .servlet .verifiers .ServletRequest ;
41
- import com .amazon .ask .servlet .verifiers .SkillRequestSignatureVerifier ;
42
- import com .amazon .ask .servlet .verifiers .SkillRequestTimestampVerifier ;
43
- import com .amazon .ask .servlet .verifiers .SkillServletVerifier ;
23
+ import com .amazon .ask .servlet .verifiers .*;
44
24
import com .amazon .ask .util .JacksonSerializer ;
25
+ import jakarta .servlet .http .HttpServlet ;
26
+ import jakarta .servlet .http .HttpServletRequest ;
27
+ import jakarta .servlet .http .HttpServletResponse ;
45
28
import org .apache .commons .io .IOUtils ;
46
29
import org .slf4j .Logger ;
47
30
import org .slf4j .LoggerFactory ;
48
31
32
+ import java .io .*;
33
+ import java .net .Proxy ;
34
+ import java .util .ArrayList ;
35
+ import java .util .List ;
36
+
49
37
import static com .amazon .ask .servlet .ServletConstants .DEFAULT_TOLERANCE_MILLIS ;
50
38
51
39
/**
58
46
* invocation of the right method of the provided {@code Skill} . It also handles sending back
59
47
* modified session attributes, user attributes and authentication tokens when needed and handles
60
48
* exception cases.
61
- *
62
49
*/
63
50
public class SkillServlet extends HttpServlet {
64
51
/**
@@ -90,6 +77,7 @@ public class SkillServlet extends HttpServlet {
90
77
91
78
/**
92
79
* Constructor to build an instance of SkillServlet.
80
+ *
93
81
* @param skill an Alexa skill instance.
94
82
*/
95
83
public SkillServlet (final Skill skill ) {
@@ -106,7 +94,8 @@ public SkillServlet(final Skill skill) {
106
94
107
95
/**
108
96
* Constructor to build an instance of SkillServlet.
109
- * @param skill instance of {@link Skill}.
97
+ *
98
+ * @param skill instance of {@link Skill}.
110
99
* @param verifiers list of {@link SkillServletVerifier}.
111
100
*/
112
101
SkillServlet (final Skill skill , final List <SkillServletVerifier > verifiers ) {
@@ -166,7 +155,7 @@ protected void doPost(final HttpServletRequest request, final HttpServletRespons
166
155
* {@code SkillServlet} determines the type of request and passes the request to
167
156
* the configured {@code Skill}.
168
157
*
169
- * @param input - input stream of the request.
158
+ * @param input - input stream of the request.
170
159
* @param output - output stream of the response.
171
160
* @throws IOException if an input or output error is detected when the servlet handles the request
172
161
*/
@@ -198,8 +187,9 @@ public void setProxy(final Proxy proxy) {
198
187
199
188
/**
200
189
* Method throws an {@link NotSerializableException} if the servlet is not serializable.
190
+ *
201
191
* @param in instance of {@link ObjectInputStream}.
202
- * @throws IOException I/O exception.
192
+ * @throws IOException I/O exception.
203
193
* @throws ClassNotFoundException cannot a class through its fully-qualified name and can not find its definition on the classpath.
204
194
*/
205
195
private void readObject (final ObjectInputStream in ) throws IOException , ClassNotFoundException {
@@ -208,6 +198,7 @@ private void readObject(final ObjectInputStream in) throws IOException, ClassNot
208
198
209
199
/**
210
200
* Method throws an {@link NotSerializableException} if the servlet is not serializable.
201
+ *
211
202
* @param out instance of {@link ObjectOutputStream}.
212
203
* @throws IOException I/O exception.
213
204
*/
0 commit comments