Package nl.clockwork.mule.ebms.model

Examples of nl.clockwork.mule.ebms.model.EbMSAttachment


  public static EbMSMessageContent EbMSMessageToEbMSMessageContent(EbMSMessage message) throws IOException
  {
    List<EbMSAttachment> attachments = new ArrayList<EbMSAttachment>();
    for (DataSource attachment : message.getAttachments())
      attachments.add(new EbMSAttachment(attachment.getName(),attachment.getContentType(),IOUtils.toByteArray(attachment.getInputStream())));

    return new EbMSMessageContent(new EbMSMessageContext(message.getMessageHeader()),attachments);
  }
View Full Code Here


    if (message.getPayload() instanceof EbMSMessageContent)
    {
      try
      {
        EbMSMessageContent content = (EbMSMessageContent)message.getPayload();
        EbMSAttachment attachment = content.getAttachments().iterator().next();
        AanleverBericht aanleverBericht = XMLMessageBuilder.getInstance(AanleverBericht.class).handle(new String(attachment.getContent()));
        return berichtSoort.equalsIgnoreCase(aanleverBericht.getBerichtsoort());
      }
      catch (Exception e)
      {
        logger.error(e);
View Full Code Here

        afleverBevestiging.setTijdstempelAfgeleverd(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()));
      else
        afleverBevestiging.setFout(error);

      List<EbMSAttachment> attachments = new ArrayList<EbMSAttachment>();
      attachments.add(new EbMSAttachment(name,"application/xml",XMLMessageBuilder.getInstance(BevestigAfleverBericht.class).handle(afleverBevestiging).getBytes()));

      return new EbMSMessageContent(new EbMSMessageContext(cpaId,service,action,content.getContext().getConversationId()),attachments);
    }
    catch (Exception e)
    {
View Full Code Here

    if (message.getPayload() instanceof EbMSMessageContent)
    {
      try
      {
        EbMSMessageContent content = (EbMSMessageContent)message.getPayload();
        EbMSAttachment attachment = content.getAttachments().iterator().next();
        AfleverBericht afleverBericht = XMLMessageBuilder.getInstance(AfleverBericht.class).handle(new String(attachment.getContent()));
        return berichtSoort.equalsIgnoreCase(afleverBericht.getBerichtsoort());
      }
      catch (Exception e)
      {
        logger.error(e);
View Full Code Here

        aanleverBevestiging.setTijdstempelAangeleverd(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()));
      else
        aanleverBevestiging.setFout(error);

      List<EbMSAttachment> attachments = new ArrayList<EbMSAttachment>();
      attachments.add(new EbMSAttachment(name,"application/xml",XMLMessageBuilder.getInstance(BevestigAanleverBericht.class).handle(aanleverBevestiging).getBytes()));

      return new EbMSMessageContent(new EbMSMessageContext(cpaId,service,action,content.getContext().getConversationId()),attachments);
    }
    catch (Exception e)
    {
View Full Code Here

  public Object transform(final MuleMessage message, String outputEncoding) throws TransformerException
  {
    try
    {
      String fileName = message.getStringProperty("originalFilename","message.xml");
      EbMSAttachment attachment = new EbMSAttachment(fileName,StringUtils.defaultIfEmpty(Utils.getMimeType(fileName),"application/octet-stream"),((String)message.getPayload()).getBytes()); //application/xml
      message.setPayload(Arrays.asList(attachment));
      return message;
    }
    catch (IOException e)
    {
View Full Code Here

TOP

Related Classes of nl.clockwork.mule.ebms.model.EbMSAttachment

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.