1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.asteriskjava.manager.internal;
18
19 import java.io.IOException;
20
21 import org.asteriskjava.AsteriskVersion;
22 import org.asteriskjava.manager.action.ManagerAction;
23 import org.asteriskjava.util.SocketConnectionFacade;
24
25
26 /***
27 * The ManagerWriter transforms actions using an ActionBuilder and sends them to
28 * the asterisk server.<p>
29 * This class is intended to be used only by the DefaultManagerConnection.
30 *
31 * @see org.asteriskjava.manager.internal.ActionBuilder
32 * @see org.asteriskjava.manager.DefaultManagerConnection
33 * @author srt
34 * @version $Id: ManagerWriter.java 397 2006-05-26 12:13:32Z srt $
35 */
36 public interface ManagerWriter
37 {
38 /***
39 * Sets the version of the target Asterisk server.
40 *
41 * @param asteriskVersion the version of the target Asterisk server.
42 * @since 0.2
43 */
44 public void setTargetVersion(AsteriskVersion targetVersion);
45
46 /***
47 * Sets the socket to use for writing to Asterisk.
48 *
49 * @param socket the socket to use for writing to Asterisk.
50 */
51 void setSocket(final SocketConnectionFacade socket);
52
53 /***
54 * Sends the given action to the asterisk server.
55 *
56 * @param action the action to send to the asterisk server.
57 * @param internalActionId the internal action id to add.
58 * @throws IOException if there is a problem sending the action.
59 */
60 void sendAction(final ManagerAction action, String internalActionId) throws IOException;
61 }