root / main / java / net / elasticgrid / rackspace / cloudservers / Image.java @ f8be9cce
History | View | Annotate | Download (2.6 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 |
import java.util.Date; |
23 |
|
24 |
/**
|
25 |
* Image: collection of files used to create or rebuild a server.
|
26 |
*
|
27 |
* @author Jerome Bernard
|
28 |
*/
|
29 |
public class Image implements Serializable { |
30 |
private final Integer id; |
31 |
private final String name; |
32 |
private final Integer serverId; |
33 |
private final Date updated; |
34 |
private final Date created; |
35 |
private final Integer progress; |
36 |
private final Status status; |
37 |
|
38 |
public Image(Integer id, String name, Integer serverId, Date updated, Date created, Integer progress, Status status) { |
39 |
this.id = id;
|
40 |
this.name = name;
|
41 |
this.serverId = serverId;
|
42 |
this.updated = updated;
|
43 |
this.created = created;
|
44 |
this.progress = progress;
|
45 |
this.status = status;
|
46 |
} |
47 |
|
48 |
public Integer getId() { |
49 |
return id;
|
50 |
} |
51 |
|
52 |
public String getName() { |
53 |
return name;
|
54 |
} |
55 |
|
56 |
public Integer getServerId() { |
57 |
return serverId;
|
58 |
} |
59 |
|
60 |
public Date getUpdated() { |
61 |
return updated;
|
62 |
} |
63 |
|
64 |
public Date getCreated() { |
65 |
return created;
|
66 |
} |
67 |
|
68 |
public Integer getProgress() { |
69 |
return progress;
|
70 |
} |
71 |
|
72 |
public Status getStatus() {
|
73 |
return status;
|
74 |
} |
75 |
|
76 |
@Override
|
77 |
public String toString() { |
78 |
final StringBuilder sb = new StringBuilder(); |
79 |
sb.append("Image");
|
80 |
sb.append("{id=").append(id);
|
81 |
sb.append(", name='").append(name).append('\''); |
82 |
sb.append(", serverId=").append(serverId);
|
83 |
sb.append(", updated=").append(updated);
|
84 |
sb.append(", created=").append(created);
|
85 |
sb.append(", progress=").append(progress);
|
86 |
sb.append(", status=").append(status);
|
87 |
sb.append('}');
|
88 |
return sb.toString();
|
89 |
} |
90 |
|
91 |
enum Status implements Serializable { |
92 |
UNKNOWN, ACTIVE, SAVING, PREPARING, QUEUED, FAILED |
93 |
} |
94 |
} |