org.apache.activemq.command
Class ActiveMQBlobMessage

java.lang.Object
  extended by org.apache.activemq.command.BaseCommand
      extended by org.apache.activemq.command.Message
          extended by org.apache.activemq.command.ActiveMQMessage
              extended by org.apache.activemq.command.ActiveMQBlobMessage
All Implemented Interfaces:
Message, BlobMessage, MessageReference, Command, DataStructure, MarshallAware, ScheduledMessage

public class ActiveMQBlobMessage
extends ActiveMQMessage
implements BlobMessage

An implementation of BlobMessage for out of band BLOB transfer


Field Summary
static String BINARY_MIME_TYPE
           
static byte DATA_STRUCTURE_TYPE
           
 
Fields inherited from class org.apache.activemq.command.ActiveMQMessage
acknowledgeCallback, DLQ_DELIVERY_FAILURE_CAUSE_PROPERTY
 
Fields inherited from class org.apache.activemq.command.Message
arrival, brokerInTime, brokerOutTime, compressed, content, correlationId, dataStructure, DEFAULT_MINIMUM_MESSAGE_SIZE, destination, droppable, expiration, groupID, groupSequence, marshalledProperties, messageId, originalDestination, originalTransactionId, persistent, priority, producerId, properties, readOnlyBody, readOnlyProperties, recievedByDFBridge, redeliveryCounter, replyTo, size, targetConsumerId, timestamp, transactionId, type, userID
 
Fields inherited from class org.apache.activemq.command.BaseCommand
commandId, responseRequired
 
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
 
Fields inherited from interface org.apache.activemq.ScheduledMessage
AMQ_SCHEDULED_CRON, AMQ_SCHEDULED_DELAY, AMQ_SCHEDULED_ID, AMQ_SCHEDULED_PERIOD, AMQ_SCHEDULED_REPEAT, AMQ_SCHEDULER_ACTION, AMQ_SCHEDULER_ACTION_BROWSE, AMQ_SCHEDULER_ACTION_END_TIME, AMQ_SCHEDULER_ACTION_REMOVE, AMQ_SCHEDULER_ACTION_REMOVEALL, AMQ_SCHEDULER_ACTION_START_TIME, AMQ_SCHEDULER_MANAGEMENT_DESTINATION
 
Constructor Summary
ActiveMQBlobMessage()
           
 
Method Summary
 Message copy()
           
 void deleteFile()
           
 BlobDownloader getBlobDownloader()
           
 BlobUploader getBlobUploader()
           
 byte getDataStructureType()
           
 InputStream getInputStream()
          Return the input stream to process the BLOB
 String getJMSXMimeType()
          Returns the MIME type of this mesage.
 String getMimeType()
          The MIME type of the BLOB which can be used to apply different content types to messages.
 String getName()
           
 String getRemoteBlobUrl()
           
 URL getURL()
          Returns the URL for the blob if its available as an external URL (such as file, http, ftp etc) or null if there is no URL available
 boolean isDeletedByBroker()
           
 void onSend()
          Send operation event listener.
 void setBlobDownloader(BlobDownloader blobDownloader)
           
 void setBlobUploader(BlobUploader blobUploader)
           
 void setDeletedByBroker(boolean deletedByBroker)
           
 void setMimeType(String mimeType)
          Sets the MIME type of the BLOB so that a consumer can process things nicely with a Java Activation Framework DataHandler
 void setName(String name)
          The name of the attachment which can be useful information if transmitting files over ActiveMQ
 void setRemoteBlobUrl(String remoteBlobUrl)
           
 void setURL(URL url)
           
 
Methods inherited from class org.apache.activemq.command.ActiveMQMessage
acknowledge, checkReadOnlyBody, checkValidObject, checkValidScheduled, clearBody, clearProperties, convertScheduled, copy, decodeString, encodeString, equals, getAcknowledgeCallback, getAllPropertyNames, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, hashCode, propertyExists, setAcknowledgeCallback, setBooleanProperty, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setObjectProperty, setProperties, setShortProperty, setStringProperty, storeContent, visit
 
Methods inherited from class org.apache.activemq.command.Message
afterMarshall, afterUnmarshall, beforeMarshall, beforeUnmarshall, clearMarshalledState, compress, copy, decrementReferenceCount, doCompress, getArrival, getBrokerInTime, getBrokerOutTime, getBrokerPath, getCluster, getConnection, getContent, getCorrelationId, getDataStructure, getDestination, getExpiration, getGroupID, getGroupSequence, getMarshalledProperties, getMemoryUsage, getMessage, getMessageHardRef, getMessageId, getMinimumMessageSize, getOriginalDestination, getOriginalTransactionId, getPriority, getProducerId, getProperties, getProperty, getRedeliveryCounter, getReferenceCount, getRegionDestination, getReplyTo, getSize, getTargetConsumerId, getTimestamp, getTransactionId, getType, getUserID, incrementRedeliveryCounter, incrementReferenceCount, isAdvisory, isCompressed, isDroppable, isDropped, isExpired, isInTransaction, isMarshallAware, isMessage, isPersistent, isReadOnlyBody, isReadOnlyProperties, isRecievedByDFBridge, isRedelivered, lazyCreateProperties, onMessageRolledBack, removeProperty, setArrival, setBrokerInTime, setBrokerOutTime, setBrokerPath, setCluster, setCompressed, setConnection, setContent, setCorrelationId, setDataStructure, setDestination, setDroppable, setExpiration, setGroupID, setGroupSequence, setMarshalledProperties, setMemoryUsage, setMessageId, setOriginalDestination, setOriginalTransactionId, setPersistent, setPriority, setProducerId, setProperty, setReadOnlyBody, setReadOnlyProperties, setRecievedByDFBridge, setRedelivered, setRedeliveryCounter, setRegionDestination, setReplyTo, setTargetConsumerId, setTimestamp, setTransactionId, setType, setUserID, toString, toString
 
Methods inherited from class org.apache.activemq.command.BaseCommand
copy, getCommandId, getFrom, getTo, isBrokerInfo, isConnectionControl, isMessageAck, isMessageDispatch, isMessageDispatchNotification, isResponse, isResponseRequired, isShutdownInfo, isWireFormatInfo, setCommandId, setFrom, setResponseRequired, setTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
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
 

Field Detail

DATA_STRUCTURE_TYPE

public static final byte DATA_STRUCTURE_TYPE
See Also:
Constant Field Values

BINARY_MIME_TYPE

public static final String BINARY_MIME_TYPE
See Also:
Constant Field Values
Constructor Detail

ActiveMQBlobMessage

public ActiveMQBlobMessage()
Method Detail

copy

public Message copy()
Overrides:
copy in class ActiveMQMessage

getDataStructureType

public byte getDataStructureType()
Specified by:
getDataStructureType in interface DataStructure
Overrides:
getDataStructureType in class ActiveMQMessage
Returns:
The type of the data structure

getRemoteBlobUrl

public String getRemoteBlobUrl()

setRemoteBlobUrl

public void setRemoteBlobUrl(String remoteBlobUrl)

getMimeType

public String getMimeType()
The MIME type of the BLOB which can be used to apply different content types to messages.

Specified by:
getMimeType in interface BlobMessage

setMimeType

public void setMimeType(String mimeType)
Description copied from interface: BlobMessage
Sets the MIME type of the BLOB so that a consumer can process things nicely with a Java Activation Framework DataHandler

Specified by:
setMimeType in interface BlobMessage

getName

public String getName()
Specified by:
getName in interface BlobMessage

setName

public void setName(String name)
The name of the attachment which can be useful information if transmitting files over ActiveMQ

Specified by:
setName in interface BlobMessage

isDeletedByBroker

public boolean isDeletedByBroker()

setDeletedByBroker

public void setDeletedByBroker(boolean deletedByBroker)

getJMSXMimeType

public String getJMSXMimeType()
Description copied from interface: Message
Returns the MIME type of this mesage. This can be used in selectors to filter on the MIME types of the different JMS messages, or in the case of BlobMessage it allows you to create a selector on the MIME type of the BLOB body

Overrides:
getJMSXMimeType in class ActiveMQMessage

getInputStream

public InputStream getInputStream()
                           throws IOException,
                                  JMSException
Description copied from interface: BlobMessage
Return the input stream to process the BLOB

Specified by:
getInputStream in interface BlobMessage
Throws:
IOException
JMSException

getURL

public URL getURL()
           throws JMSException
Description copied from interface: BlobMessage
Returns the URL for the blob if its available as an external URL (such as file, http, ftp etc) or null if there is no URL available

Specified by:
getURL in interface BlobMessage
Throws:
JMSException

setURL

public void setURL(URL url)

getBlobUploader

public BlobUploader getBlobUploader()

setBlobUploader

public void setBlobUploader(BlobUploader blobUploader)

getBlobDownloader

public BlobDownloader getBlobDownloader()

setBlobDownloader

public void setBlobDownloader(BlobDownloader blobDownloader)

onSend

public void onSend()
            throws JMSException
Description copied from class: ActiveMQMessage
Send operation event listener. Used to get the message ready to be sent.

Overrides:
onSend in class ActiveMQMessage
Throws:
JMSException

deleteFile

public void deleteFile()
                throws IOException,
                       JMSException
Throws:
IOException
JMSException


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.