forked from savon-noir/python-libnmap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackendplugin.py
More file actions
43 lines (37 loc) · 1.12 KB
/
backendplugin.py
File metadata and controls
43 lines (37 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python
class NmapBackendPlugin(object):
"""
Abstract class showing to the minimal implementation for a plugin
All subclass MUST at least implement the following methods
"""
def __init__(self):
self.dbname = 'nmapdb'
self.store = 'reports'
def insert(self, NmapReport):
"""
insert NmapReport in the backend
:param NmapReport:
:return: str the ident of the object in the backend for
future usage
or None
"""
raise NotImplementedError
def delete(self, id):
"""
delete NmapReport if the backend
:param id: str
"""
raise NotImplementedError
def get(self, id):
"""
retreive a NmapReport from the backend
:param id: str
:return: NmapReport
"""
raise NotImplementedError
def getall(self, filter):
"""
:return: collection of tuple (id,NmapReport)
:param filter: Nice to have implement a filter capability
"""
raise NotImplementedError