1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3# BAREOS - Backup Archiving REcovery Open Sourced
4#
5# Copyright (C) 2014-2014 Bareos GmbH & Co. KG
6#
7# This program is Free Software; you can redistribute it and/or
8# modify it under the terms of version three of the GNU Affero General Public
9# License as published by the Free Software Foundation, which is
10# listed in the file LICENSE.
11#
12# This program is distributed in the hope that it will be useful, but
13# WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15# Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20# 02110-1301, USA.
21#
22# Author: Maik Aussendorf
23#
24# The BareosFdWrapper module. Here is a global object bareos_fd_plugin_object
25# and wrapper functions, which are directly called out of the bareos-fd. They
26# are intended to pass the call to a method of an object of type
27# BareosFdPluginBaseclass (or derived)
28
29# use this as global plugin object among your python-fd-plugin modules
30bareos_fd_plugin_object = None
31
32
33def parse_plugin_definition(context, plugindef):
34    return bareos_fd_plugin_object.parse_plugin_definition(context, plugindef)
35
36
37def handle_plugin_event(context, event):
38    return bareos_fd_plugin_object.handle_plugin_event(context, event)
39
40
41def start_backup_file(context, savepkt):
42    return bareos_fd_plugin_object.start_backup_file(context, savepkt)
43
44
45def end_backup_file(context):
46    return bareos_fd_plugin_object.end_backup_file(context)
47
48
49def start_restore_file(context, cmd):
50    return bareos_fd_plugin_object.start_restore_file(context, cmd)
51
52
53def end_restore_file(context):
54    return bareos_fd_plugin_object.end_restore_file(context)
55
56
57def restore_object_data(context, ROP):
58    return bareos_fd_plugin_object.restore_object_data(context, ROP)
59
60
61def plugin_io(context, IOP):
62    return bareos_fd_plugin_object.plugin_io(context, IOP)
63
64
65def create_file(context, restorepkt):
66    return bareos_fd_plugin_object.create_file(context, restorepkt)
67
68
69def set_file_attributes(context, restorepkt):
70    return bareos_fd_plugin_object.set_file_attributes(context, restorepkt)
71
72
73def check_file(context, fname):
74    return bareos_fd_plugin_object.check_file(context, fname)
75
76
77def get_acl(context, acl):
78    return bareos_fd_plugin_object.get_acl(context, acl)
79
80
81def set_acl(context, acl):
82    return bareos_fd_plugin_object.set_acl(context, acl)
83
84
85def get_xattr(context, xattr):
86    return bareos_fd_plugin_object.get_xattr(context, xattr)
87
88
89def set_xattr(context, xattr):
90    return bareos_fd_plugin_object.set_xattr(context, xattr)
91
92
93def handle_backup_file(context, savepkt):
94    return bareos_fd_plugin_object.handle_backup_file(context, savepkt)
95