Statistics
| Branch: | Revision:

root / main / java / net / elasticgrid / rackspace / cloudservers / BackupSchedule.java @ f8be9cce

History | View | Annotate | Download (2.4 kB)

1
/**
2
 * Licensed to the Apache Software Foundation (ASF) under one
3
 * or more contributor license agreements.  See the NOTICE file
4
 * distributed with this work for additional information
5
 * regarding copyright ownership.  The ASF licenses this file
6
 * to you under the Apache License, Version 2.0 (the
7
 * "License"); you may not use this file except in compliance
8
 * with the License.  You may obtain a copy of the License at
9
 *
10
 *   http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing,
13
 * software distributed under the License is distributed on an
14
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
 * KIND, either express or implied.  See the License for the
16
 * specific language governing permissions and limitations
17
 * under the License.
18
 */
19
package net.elasticgrid.rackspace.cloudservers;
20

    
21
import java.io.Serializable;
22

    
23
/**
24
 * Server backup schedule.
25
 *
26
 * @author Jerome Bernard
27
 */
28
public class BackupSchedule implements Serializable {
29
    private boolean enabled;
30
    private WeeklyBackup weekly;
31
    private DailyBackup daily;
32

    
33
    public BackupSchedule(boolean enabled, WeeklyBackup weekly, DailyBackup daily) {
34
        this.enabled = enabled;
35
        this.weekly = weekly;
36
        this.daily = daily;
37
    }
38

    
39
    public boolean isEnabled() {
40
        return enabled;
41
    }
42

    
43
    public WeeklyBackup getWeekly() {
44
        return weekly;
45
    }
46

    
47
    public DailyBackup getDaily() {
48
        return daily;
49
    }
50

    
51
    public enum WeeklyBackup implements Serializable {
52
        DISABLED("DISABLED"), SUNDAY("SUNDAY"), MONDAY("MONDAY"), TUESDAY("TUESDAY"),
53
        WEDNESDAY("WEDNESDAY"), THURSDAY("THURSDAY"), FRIDAY("FRIDAY"),
54
        SATURDAY("SATURDAY"), SUNDAY1("SUNDAY");
55
        private final String value;
56

    
57
        private WeeklyBackup(String value) {
58
            this.value = value;
59
        }
60
    }
61

    
62
    public enum DailyBackup implements Serializable {
63
        DISABLED, H_0000_0200, H_0200_0400, H_0400_0600, H_0600_0800, H_0800_1000,
64
        H_1000_1200, H_1200_1400, H_1400_1600, H_1600_1800, H_1800_2000,
65
        H_2000_2200, H_2200_0000
66
    }
67

    
68
    @Override
69
    public String toString() {
70
        final StringBuilder sb = new StringBuilder();
71
        sb.append("BackupSchedule");
72
        sb.append("{enabled=").append(enabled);
73
        sb.append(", weekly=").append(weekly);
74
        sb.append(", daily=").append(daily);
75
        sb.append('}');
76
        return sb.toString();
77
    }
78
}