Examples of CollaborationProtocolAgreement


Examples of nl.clockwork.mule.ebms.model.cpp.cpa.CollaborationProtocolAgreement

  public String sendMessage(EbMSMessageContent messageContent)
  {
    try
    {
      new EbMSMessageContextValidator(ebMSDAO).validate(messageContent.getContext());
      CollaborationProtocolAgreement cpa = ebMSDAO.getCPA(messageContent.getContext().getCpaId());
      EbMSMessage message = EbMSMessageUtils.ebMSMessageContentToEbMSMessage(cpa,messageContent,hostname);
      List<EbMSSendEvent> sendEvents = EbMSMessageUtils.getEbMSSendEvents(ebMSDAO.getCPA(message.getMessageHeader().getCPAId()),message.getMessageHeader());
      ebMSDAO.insertMessage(message,sendEvents);
      return message.getMessageHeader().getMessageData().getMessageId();
    }
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.cpp.cpa.CollaborationProtocolAgreement

  @Override
  public boolean insertCPA(/*CollaborationProtocolAgreement*/String cpa_, Boolean overwrite)
  {
    try
    {
      CollaborationProtocolAgreement cpa = XMLMessageBuilder.getInstance(CollaborationProtocolAgreement.class).handle(cpa_);
      boolean result = ebMSDAO.insertCPA(cpa);
      if (!result && (overwrite == null || overwrite == true))
        result = ebMSDAO.updateCPA(cpa);
      return result;
    }
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.cpp.cpa.CollaborationProtocolAgreement

    if (message.getPayload() instanceof EbMSBaseMessage)
    {
      try
      {
        EbMSBaseMessage msg = (EbMSBaseMessage)message.getPayload();
        CollaborationProtocolAgreement cpa = ebMSDAO.getCPA(msg.getMessageHeader().getCPAId());
        if (cpa == null || !cpa.getCpaid().equals(msg.getMessageHeader().getCPAId()))
        {
          message.setProperty(Constants.EBMS_ERROR,EbMSMessageUtils.createError("//Header/MessageHeader[@cpaid]",Constants.EbMSErrorCode.VALUE_NOT_RECOGNIZED.errorCode(),"CPA not found."));
          return false;
        }
        return true;
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.cpp.cpa.CollaborationProtocolAgreement

    {
      try
      {
        EbMSMessage msg = (EbMSMessage)message.getPayload();
        MessageHeader messageHeader = msg.getMessageHeader();
        CollaborationProtocolAgreement cpa = ebMSDAO.getCPA(messageHeader.getCPAId());
        Signature signature = (Signature)message.getProperty(Constants.EBMS_SIGNATURE);
        PartyInfo partyInfo = CPAUtils.getPartyInfo(cpa,messageHeader.getFrom().getPartyId());
        List<DeliveryChannel> deliveryChannels = CPAUtils.getDeliveryChannels(partyInfo,messageHeader.getFrom().getRole(),messageHeader.getService(),messageHeader.getAction());
        if (CPAUtils.isSigned(deliveryChannels.get(0)))
        {
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.cpp.cpa.CollaborationProtocolAgreement

    {
      try
      {
        EbMSBaseMessage msg = (EbMSBaseMessage)message.getPayload();
        Date now = new Date();
        CollaborationProtocolAgreement cpa = ebMSDAO.getCPA(msg.getMessageHeader().getCPAId());
        if (!StatusValueType.AGREED.equals(cpa.getStatus().getValue()))
        {
          message.setProperty(Constants.EBMS_ERROR,EbMSMessageUtils.createError("//Header/MessageHeader[@cpaid]",Constants.EbMSErrorCode.INCONSISTENT.errorCode(),"CPA not agreed."));
          return false;
        }
        if (now.compareTo(cpa.getStart().toGregorianCalendar().getTime()) < 0 || now.compareTo(cpa.getEnd().toGregorianCalendar().getTime()) > 0)
        {
          message.setProperty(Constants.EBMS_ERROR,EbMSMessageUtils.createError("//Header/MessageHeader[@cpaid]",Constants.EbMSErrorCode.INCONSISTENT.errorCode(),"CPA invalid."));
          return false;
        }

        return StatusValueType.AGREED.equals(cpa.getStatus().getValue())
          && now.compareTo(cpa.getStart().toGregorianCalendar().getTime()) >= 0
          && now.compareTo(cpa.getEnd().toGregorianCalendar().getTime()) <= 0
        ;
      }
      catch (DAOException e)
      {
        throw new RuntimeException(e);
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.cpp.cpa.CollaborationProtocolAgreement

    private boolean isSigned(Document document) throws XPathExpressionException, ParserConfigurationException, SAXException, IOException, JAXBException, DAOException
    {
      Node n = (Node)XMLUtils.executeXPathQuery(new EbXMLNamespaceContext(),document,"/soap:Envelope/soap:Header/ebxml:MessageHeader",XPathConstants.NODE);
      MessageHeader messageHeader = XMLMessageBuilder.getInstance(MessageHeader.class).handle(n);
      CollaborationProtocolAgreement cpa = ebMSDAO.getCPA(messageHeader.getCPAId());
      PartyInfo partyInfo = CPAUtils.getPartyInfo(cpa,messageHeader.getFrom().getPartyId());
      List<DeliveryChannel> channels = CPAUtils.getDeliveryChannels(partyInfo,messageHeader.getFrom().getRole(),messageHeader.getService(),messageHeader.getAction());
      return CPAUtils.isSigned(channels.get(0));
    }
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.cpp.cpa.CollaborationProtocolAgreement

      if (StringUtils.isEmpty(context.getService()))
        throw new EbMSMessageContextValidationException("context.service cannot be empty.");
      if (StringUtils.isEmpty(context.getAction()))
        throw new EbMSMessageContextValidationException("context.action cannot be empty.");

      CollaborationProtocolAgreement cpa = ebMSDAO.getCPA(context.getCpaId());
      if (cpa == null)
        throw new EbMSMessageContextValidationException("No CPA found for: context.cpaId=" + context.getCpaId());

      PartyInfo sendingPartyInfo = CPAUtils.getSendingPartyInfo(cpa,context.getFromRole(),context.getServiceType(),context.getService(),context.getAction());
      if (sendingPartyInfo == null)
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.cpp.cpa.CollaborationProtocolAgreement

      EbMS service = new EbMS();
      EbMSPortType ebMS = service.getEbMSPort();

      EbMSMessage msg = (EbMSMessage)message.getPayload();

      CollaborationProtocolAgreement cpa = ebMSDAO.getCPA(msg.getMessageHeader().getCPAId());
      CPAUtils.getPartyInfo(cpa,msg.getMessageHeader().getTo().getPartyId());
      //get transportreceiver CPAUtils.
     
      String url = "http://localhost:63081/greeter";
      ((BindingProvider)ebMS).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,url);
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.cpp.cpa.CollaborationProtocolAgreement

    {
      try
      {
        EbMSBaseMessage msg = (EbMSBaseMessage)message.getPayload();
        MessageHeader messageHeader = msg.getMessageHeader();
        CollaborationProtocolAgreement cpa = ebMSDAO.getCPA(messageHeader.getCPAId());
        PartyInfo from = null;
        PartyInfo to = null;

        if (!Constants.EBMS_VERSION.equals(messageHeader.getVersion()))
        {
View Full Code Here

Examples of nl.clockwork.mule.ebms.model.cpp.cpa.CollaborationProtocolAgreement

  {
    try
    {
      Node n = (Node)XMLUtils.executeXPathQuery(new EbXMLNamespaceContext(),document,"/soap:Envelope/soap:Header/ebxml:MessageHeader",XPathConstants.NODE);
      MessageHeader messageHeader = XMLMessageBuilder.getInstance(MessageHeader.class).handle(n);
      CollaborationProtocolAgreement cpa = ebMSDAO.getCPA(messageHeader.getCPAId());
      if (cpa != null)
      {
        PartyInfo partyInfo = CPAUtils.getPartyInfo(cpa,messageHeader.getFrom().getPartyId());
        if (partyInfo != null)
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.