Package org.wijiscommons.ssaf.pick_up

Examples of org.wijiscommons.ssaf.pick_up.FatalFault


        if (!(request.getLocalName().equals(
            SSAFNodes.request_delete_of_next.getLocalName()) && request
                .getNamespaceURI().equals(
                    SSAFNodes.request_delete_of_next.getNamespace())))
        {
            throw new FatalFault("The required element '"
                    + SSAFNodes.request_delete_of_next
                    + "' is missing in the request!");
        }
        String folderURI = request.getAttributeNS(
            SSAFNodes.pick_up_folder_nominal_uri.getNamespace(),
            SSAFNodes.pick_up_folder_nominal_uri.getLocalName());
        String messageID = request.getAttributeNS(SSAFNodes.message_id
            .getNamespace(), SSAFNodes.message_id.getLocalName());

        log.info("\tThe deleteMessageRequest: " + folderURI + " "
            + messageID);

        ServiceResponseInfo serviceResponseInfo = new ServiceResponseInfo();

        if (folderURI == null || messageID == null)
        {
            serviceResponseInfo
            .noteError("nominal folder uri or message_id is missing in the request ");
        }
        else
        {
            String destDir =
                folderURI.replace(ssafNominalUri, ssafRootUri)
                + NominalUriPartNames.NEXT_MESSAGE;
            String workflowId = folderURI.replace(ssafNominalUri, "");
            String queueName = workflowId + NominalUriPartNames.OUTBOUND_QUEUE;

            if (destDir != null && queueName != null)
            {
                try
                {
                    serviceResponseInfo = jmsTemplate
                    .deleteHeadMessageOnRequest(request, queueName,
                                destDir);
                }
                catch (Exception e1)
                {
                    e1.printStackTrace();
                    throw new FatalFault(
                            "Error when processing the request, please try later.",
                            e1);
                }
            }

        }

        DeleteNextUnitOfWorkResponse response = null;
        try
        {
            response = this.createDeleteNextUnitOfWorkResponse(
                serviceResponseInfo, messageID, folderURI);
        }
        catch (ParserConfigurationException e)
        {
            e.printStackTrace();
            throw new FatalFault("Error when creating response.", e);
        }
        catch (SAXException e)
        {
            e.printStackTrace();
            throw new FatalFault("Error when creating response.", e);
        }
        catch (IOException e)
        {
            e.printStackTrace();
            throw new FatalFault("Error when creating response.", e);
        }

        return response;
       
    }
View Full Code Here


        // TODO Should I do this checking or let the validation do it.

        if (!(request.getLocalName().equals(SSAFNodes.read_next.getLocalName()) && request
                .getNamespaceURI().equals(SSAFNodes.read_next.getNamespace())))
        {
            throw new FatalFault("The required element '" + SSAFNodes.read_next
                    + "' is missing in the request!");
        }
       
        String folderURI = request.getAttributeNS(
            SSAFNodes.pick_up_folder_nominal_uri.getNamespace(),
            SSAFNodes.pick_up_folder_nominal_uri.getLocalName());

        log.debug("\tFolderURI: " + folderURI);

        ServiceResponseInfo serviceResponseInfo = new ServiceResponseInfo();
        Document wrappedMessageDoc = null;
        Document messageDoc = null;

        if (StringUtils.isBlank(folderURI))
        {
            serviceResponseInfo
            .noteError("The attribute "
                    + SSAFNodes.pick_up_folder_nominal_uri.getLocalName()
                    + " with namespace "
                    + SSAFNodes.pick_up_folder_nominal_uri.getNamespace()
                    + " is required in the request.");

        }
        else
        {
            String workflowId = folderURI.replace(ssafNominalUri, "");
            String queueName = workflowId + NominalUriPartNames.OUTBOUND_QUEUE;
            try
            {
                messageDoc = jmsTemplate.readHeadMessageIntoDocument(queueName);
                wrappedMessageDoc = this.createReadMessageResponse(folderURI,
                    messageDoc, serviceResponseInfo);
            }
            catch (Exception e)
            {
                log.error(
                    "Server experienced difficulty when processing request.",e);
                throw new FatalFault(
                        "Server experienced difficulty when processing request.",
                        e);
            }
        }
View Full Code Here

                    null, messageID, sb.getMergedMessages(), null,
                    SSAFErrorTypes.REQUEST_USER_UNAUTHORIZED, nominalURI, null);
               
                FaultDescription faultDescr = new FaultDescription();
                faultDescr.setAny(errorResponse.getDocumentElement());
                FatalFault ssafFault =
                    new FatalFault(sb.getMergedMessages(), faultDescr);

                throw new Fault(ssafFault);
            }
            catch (ParserConfigurationException e)
            {
View Full Code Here

TOP

Related Classes of org.wijiscommons.ssaf.pick_up.FatalFault

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.