1 /**
2 * Licensed to jclouds, Inc. (jclouds) under one or more
3 * contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. jclouds 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 org.jclouds.trmk.vcloud_0_8.domain;
20
21 import java.util.Date;
22
23 import org.jclouds.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 }