Add linux specific autosnapsmf module and dependencies
[time-slider.git] / usr / share / time-slider / lib / time_slider / dbussvc.py
1 #!/usr/bin/python2
2 #
3 # CDDL HEADER START
4 #
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22
23
24 import dbus
25 import dbus.service
26 import dbus.mainloop
27 import dbus.mainloop.glib
28
29
30 class AutoSnap(dbus.service.Object):
31     """
32     D-Bus object for Time Slider's auto snapshot features.
33     """
34     def __init__(self, bus, path, snapshotmanager):
35         self.snapshotmanager = snapshotmanager
36         self._bus = bus
37         dbus.service.Object.__init__(self,
38                                      bus,
39                                      path)
40
41     # Remedial cleanup signal
42     @dbus.service.signal(dbus_interface="org.opensolaris.TimeSlider.autosnap",
43                          signature='suu')
44     def capacity_exceeded(self, pool, severity, threshhold):
45         pass
46
47 class RsyncBackup(dbus.service.Object):
48     """
49     D-Bus object for Time Slider's rsync backup feature.
50     """
51     def __init__(self, bus, path):
52         self._bus = bus
53         dbus.service.Object.__init__(self, 
54                                      bus,  
55                                      path)
56
57     # Rsync operation rsync_started signal
58     @dbus.service.signal(dbus_interface="org.opensolaris.TimeSlider.plugin.rsync",
59                          signature='s')
60     def rsync_started(self, target):
61         pass
62
63     # Rsync operation rsync_current signal
64     @dbus.service.signal(dbus_interface="org.opensolaris.TimeSlider.plugin.rsync",
65                          signature='su')
66     def rsync_current(self, snapshot, remaining):
67         pass
68
69     # Rsync operation rsync_complete signal
70     @dbus.service.signal(dbus_interface="org.opensolaris.TimeSlider.plugin.rsync",
71                          signature='s')
72     def rsync_complete(self, target):
73         pass
74
75     # Rsync operation rsync_synced signal
76     @dbus.service.signal(dbus_interface="org.opensolaris.TimeSlider.plugin.rsync",
77                          signature='')
78     def rsync_synced(self):
79         pass
80
81     # Rsync operation rsync_unsynced signal
82     @dbus.service.signal(dbus_interface="org.opensolaris.TimeSlider.plugin.rsync",
83                          signature='u')
84     def rsync_unsynced(self, queueSize):
85         pass
86
87
88 class Config(dbus.service.Object):
89     """
90     D-Bus object representing Time Slider service configuration changes.
91     """
92     def __init__(self, bus, path):
93         self._bus = bus
94         dbus.service.Object.__init__(self, 
95                                         bus,  
96                                         path)
97     # Service configuration change signal. Nothing fancy for now. 
98     # Listeners need to figure out what changed for themselves.
99     @dbus.service.signal(dbus_interface="org.opensolaris.TimeSlider.config",
100                          signature='')
101     def config_changed(self):
102         pass
103