/** * Create an instance of {@link OperationalRecord } * */ public OperationalRecord createOperationalRecord() { return new OperationalRecord(); }
ResultSet rs = com.executeQuery(); while (rs.next()) { OperationalRecord cur = new OperationalRecord(); cur.setID(rs.getString("id")); cur.setOperational(rs.getBoolean("status")); cur.setMessage(rs.getString("message")); GregorianCalendar cal = new GregorianCalendar(); cal.setTimeInMillis(now - limit); cur.setTimestamp((cal)); res.add(cur); rs = com.executeQuery(); while (rs.next()) { OperationalRecord cur = new OperationalRecord(); cur.setID(rs.getString("id")); cur.setOperational(rs.getBoolean("status")); cur.setMessage(rs.getString("message")); GregorianCalendar cal = new GregorianCalendar(); cal.setTimeInMillis(rs.getLong("utcdatetime")); cur.setTimestamp((cal)); res.add(cur); OperationalRecord cur = new OperationalRecord(); cur.setOperational(res.get(res.size() - 1).isOperational()); cur.setTimestamp((cal)); res.add(cur); Calendar tempcal = res.get(i).getTimestamp();
set = com.executeQuery(); while (set.next()) { OperationalRecord op = new OperationalRecord(); op.setID(set.getString("id")); byte[] b = set.getBytes("message"); op.setMessage(new String(b, Constants.CHARSET)); GregorianCalendar cal = new GregorianCalendar(); cal.setTimeInMillis(set.getLong("utcdatetime")); op.setTimestamp((cal)); op.setOperational(set.getBoolean("status")); ret.getOperationalRecord().add(op);
OperationalRecord cur = new OperationalRecord(); cur.setOperational(laststatus); cur.setTimestamp((cal)); res.getOperationalRecord().add(cur); Calendar tempcal = res.getOperationalRecord().get(i).getTimestamp(); tempcal.add(Calendar.SECOND, -1); Millisecond current = new Millisecond(tempcal.getTime()); Millisecond previous = new Millisecond(res.getOperationalRecord().get(i - 1).getTimestamp().getTime()); TimeSeriesDataItem t = null; if (res.getOperationalRecord().get(i - 1).isOperational()) { try { t = new TimeSeriesDataItem(previous, 1); if (res.getOperationalRecord().get(res.getOperationalRecord().size() - 1).isOperational()) { t = new TimeSeriesDataItem(new Millisecond(res.getOperationalRecord().get(res.getOperationalRecord().size() - 1).getTimestamp().getTime()), 1); s1.add(t); t = new TimeSeriesDataItem(new Millisecond(GregorianCalendar.getInstance().getTime()), 1); t = new TimeSeriesDataItem(new Millisecond(res.getOperationalRecord().get(res.getOperationalRecord().size() - 1).getTimestamp().getTime()), 0); s1.add(t); t = new TimeSeriesDataItem(new Millisecond(GregorianCalendar.getInstance().getTime()), 0);
t.setURL(list.getServiceType().get(i).getURL()); while (set.next()) { OperationalRecord op = new OperationalRecord(); op.setID(set.getString("id")); byte[] b = set.getBytes("message"); op.setMessage(new String(b, Constants.CHARSET)); GregorianCalendar cal = new GregorianCalendar(); cal.setTimeInMillis(set.getLong("utcdatetime")); op.setTimestamp((cal)); op.setOperational(set.getBoolean("status")); t.getOperationalRecord().add(op);