Eradicating WebApplicationException from RequestHandlers.
This commit is contained in:
@@ -36,7 +36,6 @@ public class LoggedUserHolder {
|
||||
if (value != null) {
|
||||
String loggedUser = _users.get(value);
|
||||
if (loggedUser != null) {
|
||||
System.out.println("Update last access");
|
||||
_lastAccess.put(value, System.currentTimeMillis());
|
||||
return loggedUser;
|
||||
}
|
||||
|
||||
@@ -17,8 +17,6 @@ import org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import javax.ws.rs.WebApplicationException;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
@@ -71,7 +69,7 @@ public class DeckRequestHandler extends LotroServerRequestHandler implements Uri
|
||||
|
||||
LotroDeck deck = _lotroServer.createDeckWithValidate("tempDeck", contents);
|
||||
if (deck == null)
|
||||
throw new WebApplicationException(Response.Status.BAD_REQUEST);
|
||||
throw new HttpProcessingException(400);
|
||||
|
||||
int fpCount = 0;
|
||||
int shadowCount = 0;
|
||||
@@ -161,7 +159,7 @@ public class DeckRequestHandler extends LotroServerRequestHandler implements Uri
|
||||
LotroDeck deck = _deckDao.getDeckForPlayer(resourceOwner, deckName);
|
||||
|
||||
if (deck == null)
|
||||
throw new WebApplicationException(Response.Status.NOT_FOUND);
|
||||
throw new HttpProcessingException(404);
|
||||
|
||||
StringBuilder result = new StringBuilder();
|
||||
result.append("<html><body>");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gempukku.lotro.async.handler;
|
||||
|
||||
import com.gempukku.lotro.async.HttpProcessingException;
|
||||
import com.gempukku.lotro.async.ResponseWriter;
|
||||
import com.gempukku.lotro.collection.TransferDAO;
|
||||
import com.gempukku.lotro.game.CardCollection;
|
||||
@@ -10,8 +11,6 @@ import org.jboss.netty.handler.codec.http.HttpRequest;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import javax.ws.rs.WebApplicationException;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.lang.reflect.Type;
|
||||
@@ -38,7 +37,7 @@ public class DeliveryRequestHandler extends LotroServerRequestHandler implements
|
||||
Player resourceOwner = getResourceOwnerSafely(request, null);
|
||||
Map<String, ? extends CardCollection> delivery = _transferDAO.consumeUndeliveredPackages(resourceOwner.getName());
|
||||
if (delivery == null)
|
||||
throw new WebApplicationException(Response.Status.NOT_FOUND);
|
||||
throw new HttpProcessingException(404);
|
||||
|
||||
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gempukku.lotro.async.handler;
|
||||
|
||||
import com.gempukku.lotro.async.HttpProcessingException;
|
||||
import com.gempukku.lotro.async.ResponseWriter;
|
||||
import com.gempukku.lotro.db.vo.GameHistoryEntry;
|
||||
import com.gempukku.lotro.game.GameHistoryService;
|
||||
@@ -11,8 +12,6 @@ import org.jboss.netty.handler.codec.http.QueryStringDecoder;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import javax.ws.rs.WebApplicationException;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.lang.reflect.Type;
|
||||
@@ -37,7 +36,7 @@ public class GameHistoryRequestHandler extends LotroServerRequestHandler impleme
|
||||
int count = Integer.parseInt(getQueryParameterSafely(queryDecoder, "count"));
|
||||
|
||||
if (start < 0 || count < 1 || count > 100)
|
||||
throw new WebApplicationException(Response.Status.BAD_REQUEST);
|
||||
throw new HttpProcessingException(400);
|
||||
|
||||
Player resourceOwner = getResourceOwnerSafely(request, participantId);
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@ import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import javax.ws.rs.WebApplicationException;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.lang.reflect.Type;
|
||||
@@ -154,7 +152,7 @@ public class GameRequestHandler extends LotroServerRequestHandler implements Uri
|
||||
|
||||
LotroGameMediator gameMediator = _lotroServer.getGameById(gameId);
|
||||
if (gameMediator == null)
|
||||
throw new WebApplicationException(Response.Status.NOT_FOUND);
|
||||
throw new HttpProcessingException(404);
|
||||
|
||||
gameMediator.cancel(resourceOwner);
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@ import org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import javax.ws.rs.WebApplicationException;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.lang.reflect.Type;
|
||||
@@ -83,7 +81,7 @@ public class LeagueRequestHandler extends LotroServerRequestHandler implements U
|
||||
League league = getLeagueByType(leagueType);
|
||||
|
||||
if (league == null)
|
||||
throw new WebApplicationException(Response.Status.NOT_FOUND);
|
||||
throw new HttpProcessingException(404);
|
||||
|
||||
final LeagueData leagueData = league.getLeagueData();
|
||||
final List<LeagueSerieData> series = leagueData.getSeries();
|
||||
|
||||
@@ -12,8 +12,6 @@ import org.jboss.netty.handler.codec.http.QueryStringDecoder;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import javax.ws.rs.WebApplicationException;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.lang.reflect.Type;
|
||||
@@ -55,7 +53,7 @@ public class ServerStatsRequestHandler extends LotroServerRequestHandler impleme
|
||||
else if (length.equals("day"))
|
||||
to.setDate(to.getDate() + 1);
|
||||
else
|
||||
throw new WebApplicationException(Response.Status.BAD_REQUEST);
|
||||
throw new HttpProcessingException(400);
|
||||
long duration = to.getTime() - from;
|
||||
|
||||
int activePlayers = _gameHistoryService.getActivePlayersCount(from, duration);
|
||||
|
||||
@@ -19,8 +19,6 @@ import org.jboss.netty.handler.codec.http.HttpRequest;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import javax.ws.rs.WebApplicationException;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.lang.reflect.Type;
|
||||
@@ -66,7 +64,7 @@ public class TournamentRequestHandler extends LotroServerRequestHandler implemen
|
||||
|
||||
Tournament tournament = _tournamentService.getTournamentById(tournamentId);
|
||||
if (tournament == null)
|
||||
throw new WebApplicationException(Response.Status.NOT_FOUND);
|
||||
throw new HttpProcessingException(404);
|
||||
|
||||
Element tournamentElem = doc.createElement("tournament");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user