1313
1414package com .amazon .ask .servlet ;
1515
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-
3216import com .amazon .ask .Skill ;
3317import com .amazon .ask .exception .AskSdkException ;
3418import com .amazon .ask .model .RequestEnvelope ;
3519import com .amazon .ask .model .services .Serializer ;
3620import com .amazon .ask .request .impl .BaseSkillRequest ;
3721import com .amazon .ask .response .SkillResponse ;
3822import 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 .*;
4424import com .amazon .ask .util .JacksonSerializer ;
25+ import jakarta .servlet .http .HttpServlet ;
26+ import jakarta .servlet .http .HttpServletRequest ;
27+ import jakarta .servlet .http .HttpServletResponse ;
4528import org .apache .commons .io .IOUtils ;
4629import org .slf4j .Logger ;
4730import org .slf4j .LoggerFactory ;
4831
32+ import java .io .*;
33+ import java .net .Proxy ;
34+ import java .util .ArrayList ;
35+ import java .util .List ;
36+
4937import static com .amazon .ask .servlet .ServletConstants .DEFAULT_TOLERANCE_MILLIS ;
5038
5139/**
5846 * invocation of the right method of the provided {@code Skill} . It also handles sending back
5947 * modified session attributes, user attributes and authentication tokens when needed and handles
6048 * exception cases.
61- *
6249 */
6350public class SkillServlet extends HttpServlet {
6451 /**
@@ -90,6 +77,7 @@ public class SkillServlet extends HttpServlet {
9077
9178 /**
9279 * Constructor to build an instance of SkillServlet.
80+ *
9381 * @param skill an Alexa skill instance.
9482 */
9583 public SkillServlet (final Skill skill ) {
@@ -106,7 +94,8 @@ public SkillServlet(final Skill skill) {
10694
10795 /**
10896 * Constructor to build an instance of SkillServlet.
109- * @param skill instance of {@link Skill}.
97+ *
98+ * @param skill instance of {@link Skill}.
11099 * @param verifiers list of {@link SkillServletVerifier}.
111100 */
112101 SkillServlet (final Skill skill , final List <SkillServletVerifier > verifiers ) {
@@ -166,7 +155,7 @@ protected void doPost(final HttpServletRequest request, final HttpServletRespons
166155 * {@code SkillServlet} determines the type of request and passes the request to
167156 * the configured {@code Skill}.
168157 *
169- * @param input - input stream of the request.
158+ * @param input - input stream of the request.
170159 * @param output - output stream of the response.
171160 * @throws IOException if an input or output error is detected when the servlet handles the request
172161 */
@@ -198,8 +187,9 @@ public void setProxy(final Proxy proxy) {
198187
199188 /**
200189 * Method throws an {@link NotSerializableException} if the servlet is not serializable.
190+ *
201191 * @param in instance of {@link ObjectInputStream}.
202- * @throws IOException I/O exception.
192+ * @throws IOException I/O exception.
203193 * @throws ClassNotFoundException cannot a class through its fully-qualified name and can not find its definition on the classpath.
204194 */
205195 private void readObject (final ObjectInputStream in ) throws IOException , ClassNotFoundException {
@@ -208,6 +198,7 @@ private void readObject(final ObjectInputStream in) throws IOException, ClassNot
208198
209199 /**
210200 * Method throws an {@link NotSerializableException} if the servlet is not serializable.
201+ *
211202 * @param out instance of {@link ObjectOutputStream}.
212203 * @throws IOException I/O exception.
213204 */
0 commit comments