001/**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.activemq;
018
019import java.io.IOException;
020import java.io.InputStream;
021import java.net.MalformedURLException;
022import java.net.URL;
023
024import javax.jms.JMSException;
025
026/**
027 * Represents a message which has a typically out of band Binary Large Object
028 * (BLOB)
029 * 
030 * 
031 */
032public interface BlobMessage extends Message {
033
034    /**
035     * Return the input stream to process the BLOB
036     */
037    InputStream getInputStream() throws IOException, JMSException;
038
039    /**
040     * Returns the URL for the blob if its available as an external URL (such as file, http, ftp etc)
041     * or null if there is no URL available
042     */
043    URL getURL() throws MalformedURLException, JMSException;
044
045
046    /**
047     * The MIME type of the BLOB which can be used to apply different content types to messages.
048     */
049    String getMimeType();
050
051    /**
052     * Sets the MIME type of the BLOB so that a consumer can process things nicely with a Java Activation Framework
053     * DataHandler
054     */
055    void setMimeType(String mimeType);
056
057
058    String getName();
059
060    /**
061     * The name of the attachment which can be useful information if transmitting files over ActiveMQ
062     */
063    void setName(String name);
064}