1 /*
2  * Copyright 2002-2018 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 module hunt.stomp.core.DestinationResolvingMessageSendingOperations;
18 
19 import hunt.collection.Map;
20 
21 
22 import hunt.stomp.Message;
23 import hunt.stomp.MessagingException;
24 
25 /**
26  * Extends {@link MessageSendingOperations} and adds operations for sending messages
27  * to a destination specified as a (resolvable) string name.
28  *
29  * @author Mark Fisher
30  * @author Rossen Stoyanchev
31  * @since 4.0
32  * @param (T) the destination type
33  * @see DestinationResolver
34  */
35 interface DestinationResolvingMessageSendingOperations(T) : MessageSendingOperations!(T) {
36 
37 	/**
38 	 * Resolve the given destination name to a destination and send a message to it.
39 	 * @param destinationName the destination name to resolve
40 	 * @param message the message to send
41 	 */
42 	void send(string destinationName, MessageBase message);
43 
44 	/**
45 	 * Resolve the given destination name to a destination, convert the payload Object
46 	 * to serialized form, possibly using a
47 	 * {@link hunt.stomp.converter.MessageConverter},
48 	 * wrap it as a message and send it to the resolved destination.
49 	 * @param destinationName the destination name to resolve
50    	 * @param payload the Object to use as payload
51 	 */
52 	// <T> void convertAndSend(string destinationName, T payload);
53 
54 	/**
55 	 * Resolve the given destination name to a destination, convert the payload
56 	 * Object to serialized form, possibly using a
57 	 * {@link hunt.stomp.converter.MessageConverter},
58 	 * wrap it as a message with the given headers and send it to the resolved
59 	 * destination.
60 	 * @param destinationName the destination name to resolve
61 	 * @param payload the Object to use as payload
62  	 * @param headers headers for the message to send
63 	 */
64 	// <T> void convertAndSend(string destinationName, T payload, Map!(string, Object) headers)
65 	// 		throws MessagingException;
66 
67 	/**
68 	 * Resolve the given destination name to a destination, convert the payload
69 	 * Object to serialized form, possibly using a
70 	 * {@link hunt.stomp.converter.MessageConverter},
71 	 * wrap it as a message, apply the given post processor, and send the resulting
72 	 * message to the resolved destination.
73 	 * @param destinationName the destination name to resolve
74 	 * @param payload the Object to use as payload
75 	 * @param postProcessor the post processor to apply to the message
76 	 */
77 	// <T> void convertAndSend(string destinationName, T payload, MessagePostProcessor postProcessor)
78 	// 		throws MessagingException;
79 
80 	/**
81 	 * Resolve the given destination name to a destination, convert the payload
82 	 * Object to serialized form, possibly using a
83 	 * {@link hunt.stomp.converter.MessageConverter},
84 	 * wrap it as a message with the given headers, apply the given post processor,
85 	 * and send the resulting message to the resolved destination.
86 	 * @param destinationName the destination name to resolve
87 	 * @param payload the Object to use as payload
88 	 * @param headers headers for the message to send
89 	 * @param postProcessor the post processor to apply to the message
90 	 */
91 	// <T> void convertAndSend(string destinationName, T payload, Map!(string, Object) headers,
92 	// 		MessagePostProcessor postProcessor);
93 
94 }