KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > BlobMessage


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.activemq;
18
19 import javax.jms.JMSException JavaDoc;
20 import java.net.URL JavaDoc;
21 import java.net.MalformedURLException JavaDoc;
22 import java.io.InputStream JavaDoc;
23 import java.io.IOException JavaDoc;
24
25 /**
26  * Represents a message which has a typically out of band Binary Large Object
27  * (BLOB)
28  *
29  * @version $Revision: $
30  */

31 public interface BlobMessage extends Message {
32
33     /**
34      * Return the input stream to process the BLOB
35      */

36     InputStream JavaDoc getInputStream() throws IOException JavaDoc, JMSException JavaDoc;
37
38     /**
39      * Returns the URL for the blob if its available as an external URL (such as file, http, ftp etc)
40      * or null if there is no URL available
41      */

42     URL JavaDoc getURL() throws MalformedURLException JavaDoc, JMSException JavaDoc;
43
44
45     /**
46      * The MIME type of the BLOB which can be used to apply different content types to messages.
47      */

48     String JavaDoc getMimeType();
49
50     /**
51      * Sets the MIME type of the BLOB so that a consumer can process things nicely with a Java Activation Framework
52      * DataHandler
53      */

54     void setMimeType(String JavaDoc mimeType);
55
56
57     String JavaDoc getName();
58
59     /**
60      * The name of the attachment which can be useful information if transmitting files over ActiveMQ
61      */

62     void setName(String JavaDoc name);
63 }
64
Popular Tags