View Javadoc

1   package org.indi.server;
2   
3   import org.indi.clientmessages.GetProperties;
4   import org.indi.objects.BlobVector;
5   import org.indi.objects.NumberVector;
6   import org.indi.objects.SwitchVector;
7   import org.indi.objects.TextVector;
8   import org.indi.reactor.TimerCallback;
9   
10  /**
11   * The basic interface implemented by device drivers
12   * 
13   * @author Dirk Hünniger
14   * 
15   */
16  public interface Device extends TimerCallback, ObserverCallback {
17      /**
18       * Called by the reactor whenever a SwitchVector (a request to change the
19       * state of a switch was received from the client)
20       * 
21       * @param vector
22       *                the vector received from the client
23       */
24      public void onNew(SwitchVector vector);
25  
26      /**
27       * Called by the reactor whenever a NumberVector (a request to change the
28       * state of a number was received from the client)
29       * 
30       * @param vector
31       *                the vector received from the client
32       */
33      public void onNew(NumberVector vector);
34  
35      /**
36       * Called by the reactor whenever a BLOBVector (a request to change the
37       * state of a blob was received from the client)
38       * 
39       * @param vector
40       *                the vector received from the client
41       */
42      public void onNew(BlobVector vector);
43  
44      /**
45       * Called by the reactor whenever a TextVector (a request to change the
46       * state of a text was received from the client)
47       * 
48       * @param vector
49       *                the vector received from the client
50       */
51      public void onNew(TextVector vector);
52  
53      /**
54       * Called when a GetProperties message was received client. Each property of
55       * the device should be defined here using the def methods.
56       * 
57       * @param o
58       *                the GetProperties message received from the client
59       */
60      public void onGetProperties(GetProperties o);
61  
62      /**
63       * @return the name of the device
64       */
65      public String getName();
66  }