Package org.eclipse.wst.wsi.internal.core.log.impl

Examples of org.eclipse.wst.wsi.internal.core.log.impl.MessageEntryImpl


   */
  protected MessageEntry createMessageEntry(int id, int conversationId, String type, long timestamp,
        String senderHostAndPort, String receiverHostAndPort, byte[] messageContent, String header)
  {
   // Create log entry
    MessageEntry messageEntry = new MessageEntryImpl();
    messageEntry.setId(String.valueOf(id));
    messageEntry.setConversationId(String.valueOf(conversationId));
    messageEntry.setType(type);
    messageEntry.setTimestamp(getTimestamp(new Date(timestamp)));
    messageEntry.setSenderHostAndPort(senderHostAndPort);
    messageEntry.setReceiverHostAndPort(receiverHostAndPort);
    messageEntry.setEncoding(WSIConstants.DEFAULT_XML_ENCODING);
   
    messageEntry.setHTTPHeaders(header);

    if (Utils.isMultipartRelatedMessage(header))
    {
      MimeParts mimeParts = Utils.parseMultipartRelatedMessage(messageContent, header, WSIConstants.DEFAULT_XML_ENCODING);
      if (mimeParts == null)
      {
        // problem creating Mimeparts -- treat it as simple SOAP message
        if (messageContent != null)
        {
          messageEntry.setMessage(new String(messageContent));
        }
        else
        {
          messageEntry.setMessage("");
        }
        messageEntry.setMimeContent(false);
      }
      else
      {
          messageEntry.setMimeParts(mimeParts);
          messageEntry.setMimeContent(true);
      }
    }
    else
    {
      // Get the message content
      if (messageContent != null)
      {
        messageEntry.setMessage(new String(messageContent));
      }
      else
      {
        messageEntry.setMessage("");
      }
      messageEntry.setMimeContent(false);
    }
    return messageEntry;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.wsi.internal.core.log.impl.MessageEntryImpl

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.