本文整理匯總了Java中org.opengts.db.dmtp.Diagnostic類的典型用法代碼示例。如果您正苦於以下問題:Java Diagnostic類的具體用法?Java Diagnostic怎麽用?Java Diagnostic使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Diagnostic類屬於org.opengts.db.dmtp包,在下文中一共展示了Diagnostic類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getBodyDataIterator
import org.opengts.db.dmtp.Diagnostic; //導入依賴的package包/類
/**
*** Creates and returns an iterator for the row data displayed in the body of this report.
*** @return The body row data iterator
**/
public DBDataIterator getBodyDataIterator()
{
/* init */
this.rowData = new Vector<FieldData>();
/* loop through properties */
String accountID = this.getAccountID();
String deviceID = this.getFirstDeviceID();
long timeStart = this.getTimeStart();
long timeEnd = this.getTimeEnd();
try {
Account account = this.getAccount();
Device device = this.getDevice(deviceID);
if ((account != null) && (device != null)) {
TimeZone tz = account.getTimeZone(null);
Diagnostic diags[] = Diagnostic.getDiagnostics(accountID, deviceID, timeStart, timeEnd);
if (diags != null) {
for (int i = 0; i < diags.length; i++) {
diags[i].setDevice(device);
FieldData fd = new FieldData();
fd.setDevice(device);
fd.setString( FieldLayout.DATA_DEVICE_ID , deviceID);
fd.setLong( FieldLayout.DATA_TIMESTAMP , diags[i].getTimestamp());
fd.setBoolean(FieldLayout.DATA_DIAGNOSTIC_ERROR, diags[i].isError());
fd.setLong( FieldLayout.DATA_DIAGNOSTIC_KEY , (long)diags[i].getCodeKey());
fd.setString( FieldLayout.DATA_DIAGNOSTIC_DESC , diags[i].getDescription());
fd.setString( FieldLayout.DATA_DIAGNOSTIC_VALUE, diags[i].getValueAsString(tz));
this.rowData.add(fd);
}
}
} else {
// should never occur
Print.logError("Returned DeviceList 'Device' is null: " + deviceID);
}
} catch (DBException dbe) {
Print.logError("Error retrieving Device: " + deviceID);
}
/* return data iterator */
return new ListDataIterator(this.rowData);
}