1 /**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * 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, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19 package org.jclouds.trmk.vcloud_0_8.domain;
20
21 import java.util.Date;
22
23 import javax.annotation.Nullable;
24
25 import org.jclouds.trmk.vcloud_0_8.domain.internal.TaskImpl;
26
27 import com.google.inject.ImplementedBy;
28
29 /**
30 * Whenever the result of a request cannot be returned immediately, the server creates a Task
31 * object. Tasks owned by an object such as a vApp or vDC are contained in the Tasks element of the
32 * object's XML representation. This element is read-only.
33 */
34 @ImplementedBy(TaskImpl.class)
35 public interface Task extends ReferenceType {
36 /**
37 * The current status of the task.
38 */
39 String getOperation();
40
41 /**
42 * The current status of the task.
43 */
44 TaskStatus getStatus();
45
46 /**
47 * date and time when the task was started.
48 */
49 Date getStartTime();
50
51 /**
52 * date and time when the task completed. Does not appear for running tasks.
53 */
54 Date getEndTime();
55
56 /**
57 * date and time at which the task expires. By default, tasks expire 24 hours after their start
58 * time. Expired tasks cannot be queried.
59 */
60 Date getExpiryTime();
61
62 /**
63 * A link to the object that owns the task. For copy operations, the owner is the copy that is
64 * being created. For delete operations, the owner is the deleted object, so this element is not
65 * included. For all other operations, the owner is the object to which the request was made.
66 */
67 ReferenceType getOwner();
68
69 /**
70 * error message or related information returned by the task
71 */
72 @Nullable
73 VCloudError getError();
74
75 }