com.cloudera.api.model
Class ApiCommand

java.lang.Object
  extended by com.cloudera.api.model.ApiCommand
Direct Known Subclasses:
ApiReplicationCommand, ApiSnapshotCommand

public class ApiCommand
extends Object

Provides detailed information about a submitted command.

There are two types of commands: synchronous and asynchronous. Synchronous commands complete immediately, and their results are passed back in the returned command object after the execution of an API call. Outside of that returned object, there is no way to check the result of a synchronous command.

Asynchronous commands have unique non-negative IDs. They may still be running when the API call returns. Clients can check the status of such commands using the API.


Constructor Summary
ApiCommand()
           
ApiCommand(Long id, String name, Date startTime, Date endTime, boolean active, Boolean success, String resultMessage, String resultDataUrl, ApiClusterRef clusterRef, ApiServiceRef serviceRef, ApiRoleRef roleRef, ApiHostRef hostRef, ApiCommandList children, ApiCommand parent, Boolean canRetry)
           
 
Method Summary
 boolean equals(Object o)
           
 Boolean getCanRetry()
          If the command can be retried.
 ApiCommandList getChildren()
          List of child commands.
 ApiClusterRef getClusterRef()
          Reference to the cluster (for cluster commands only).
 Date getEndTime()
          The end time, if the command is finished.
 ApiHostRef getHostRef()
          Reference to the host (for host commands only).
 Long getId()
          The command ID.
 String getName()
          The command name.
 ApiCommand getParent()
          Reference to the parent command, if any.
 String getResultDataUrl()
          URL to the command's downloadable result data, if any exists.
 String getResultMessage()
          If the command is finished, the result message.
 ApiRoleRef getRoleRef()
          Reference to the role (for role commands only).
 ApiServiceRef getServiceRef()
          Reference to the service (for service commands only).
 Date getStartTime()
          The start time.
 Boolean getSuccess()
          If the command is finished, whether it was successful.
 int hashCode()
           
 boolean isActive()
          Whether the command is currently active.
 Boolean isCanRetry()
          Deprecated. Use getCanRetry() instead
 void setActive(boolean active)
           
 void setCanRetry(Boolean canRetry)
           
 void setChildren(ApiCommandList children)
           
 void setClusterRef(ApiClusterRef clusterRef)
           
 void setEndTime(Date endTime)
           
 void setHostRef(ApiHostRef hostRef)
           
 void setId(Long id)
           
 void setName(String name)
           
 void setParent(ApiCommand parent)
           
 void setResultDataUrl(String resultDataUrl)
           
 void setResultMessage(String resultMessage)
           
 void setRoleRef(ApiRoleRef roleRef)
           
 void setServiceRef(ApiServiceRef serviceRef)
           
 void setStartTime(Date startTime)
           
 void setSuccess(Boolean success)
           
 String toString()
           
protected  com.google.common.base.Objects.ToStringHelper toStringHelper()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ApiCommand

public ApiCommand()

ApiCommand

public ApiCommand(Long id,
                  String name,
                  Date startTime,
                  Date endTime,
                  boolean active,
                  Boolean success,
                  String resultMessage,
                  String resultDataUrl,
                  ApiClusterRef clusterRef,
                  ApiServiceRef serviceRef,
                  ApiRoleRef roleRef,
                  ApiHostRef hostRef,
                  ApiCommandList children,
                  ApiCommand parent,
                  Boolean canRetry)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

toStringHelper

protected com.google.common.base.Objects.ToStringHelper toStringHelper()

getId

public Long getId()
The command ID.


setId

public void setId(Long id)

getName

public String getName()
The command name.


setName

public void setName(String name)

getStartTime

public Date getStartTime()
The start time.


setStartTime

public void setStartTime(Date startTime)

getEndTime

public Date getEndTime()
The end time, if the command is finished.


setEndTime

public void setEndTime(Date endTime)

isActive

public boolean isActive()
Whether the command is currently active.


setActive

public void setActive(boolean active)

getSuccess

public Boolean getSuccess()
If the command is finished, whether it was successful.


setSuccess

public void setSuccess(Boolean success)

getResultMessage

public String getResultMessage()
If the command is finished, the result message.


setResultMessage

public void setResultMessage(String resultMessage)

getResultDataUrl

public String getResultDataUrl()
URL to the command's downloadable result data, if any exists.


setResultDataUrl

public void setResultDataUrl(String resultDataUrl)

getClusterRef

public ApiClusterRef getClusterRef()
Reference to the cluster (for cluster commands only).


setClusterRef

public void setClusterRef(ApiClusterRef clusterRef)

getServiceRef

public ApiServiceRef getServiceRef()
Reference to the service (for service commands only).


setServiceRef

public void setServiceRef(ApiServiceRef serviceRef)

getRoleRef

public ApiRoleRef getRoleRef()
Reference to the role (for role commands only).


setRoleRef

public void setRoleRef(ApiRoleRef roleRef)

getHostRef

public ApiHostRef getHostRef()
Reference to the host (for host commands only).


setHostRef

public void setHostRef(ApiHostRef hostRef)

getParent

public ApiCommand getParent()
Reference to the parent command, if any.


setParent

public void setParent(ApiCommand parent)

getChildren

public ApiCommandList getChildren()
List of child commands. Only available in the full view.

The list contains only the summary view of the children.


setChildren

public void setChildren(ApiCommandList children)

isCanRetry

@Deprecated
public Boolean isCanRetry()
Deprecated. Use getCanRetry() instead

Available since V11


getCanRetry

public Boolean getCanRetry()
If the command can be retried. Available since V11


setCanRetry

public void setCanRetry(Boolean canRetry)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © Cloudera, Inc. Released under Apache License, Version 2.0.