Skip to content

Instantly share code, notes, and snippets.

@axeda
Created July 26, 2011 14:24
Show Gist options
  • Select an option

  • Save axeda/1106878 to your computer and use it in GitHub Desktop.

Select an option

Save axeda/1106878 to your computer and use it in GitHub Desktop.
Alarm Object Script
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