Created
July 26, 2011 14:24
-
-
Save axeda/1106878 to your computer and use it in GitHub Desktop.
Alarm Object Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.axeda.drm.sdk.Context | |
| import com.axeda.drm.sdk.data.HistoricalAlarmFinder | |
| import java.util.Calendar | |
| import com.axeda.common.sdk.jdbc.DateQuery | |
| // get Date object for an hour ago | |
| Calendar cal = Calendar.getInstance() | |
| cal.add(Calendar.HOUR, -parameters.hours.toInteger()) | |
| Date sinceTime = cal.getTime() | |
| HistoricalAlarmFinder findAlarms = new HistoricalAlarmFinder (Context.create()) | |
| findAlarms.device = alarm.device | |
| findAlarms.setAlarmName(alarm.name) | |
| findAlarms.date = DateQuery.after(sinceTime) | |
| List matchingAlarms = findAlarms.findAll() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment