public static void main(String[] args) throws Exception { if(args.length != 3) { System.out.println("Usage: java PrintAlarmManager " + "<url> <username> <password>"); return; } ServiceInstance si = new ServiceInstance( new URL(args[0]), args[1], args[2], true); AlarmManager alarmMgr = si.getAlarmManager(); System.out.println("Alarm expressions:"); AlarmExpression[] defaultExps = alarmMgr.getDefaultExpression(); printAlarmExpressions(defaultExps); System.out.println("\n\nAlarm descriptions:"); AlarmDescription ad = alarmMgr.getDescription(); printAlarmDescription(ad); si.getServerConnection().logout(); }
static void printAlarmDescription(AlarmDescription ad) { System.out.println("Entity statuses:"); printElementDescriptions(ad.getEntityStatus()); System.out.println("\nHostSystem connection states:"); printElementDescriptions(ad.getHostSystemConnectionState()); System.out.println("\nMetric operators:"); printElementDescriptions(ad.getMetricOperator()); System.out.println("\nState operators:"); printElementDescriptions(ad.getStateOperator()); System.out.println("\nVirtual machine power states:"); printElementDescriptions(ad.getVirtualMachinePowerState()); System.out.println("\nAction class descriptions:"); printTypeDescriptions(ad.getAction()); System.out.println("\nDescriptions of expressioin type " + "for triggers:"); printTypeDescriptions(ad.getExpr()); }
AlarmDescription getDescription();