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