当前位置: 首页>>代码示例>>Java>>正文


Java TaskInfo.getCompleteTime方法代码示例

本文整理汇总了Java中com.vmware.vim25.TaskInfo.getCompleteTime方法的典型用法代码示例。如果您正苦于以下问题:Java TaskInfo.getCompleteTime方法的具体用法?Java TaskInfo.getCompleteTime怎么用?Java TaskInfo.getCompleteTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vmware.vim25.TaskInfo的用法示例。


在下文中一共展示了TaskInfo.getCompleteTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: printTaskInfo

import com.vmware.vim25.TaskInfo; //导入方法依赖的package包/类
static void printTaskInfo(TaskInfo ti)
{
  System.out.println("\nName:" + ti.getName());
  System.out.println("Key:" + ti.getKey());
  System.out.println("Entity:" + ti.getEntityName());
  System.out.println("Reason:" + taskReason(ti.getReason()));
  System.out.println("QueueTime:" 
      + ti.getQueueTime().getTime());
  Calendar calStart = ti.getStartTime();
  Date dateStart = calStart==null? null : calStart.getTime();
  System.out.println("StartTime:" + dateStart);
  Calendar calStop = ti.getCompleteTime();
  Date dateStop = calStop==null? null : calStop.getTime();
  System.out.println("CompleteTime:" + dateStop);
  System.out.println("Cancelable:" + ti.isCancelable());
  System.out.println("Cancelled:" + ti.isCancelled());
}
 
开发者ID:Juniper,项目名称:vijava,代码行数:18,代码来源:TaskHistoryMonitor.java

示例2: logTaskInfo

import com.vmware.vim25.TaskInfo; //导入方法依赖的package包/类
private void logTaskInfo(TaskInfo info) {
    if (info == null) {
        logger.debug("Deleted task info key");
        return;
    }

    TaskInfoState state = info.getState();

    Integer progress = info.getProgress();
    if (state == TaskInfoState.SUCCESS) {
        progress = Integer.valueOf(100);
    } else if (progress == null) {
        progress = Integer.valueOf(0);
    }

    LocalizableMessage desc = info.getDescription();
    String description = desc != null ? desc.getMessage() : "";

    XMLGregorianCalendar queueT = info.getQueueTime();
    String queueTime = queueT != null
            ? queueT.toGregorianCalendar().getTime().toString() : "";

    XMLGregorianCalendar startT = info.getStartTime();
    String startTime = startT != null
            ? startT.toGregorianCalendar().getTime().toString() : "";

    XMLGregorianCalendar completeT = info.getCompleteTime();
    String completeTime = completeT != null
            ? completeT.toGregorianCalendar().getTime().toString() : "";

    logger.debug("Save task info key: " + info.getKey() + " name: "
            + info.getName() + " target: " + info.getEntityName()
            + " state: " + state.name() + " progress: " + progress
            + "% description: " + description + " queue-time: " + queueTime
            + " start-time: " + startTime + " complete-time: "
            + completeTime);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:38,代码来源:VMPropertyHandler.java

示例3: logTaskInfo

import com.vmware.vim25.TaskInfo; //导入方法依赖的package包/类
private void logTaskInfo(TaskInfo info) {
    String key = info.getKey();
    String name = info.getName();
    String target = info.getEntityName();
    TaskInfoState state = info.getState();
    Integer progress = info.getProgress();
    if (state == TaskInfoState.SUCCESS) {
        progress = Integer.valueOf(100);
    } else if (progress == null) {
        progress = Integer.valueOf(0);
    }
    LocalizableMessage desc = info.getDescription();
    String description = desc != null ? desc.getMessage() : "";
    TaskReason reason = info.getReason();
    String initiatedBy = "";
    if (reason != null) {
        if (reason instanceof TaskReasonUser) {
            initiatedBy = ((TaskReasonUser) reason).getUserName();
        } else if (reason instanceof TaskReasonSystem) {
            initiatedBy = "System";
        } else if (reason instanceof TaskReasonSchedule) {
            initiatedBy = ((TaskReasonSchedule) reason).getName();
        } else if (reason instanceof TaskReasonAlarm) {
            initiatedBy = ((TaskReasonAlarm) reason).getAlarmName();
        }
    }

    XMLGregorianCalendar queueT = info.getQueueTime();
    String queueTime = queueT != null
            ? queueT.toGregorianCalendar().getTime().toString() : "";
    XMLGregorianCalendar startT = info.getStartTime();
    String startTime = startT != null
            ? startT.toGregorianCalendar().getTime().toString() : "";
    XMLGregorianCalendar completeT = info.getCompleteTime();
    String completeTime = completeT != null
            ? completeT.toGregorianCalendar().getTime().toString() : "";
    logger.debug(key + " name: " + name + " target: " + target + " state: "
            + state + " progress: " + progress + "% description: "
            + description + " initiated: " + initiatedBy + " queue-time: "
            + queueTime + " start-time: " + startTime + " complete-time: "
            + completeTime);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:43,代码来源:Actions.java


注:本文中的com.vmware.vim25.TaskInfo.getCompleteTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。