Browse Source

action abstract; action add host; action del host

develop
Robin Thoni 8 years ago
parent
commit
59155221c1

+ 1
- 0
.gitignore View File

@@ -5,6 +5,7 @@ conf/hosts.json
5 5
 
6 6
 /.idea
7 7
 /build
8
+*.swp
8 9
 
9 10
 # Compiled Object files
10 11
 *.slo

+ 23
- 0
src/DBO/Actions/Action.cpp View File

@@ -0,0 +1,23 @@
1
+//
2
+// Created by robin on 8/9/15.
3
+//
4
+
5
+#include "Action.h"
6
+
7
+Action::Action()
8
+{
9
+}
10
+
11
+Action::~Action()
12
+{
13
+}
14
+
15
+const std::string &Action::getDomain() const
16
+{
17
+    return _domain;
18
+}
19
+
20
+void Action::setDomain(const std::string &domain)
21
+{
22
+    _domain = domain;
23
+}

+ 27
- 0
src/DBO/Actions/Action.h View File

@@ -0,0 +1,27 @@
1
+//
2
+// Created by robin on 8/9/15.
3
+//
4
+
5
+#ifndef PDNS_SLAVE_ACTION_H
6
+#define PDNS_SLAVE_ACTION_H
7
+
8
+# include <string>
9
+
10
+class Action
11
+{
12
+public:
13
+    Action();
14
+    virtual ~Action();
15
+
16
+    virtual const std::string getSql() const = 0;
17
+
18
+    const std::string &getDomain() const;
19
+
20
+    void setDomain(const std::string &domain);
21
+
22
+private:
23
+    std::string _domain;
24
+};
25
+
26
+
27
+#endif //PDNS_SLAVE_ACTION_H

+ 73
- 0
src/DBO/Actions/ActionAddHost.cpp View File

@@ -0,0 +1,73 @@
1
+//
2
+// Created by robin on 8/9/15.
3
+//
4
+
5
+#include "ActionAddHost.h"
6
+
7
+ActionAddHost::ActionAddHost()
8
+{
9
+}
10
+
11
+const std::string ActionAddHost::getSql() const
12
+{
13
+    return "";
14
+}
15
+
16
+const std::string &ActionAddHost::getHost() const
17
+{
18
+    return _host;
19
+}
20
+
21
+void ActionAddHost::setHost(const std::string &host)
22
+{
23
+    _host = host;
24
+}
25
+const std::string &ActionAddHost::getRecordValue() const
26
+{
27
+    return _recordValue;
28
+}
29
+
30
+void ActionAddHost::setRecordValue(const std::string &recordValue)
31
+{
32
+    _recordValue = recordValue;
33
+}
34
+
35
+const std::string &ActionAddHost::getRecordType() const
36
+{
37
+    return _recordType;
38
+}
39
+
40
+void ActionAddHost::setRecordType(const std::string &recordType)
41
+{
42
+    _recordType = recordType;
43
+}
44
+
45
+const std::string &ActionAddHost::getDhcpMac() const
46
+{
47
+    return _dhcpMac;
48
+}
49
+
50
+void ActionAddHost::setDhcpMac(const std::string &dhcpMac)
51
+{
52
+    _dhcpMac = dhcpMac;
53
+}
54
+
55
+const std::string &ActionAddHost::getReverseDomain() const
56
+{
57
+    return _reverseDomain;
58
+}
59
+
60
+void ActionAddHost::setReverseDomain(const std::string &reverseDomain)
61
+{
62
+    _reverseDomain = reverseDomain;
63
+}
64
+
65
+bool ActionAddHost::isReverseEnabled() const
66
+{
67
+    return _reverseEnabled;
68
+}
69
+
70
+void ActionAddHost::setReverseEnabled(bool reverseEnabled)
71
+{
72
+    _reverseEnabled = reverseEnabled;
73
+}

+ 56
- 0
src/DBO/Actions/ActionAddHost.h View File

@@ -0,0 +1,56 @@
1
+//
2
+// Created by robin on 8/9/15.
3
+//
4
+
5
+#ifndef PDNS_SLAVE_ACTIONADDHOST_H
6
+#define PDNS_SLAVE_ACTIONADDHOST_H
7
+
8
+# include "DBO/Actions/Action.h"
9
+
10
+class ActionAddHost : public Action
11
+{
12
+public:
13
+    ActionAddHost();
14
+
15
+    const std::string getSql() const override;
16
+
17
+    const std::string &getHost() const;
18
+
19
+    void setHost(const std::string &host);
20
+
21
+    const std::string &getRecordValue() const;
22
+
23
+    void setRecordValue(const std::string &recordValue);
24
+
25
+    const std::string &getRecordType() const;
26
+
27
+    void setRecordType(const std::string &recordType);
28
+
29
+    const std::string &getDhcpMac() const;
30
+
31
+    void setDhcpMac(const std::string &dhcpMac);
32
+
33
+    const std::string &getReverseDomain() const;
34
+
35
+    void setReverseDomain(const std::string &reverseDomain);
36
+
37
+    bool isReverseEnabled() const;
38
+
39
+    void setReverseEnabled(bool reverseEnabled);
40
+
41
+private:
42
+    std::string _host;
43
+
44
+    std::string _recordValue;
45
+
46
+    std::string _recordType;
47
+
48
+    std::string _dhcpMac;
49
+
50
+    std::string _reverseDomain;
51
+
52
+    bool _reverseEnabled;
53
+};
54
+
55
+
56
+#endif //PDNS_SLAVE_ACTIONADDHOST_H

+ 24
- 0
src/DBO/Actions/ActionDelHost.cpp View File

@@ -0,0 +1,24 @@
1
+//
2
+// Created by robin on 8/9/15.
3
+//
4
+
5
+#include "ActionDelHost.h"
6
+
7
+ActionDelHost::ActionDelHost()
8
+{
9
+}
10
+
11
+const std::string ActionDelHost::getSql() const
12
+{
13
+    return "";
14
+}
15
+
16
+const std::string &ActionDelHost::getHost() const
17
+{
18
+    return _host;
19
+}
20
+
21
+void ActionDelHost::setHost(const std::string &host)
22
+{
23
+    _host = host;
24
+}

+ 26
- 0
src/DBO/Actions/ActionDelHost.h View File

@@ -0,0 +1,26 @@
1
+//
2
+// Created by robin on 8/9/15.
3
+//
4
+
5
+#ifndef PDNS_SLAVE_ACTIONDELHOST_H
6
+#define PDNS_SLAVE_ACTIONDELHOST_H
7
+
8
+# include "DBO/Actions/Action.h"
9
+
10
+class ActionDelHost : public Action
11
+{
12
+public:
13
+    ActionDelHost();
14
+
15
+    const std::string getSql() const override;
16
+
17
+    const std::string &getHost() const;
18
+
19
+    void setHost(const std::string &host);
20
+
21
+private:
22
+    std::string _host;
23
+};
24
+
25
+
26
+#endif //PDNS_SLAVE_ACTIONDELHOST_H

Loading…
Cancel
Save