Skip to content
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

Commit 39ad3d8

Browse files
committed
Documentation
1 parent 474bae9 commit 39ad3d8

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpServer.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,40 @@ public static SimpleHttpServer create(final int port, final int backlog) throws
211211

212212
//
213213

214+
/**
215+
* Sets a session handler for the server.
216+
*
217+
* @param sessionHandler session handler
218+
*
219+
* @see HttpSessionHandler
220+
* @see #getHttpSessionHandler()
221+
* @since 03.03.00
222+
* @author Ktt Development
223+
*/
214224
public abstract void setHttpSessionHandler(final HttpSessionHandler sessionHandler);
215225

226+
/**
227+
* Returns the session handler for the server or null if none exists.
228+
*
229+
* @return server session handler
230+
*
231+
* @see HttpSessionHandler
232+
* @see #setHttpSessionHandler(HttpSessionHandler)
233+
* @since 03.03.00
234+
* @author Ktt Development
235+
*/
216236
public abstract HttpSessionHandler getHttpSessionHandler();
217237

238+
/**
239+
* Returns the session associated with an exchange or null if no session handler exists.
240+
*
241+
* @param exchange http exchange
242+
* @return http session
243+
*
244+
* @see HttpSession
245+
* @since 03.03.00
246+
* @author Ktt Development
247+
*/
218248
public abstract HttpSession getHttpSession(final HttpExchange exchange);
219249

220250
//

src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpServerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public final HttpSessionHandler getHttpSessionHandler(){
117117

118118
@Override
119119
public final HttpSession getHttpSession(final HttpExchange exchange){
120-
return sessionHandler.getSession(exchange);
120+
return sessionHandler != null ? sessionHandler.getSession(exchange) : null;
121121
}
122122

123123
//

0 commit comments

Comments
 (0)