Package se.inera.ifv.deleteanswersresponder.v1

Examples of se.inera.ifv.deleteanswersresponder.v1.DeleteAnswersType


    public void setAnswerService(AnswerService answerService) {
        this.answerService = answerService;
    }
   
    public DeleteAnswersResponseType deleteAnswers(AttributedURIType address, DeleteAnswersType parameters) {
        DeleteAnswersResponseType response = new DeleteAnswersResponseType();
        try {
            String careUnit = parameters.getCareUnitId().getExtension();
            log.debug("DeleteAnswers called for careunit:" + careUnit);

            List<String> idValues = parameters.getAnswerId();
            Set<Long> ids = newHashSet();
            for (String idValue : idValues) {
                ids.add(Long.parseLong(idValue));
            }
            answerService.deleteAnswersForCareUnit(careUnit, ids);

            log.debug(ids.size() + " answers deleted for careunit:" + careUnit);

            response.setResult(new ResultOfCall());
            response.getResult().setResultCode(ResultCodeEnum.OK);

        } catch (Exception e) {
            log.warn("Error handling DeleteAnswer message", e);
            // FIXME: Improved error handling
            response.setResult(new ResultOfCall());
            response.getResult().setErrorText(e.getMessage());
            response.getResult().setResultCode(ResultCodeEnum.ERROR);
        }
        return response;
    }
View Full Code Here


        DeleteAnswersResponderInterface service = new DeleteAnswersResponderService(
                createEndpointUrlFromServiceAddress(SERVICE_ADDRESS))
                .getDeleteAnswersResponderPort();
       
        DeleteAnswersType parameters = new DeleteAnswersType();
        for(AnswerType a : answer) {
            parameters.getAnswerId().add(a.getId());
        }
       
        service.deleteAnswers(logicalAddress, parameters);
       
    }
View Full Code Here

TOP

Related Classes of se.inera.ifv.deleteanswersresponder.v1.DeleteAnswersType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.