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


Java TaskInfo.getDescription方法代码示例

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


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

示例1: 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

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