この製品のマニュアルセットは、偏向のない言語を使用するように配慮されています。このマニュアルセットでの偏向のない言語とは、年齢、障害、性別、人種的アイデンティティ、民族的アイデンティティ、性的指向、社会経済的地位、およびインターセクショナリティに基づく差別を意味しない言語として定義されています。製品ソフトウェアのユーザーインターフェイスにハードコードされている言語、RFP のドキュメントに基づいて使用されている言語、または参照されているサードパーティ製品で使用されている言語によりドキュメントに例外が存在する場合があります。シスコのインクルーシブランゲージに対する取り組みの詳細は、こちらをご覧ください。
このドキュメントは、米国シスコ発行ドキュメントの参考和訳です。リンク情報につきましては、日本語版掲載時点で、英語版にアップデートがあり、リンク先のページが移動/変更されている場合がありますことをご了承ください。あくまでも参考和訳となりますので、正式な内容については米国サイトのドキュメントを参照ください。
この章は、次の項で構成されています。
変更トラッキング API を使用して、モジュール経由で行った変更をトラッキングし、変更内容をデータベースに記録できます。
コンストラクタは ChangeTrackingAPI です。
package com.cloupia.feature.foo.scheduledTasks;
import org.apache.log4j.Logger;
import com.cloupia.feature.foo.FooModule;
import com.cloupia.model.cIM.ChangeRecord;
import com.cloupia.service.cIM.inframgr.AbstractScheduleTask;
import com.cloupia.service.cIM.inframgr.FeatureContainer;
import com.cloupia.service.cIM.inframgr.cmdb.ChangeTrackingAPI;
/**
* This is a simple example demonstrating how to implement a scheduled task. This task is executed
* every 5 mins and simply makes a logging statement and increments the number of times it's been
* executed. It removes itself from the system once it has been executed twice. It also
* demonstrates how you can use the change tracking APIs to track changes made to the system.
*
*/
public class DummyScheduleTask extends AbstractScheduleTask {
private static Logger logger = Logger.getLogger(DummyScheduleTask.class);
private int numTimesExecuted = 0;
private static final long TWO_MINS = 60*1000*2;
private static final int MAX_TIMES_EXECUTED = 2;
public DummyScheduleTask() {
super("foo");
}
@Override
public void execute(long lastExecution) throws Exception {
logger.info("vxvxvxvxvx - dummyTask has been executed " + numTimesExecuted + " times.");
numTimesExecuted++;
if (numTimesExecuted == MAX_TIMES_EXECUTED) {
logger.info("vxvxvxvxvx - removing dummyTask");
FooModule module = (FooModule) FeatureContainer.getInstance().getModuleById("foo");
//NOTE: Use getTaskName() and NOT getScheduleTaskName(), it's really important
//We distinguish the two: getTaskName is used internally by the system, where we do
//some extra stuff to ensure uniqueness of the task name (prepend moduleID), so we need to
//make sure to use this when removing tasks!
module.removeScheduleTask(this.getTaskName());
//use the static ChangeTrackingAPI to create an instance of ChangeRecord, these are just values you'd like have
//tracked and store in the changes DB
ChangeRecord rec = ChangeTrackingAPI.create("openAutoDeveloper", ChangeRecord.CHANGE_TYPE_DELETE, "Dummy Task removed from System",
"foo dummy task");
//insert the record like so
ChangeTrackingAPI.insertRecord(rec);
}
}
@Override
public long getFrequency() {
return TWO_MINS;
}
@Override
protected String getScheduleTaskName() {
//usually good idea to name your task something descriptive
return "dummyTask";
}
}
![]() ヒント | 変更トラッキング レコード(CMDB)を Cisco UCS Director GUI から表示するには、[管理(Administration)] > [統合(Integration)] > [レコードの変更(Change Records)] の順に選択します。 |