aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModuleState.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModuleState.cs')
-rw-r--r--OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModuleState.cs123
1 files changed, 123 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModuleState.cs b/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModuleState.cs
new file mode 100644
index 0000000..7fecfa4
--- /dev/null
+++ b/OpenSim/Region/OptionalModules/World/AutoBackup/AutoBackupModuleState.cs
@@ -0,0 +1,123 @@
1#pragma warning disable 1587
2///
3/// Copyright (c) Contributors, http://opensimulator.org/
4/// See CONTRIBUTORS.TXT for a full list of copyright holders.
5///
6/// Redistribution and use in source and binary forms, with or without
7/// modification, are permitted provided that the following conditions are met:
8/// * Redistributions of source code must retain the above copyright
9/// notice, this list of conditions and the following disclaimer.
10/// * Redistributions in binary form must reproduce the above copyright
11/// notice, this list of conditions and the following disclaimer in the
12/// documentation and/or other materials provided with the distribution.
13/// * Neither the name of the OpenSimulator Project nor the
14/// names of its contributors may be used to endorse or promote products
15/// derived from this software without specific prior written permission.
16///
17/// THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
18/// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19/// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20/// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
21/// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22/// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23/// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24/// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25/// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26/// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27///
28
29using System;
30using System.Collections.Generic;
31
32
33namespace OpenSim.Region.OptionalModules.World.AutoBackup
34{
35 /// AutoBackupModuleState: Auto-Backup state for one region (scene).
36 public class AutoBackupModuleState
37 {
38 private Dictionary<Guid, string> m_liveRequests = null;
39
40 public AutoBackupModuleState()
41 {
42 this.Enabled = false;
43 this.BackupDir = ".";
44 this.BusyCheck = true;
45 this.Timer = null;
46 this.NamingType = NamingType.Time;
47 this.Script = null;
48 }
49
50 public Dictionary<Guid, string> LiveRequests
51 {
52 get {
53 return this.m_liveRequests ??
54 (this.m_liveRequests = new Dictionary<Guid, string>(1));
55 }
56 }
57
58 public bool Enabled
59 {
60 get;
61 set;
62 }
63
64 public System.Timers.Timer Timer
65 {
66 get;
67 set;
68 }
69
70 public double IntervalMinutes
71 {
72 get
73 {
74 if (this.Timer == null)
75 {
76 return -1.0;
77 }
78 else
79 {
80 return this.Timer.Interval / 60000.0;
81 }
82 }
83 }
84
85 public bool BusyCheck
86 {
87 get;
88 set;
89 }
90
91 public string Script
92 {
93 get;
94 set;
95 }
96
97 public string BackupDir
98 {
99 get;
100 set;
101 }
102
103 public NamingType NamingType
104 {
105 get;
106 set;
107 }
108
109 public new string ToString()
110 {
111 string retval = "";
112
113 retval += "[AUTO BACKUP]: AutoBackup: " + (Enabled ? "ENABLED" : "DISABLED") + "\n";
114 retval += "[AUTO BACKUP]: Interval: " + IntervalMinutes + " minutes" + "\n";
115 retval += "[AUTO BACKUP]: Do Busy Check: " + (BusyCheck ? "Yes" : "No") + "\n";
116 retval += "[AUTO BACKUP]: Naming Type: " + NamingType.ToString() + "\n";
117 retval += "[AUTO BACKUP]: Backup Dir: " + BackupDir + "\n";
118 retval += "[AUTO BACKUP]: Script: " + Script + "\n";
119 return retval;
120 }
121 }
122}
123