From 21835c3992570b981a85bd9f4eeab2e623d863dd Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 11 Feb 2009 20:12:17 +0000 Subject: GetStatusRequest git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@305 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../stal/service/translator/STALTranslator.java | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'STALService/src/main/java/at/gv/egiz/stal/service/translator') diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/translator/STALTranslator.java b/STALService/src/main/java/at/gv/egiz/stal/service/translator/STALTranslator.java index a52de482..1e6f4133 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/service/translator/STALTranslator.java +++ b/STALService/src/main/java/at/gv/egiz/stal/service/translator/STALTranslator.java @@ -24,6 +24,8 @@ import at.gv.egiz.stal.STALRequest; import at.gv.egiz.stal.STALResponse; import at.gv.egiz.stal.SignRequest; import at.gv.egiz.stal.SignResponse; +import at.gv.egiz.stal.StatusRequest; +import at.gv.egiz.stal.StatusResponse; import at.gv.egiz.stal.service.types.ErrorResponseType; import at.gv.egiz.stal.service.types.InfoboxReadRequestType; import at.gv.egiz.stal.service.types.InfoboxReadResponseType; @@ -33,6 +35,8 @@ import at.gv.egiz.stal.service.types.RequestType; import at.gv.egiz.stal.service.types.ResponseType; import at.gv.egiz.stal.service.types.SignRequestType; import at.gv.egiz.stal.service.types.SignResponseType; +import at.gv.egiz.stal.service.types.StatusRequestType; +import at.gv.egiz.stal.service.types.StatusResponseType; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -181,15 +185,19 @@ public class STALTranslator { return Arrays.asList(new Class[]{InfoboxReadRequest.class, SignRequest.class, QuitRequest.class, + StatusRequest.class, InfoboxReadRequestType.class, SignRequestType.class, QuitRequestType.class, + StatusRequestType.class, InfoboxReadResponse.class, SignResponse.class, ErrorResponse.class, + StatusResponse.class, InfoboxReadResponseType.class, SignResponseType.class, - ErrorResponseType.class + ErrorResponseType.class, + StatusResponseType.class }); } @@ -209,6 +217,9 @@ public class STALTranslator { return of.createGetNextRequestResponseTypeInfoboxReadRequest(req); } else if (request instanceof QuitRequest) { return of.createGetNextRequestResponseTypeQuitRequest(of.createQuitRequestType()); + } else if (request instanceof StatusRequest) { + StatusRequestType req = of.createStatusRequestType(); + return of.createGetNextRequestResponseTypeStatusRequest(req); } throw new TranslationException(request.getClass()); } @@ -227,6 +238,8 @@ public class STALTranslator { return stalReq; } else if (request instanceof QuitRequestType) { return new QuitRequest(); + } else if (request instanceof StatusRequestType) { + return new StatusRequest(); } throw new TranslationException(request.getClass()); } @@ -246,6 +259,10 @@ public class STALTranslator { resp.setErrorCode(((ErrorResponse) response).getErrorCode()); resp.setErrorMessage(((ErrorResponse) response).getErrorMessage()); return of.createGetNextRequestTypeErrorResponse(resp); + } else if (response instanceof StatusResponse) { + StatusResponseType resp = of.createStatusResponseType(); + resp.setCardReady(((StatusResponse) response).isCardReady()); + return of.createGetNextRequestTypeStatusResponse(resp); } throw new TranslationException(response.getClass()); } @@ -265,6 +282,10 @@ public class STALTranslator { stalResp.setErrorCode(((ErrorResponseType) response).getErrorCode()); stalResp.setErrorMessage(((ErrorResponseType) response).getErrorMessage()); return stalResp; + } else if (response instanceof StatusResponseType) { + StatusResponse stalResp = new StatusResponse(); + stalResp.setCardReady(((StatusResponseType) response).isCardReady()); + return stalResp; } throw new TranslationException(response.getClass()); } -- cgit v1.2.3