Statistics
| Branch: | Revision:

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

History | View | Annotate | Download (2.6 kB)

1 f8be9cce Phillip Toohill
/**
2 f8be9cce Phillip Toohill
 * Licensed to the Apache Software Foundation (ASF) under one
3 f8be9cce Phillip Toohill
 * or more contributor license agreements.  See the NOTICE file
4 f8be9cce Phillip Toohill
 * distributed with this work for additional information
5 f8be9cce Phillip Toohill
 * regarding copyright ownership.  The ASF licenses this file
6 f8be9cce Phillip Toohill
 * to you under the Apache License, Version 2.0 (the
7 f8be9cce Phillip Toohill
 * "License"); you may not use this file except in compliance
8 f8be9cce Phillip Toohill
 * with the License.  You may obtain a copy of the License at
9 f8be9cce Phillip Toohill
 *
10 f8be9cce Phillip Toohill
 *   http://www.apache.org/licenses/LICENSE-2.0
11 f8be9cce Phillip Toohill
 *
12 f8be9cce Phillip Toohill
 * Unless required by applicable law or agreed to in writing,
13 f8be9cce Phillip Toohill
 * software distributed under the License is distributed on an
14 f8be9cce Phillip Toohill
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 f8be9cce Phillip Toohill
 * KIND, either express or implied.  See the License for the
16 f8be9cce Phillip Toohill
 * specific language governing permissions and limitations
17 f8be9cce Phillip Toohill
 * under the License.
18 f8be9cce Phillip Toohill
 */
19 f8be9cce Phillip Toohill
package net.elasticgrid.rackspace.cloudservers;
20 f8be9cce Phillip Toohill
21 f8be9cce Phillip Toohill
import java.io.Serializable;
22 f8be9cce Phillip Toohill
import java.util.Date;
23 f8be9cce Phillip Toohill
24 f8be9cce Phillip Toohill
/**
25 f8be9cce Phillip Toohill
 * Image: collection of files used to create or rebuild a server.
26 f8be9cce Phillip Toohill
 *
27 f8be9cce Phillip Toohill
 * @author Jerome Bernard
28 f8be9cce Phillip Toohill
 */
29 f8be9cce Phillip Toohill
public class Image implements Serializable {
30 f8be9cce Phillip Toohill
    private final Integer id;
31 f8be9cce Phillip Toohill
    private final String name;
32 f8be9cce Phillip Toohill
    private final Integer serverId;
33 f8be9cce Phillip Toohill
    private final Date updated;
34 f8be9cce Phillip Toohill
    private final Date created;
35 f8be9cce Phillip Toohill
    private final Integer progress;
36 f8be9cce Phillip Toohill
    private final Status status;
37 f8be9cce Phillip Toohill
38 f8be9cce Phillip Toohill
    public Image(Integer id, String name, Integer serverId, Date updated, Date created, Integer progress, Status status) {
39 f8be9cce Phillip Toohill
        this.id = id;
40 f8be9cce Phillip Toohill
        this.name = name;
41 f8be9cce Phillip Toohill
        this.serverId = serverId;
42 f8be9cce Phillip Toohill
        this.updated = updated;
43 f8be9cce Phillip Toohill
        this.created = created;
44 f8be9cce Phillip Toohill
        this.progress = progress;
45 f8be9cce Phillip Toohill
        this.status = status;
46 f8be9cce Phillip Toohill
    }
47 f8be9cce Phillip Toohill
48 f8be9cce Phillip Toohill
    public Integer getId() {
49 f8be9cce Phillip Toohill
        return id;
50 f8be9cce Phillip Toohill
    }
51 f8be9cce Phillip Toohill
52 f8be9cce Phillip Toohill
    public String getName() {
53 f8be9cce Phillip Toohill
        return name;
54 f8be9cce Phillip Toohill
    }
55 f8be9cce Phillip Toohill
56 f8be9cce Phillip Toohill
    public Integer getServerId() {
57 f8be9cce Phillip Toohill
        return serverId;
58 f8be9cce Phillip Toohill
    }
59 f8be9cce Phillip Toohill
60 f8be9cce Phillip Toohill
    public Date getUpdated() {
61 f8be9cce Phillip Toohill
        return updated;
62 f8be9cce Phillip Toohill
    }
63 f8be9cce Phillip Toohill
64 f8be9cce Phillip Toohill
    public Date getCreated() {
65 f8be9cce Phillip Toohill
        return created;
66 f8be9cce Phillip Toohill
    }
67 f8be9cce Phillip Toohill
68 f8be9cce Phillip Toohill
    public Integer getProgress() {
69 f8be9cce Phillip Toohill
        return progress;
70 f8be9cce Phillip Toohill
    }
71 f8be9cce Phillip Toohill
72 f8be9cce Phillip Toohill
    public Status getStatus() {
73 f8be9cce Phillip Toohill
        return status;
74 f8be9cce Phillip Toohill
    }
75 f8be9cce Phillip Toohill
76 f8be9cce Phillip Toohill
    @Override
77 f8be9cce Phillip Toohill
    public String toString() {
78 f8be9cce Phillip Toohill
        final StringBuilder sb = new StringBuilder();
79 f8be9cce Phillip Toohill
        sb.append("Image");
80 f8be9cce Phillip Toohill
        sb.append("{id=").append(id);
81 f8be9cce Phillip Toohill
        sb.append(", name='").append(name).append('\'');
82 f8be9cce Phillip Toohill
        sb.append(", serverId=").append(serverId);
83 f8be9cce Phillip Toohill
        sb.append(", updated=").append(updated);
84 f8be9cce Phillip Toohill
        sb.append(", created=").append(created);
85 f8be9cce Phillip Toohill
        sb.append(", progress=").append(progress);
86 f8be9cce Phillip Toohill
        sb.append(", status=").append(status);
87 f8be9cce Phillip Toohill
        sb.append('}');
88 f8be9cce Phillip Toohill
        return sb.toString();
89 f8be9cce Phillip Toohill
    }
90 f8be9cce Phillip Toohill
91 f8be9cce Phillip Toohill
    enum Status implements Serializable {
92 f8be9cce Phillip Toohill
        UNKNOWN, ACTIVE, SAVING, PREPARING, QUEUED, FAILED
93 f8be9cce Phillip Toohill
    }
94 f8be9cce Phillip Toohill
}