Interface WmFileMessage

All Superinterfaces:
javax.jms.Message, WmMessage

public interface WmFileMessage extends WmMessage
Deprecated.
A WmFileMessage object is used to stream a file that is too large to load into memory. The specified file is read in fragments and sent to the consumers who will save the fragments to a file.

The sender of this message must first set the filename before sending:

 WmFileMessage fileMessage = session.createFileMessage();
 fileMessage.setFilename("/tmp/bigfile");
 producer.send(fileMessage);
 

The receiver of this message sets the filename to initiate the transfer:

 WmFileMessage fileMessage = (WmFileMessage) consumer.receive();
 String filename = fileMessage.getFilename();
 fileMessage.saveFile("/download/" + filename);
 
  • Field Summary

    Fields inherited from interface javax.jms.Message

    DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE

    Fields inherited from interface com.webmethods.jms.WmMessage

    WM_JMS_CLUSTER_NODES, WM_JMS_CLUSTER_NODES_DELIMITER
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Deprecated.
    Gets the total number of bytes transferred.
    Deprecated.
    Get the name of the file associated with the message.
    int
    Deprecated.
    Get the maximum number of bytes to read from the file at one time and send.
    Deprecated.
    Gets the producer with which the WmFileMessage is to be sent.
    long
    Deprecated.
    Get the transfer request timeout value.
    long
    Deprecated.
    Get the transfer timeout value.
    void
    saveFile(String filename)
    Deprecated.
    Once the message has been received this method is used to save the contents to the specified file.
    void
    setBytesTransferred(long bytesTransferred)
    Deprecated.
    Sets the total number of bytes transferred.
    void
    setFilename(String filename)
    Deprecated.
    Set the name of the file associated with the message.
    void
    setPacketSize(int packetSize)
    Deprecated.
    Set the maximum number of bytes to read from the file at one time and send.
    void
    Deprecated.
    Sets the producer with which the WmFileMessage is to be sent.
    void
    setRequestTimeout(long requestTimeout)
    Deprecated.
    Set the transfer request timeout value.
    void
    setTransferTimeout(long transferTimeout)
    Deprecated.
    Set the transfer timeout value.

    Methods inherited from interface javax.jms.Message

    acknowledge, clearBody, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty
  • Method Details

    • setFilename

      void setFilename(String filename) throws FileNotFoundException, javax.jms.JMSException
      Deprecated.
      Set the name of the file associated with the message.

      This method is used to specify which file is to be streamed when the message is sent.

      Parameters:
      filename - The name of the file associated with the message.
      Throws:
      FileNotFoundException - If the file is invalid.
      javax.jms.JMSException - If unable to set the name of the file.
    • getFilename

      String getFilename() throws javax.jms.JMSException
      Deprecated.
      Get the name of the file associated with the message.

      If this message has been received by a message consumer then this method will return only the file's name without the path. Otherwise, this method will return the fully qualified file's name including the path.

      Returns:
      The name of the file associated with the message.
      Throws:
      javax.jms.JMSException - If unable to get the name of the file.
    • saveFile

      void saveFile(String filename) throws FileNotFoundException, javax.jms.JMSException
      Deprecated.
      Once the message has been received this method is used to save the contents to the specified file. This method will block until the transfer has completed.
      Parameters:
      filename - The location to save the file.
      Throws:
      FileNotFoundException - If the file is invalid.
      javax.jms.JMSException - If unable to save the file.
    • setPacketSize

      void setPacketSize(int packetSize) throws javax.jms.JMSException
      Deprecated.
      Set the maximum number of bytes to read from the file at one time and send.
      Parameters:
      packetSize - The maximum number of bytes to read and send.
      Throws:
      javax.jms.JMSException - If unable to set the packet size.
    • getPacketSize

      int getPacketSize() throws javax.jms.JMSException
      Deprecated.
      Get the maximum number of bytes to read from the file at one time and send.
      Returns:
      The maximum number of bytes to read and send.
      Throws:
      javax.jms.JMSException - If unable to get the packet size.
    • setTransferTimeout

      void setTransferTimeout(long transferTimeout) throws javax.jms.JMSException
      Deprecated.
      Set the transfer timeout value.

      The producer uses this timeout value to indicate how long to wait for a packet acknowledgement from the consumers.

      The consumer uses this timeout value to indicate how long to wait for the next packet from the producer.

      The default value is 15000 milliseconds. A timeout of zero never expires.

      Parameters:
      transferTimeout - The transfer timeout value in milliseconds.
      Throws:
      javax.jms.JMSException - If unable to set the timeout.
    • getTransferTimeout

      long getTransferTimeout() throws javax.jms.JMSException
      Deprecated.
      Get the transfer timeout value.
      Returns:
      The transfer timeout value in milliseconds.
      Throws:
      javax.jms.JMSException - If unable to get the timeout.
    • setRequestTimeout

      void setRequestTimeout(long requestTimeout) throws javax.jms.JMSException
      Deprecated.
      Set the transfer request timeout value. The producer uses this timeout value to indicate how long to wait for transfer requests from consumers.

      The default value is 15000 milliseconds. A timeout of zero never expires.

      Parameters:
      requestTimeout - The request timeout value in milliseconds.
      Throws:
      javax.jms.JMSException - If unable to set the timeout
    • getRequestTimeout

      long getRequestTimeout() throws javax.jms.JMSException
      Deprecated.
      Get the transfer request timeout value.
      Returns:
      The transfer request timeout value in milliseconds.
      Throws:
      javax.jms.JMSException - If unable to get the timeout.
    • setBytesTransferred

      void setBytesTransferred(long bytesTransferred) throws javax.jms.JMSException
      Deprecated.
      Sets the total number of bytes transferred.

      This value is set by the JMS provider once the transfer has completed.

      Parameters:
      bytesTransferred -
      Throws:
      javax.jms.JMSException
    • getBytesTransferred

      long getBytesTransferred() throws javax.jms.JMSException
      Deprecated.
      Gets the total number of bytes transferred.
      Returns:
      The total number of bytes transferred.
      Throws:
      javax.jms.JMSException - If unable to get the number of bytes transferred.
    • setProducer

      void setProducer(WmMessageProducer producer) throws javax.jms.JMSException
      Deprecated.
      Sets the producer with which the WmFileMessage is to be sent.
      Parameters:
      producer -
      Throws:
      javax.jms.JMSException
    • getProducer

      WmMessageProducer getProducer() throws javax.jms.JMSException
      Deprecated.
      Gets the producer with which the WmFileMessage is to be sent.
      Throws:
      javax.jms.JMSException