Package se.inera.ifv.deletequestionsresponder.v1

Examples of se.inera.ifv.deletequestionsresponder.v1.DeleteQuestionsType


    public void setQuestionService(QuestionService questionService) {
        this.questionService = questionService;
    }

    public DeleteQuestionsResponseType deleteQuestions(AttributedURIType address, DeleteQuestionsType parameters) {
        DeleteQuestionsResponseType response = new DeleteQuestionsResponseType();
        try {
            String careUnit = parameters.getCareUnitId().getExtension();
            log.debug("DeleteQuestions called for careunit:" + careUnit);

            List<String> idValues = parameters.getQuestionId();
            Set<Long> ids = newHashSet();
            for (String idValue : idValues) {
                ids.add(Long.parseLong(idValue));
            }

            questionService.deleteQuestionsForCareUnit(careUnit, ids);
           
            log.debug(ids.size() + " questions deleted for careunit:" + careUnit);
           
            response.setResult(new ResultOfCall());
            response.getResult().setResultCode(ResultCodeEnum.OK);

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


        DeleteQuestionsResponderInterface service = new DeleteQuestionsResponderService(
                createEndpointUrlFromServiceAddress(SERVICE_ADDRESS))
                .getDeleteQuestionsResponderPort();
       
        DeleteQuestionsType parameters = new DeleteQuestionsType();
        for(QuestionType q : questions) {
            parameters.getQuestionId().add(q.getId());
        }
       
        service.deleteQuestions(logicalAddress, parameters);
       
    }
View Full Code Here

TOP

Related Classes of se.inera.ifv.deletequestionsresponder.v1.DeleteQuestionsType

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.