class HubOfflineGenerator extends AlertGenerator {

   @Override
   protected void handleMessage(SubsystemContext<PlaceMonitorSubsystemModel> context, AlertScratchPad scratch, PlatformMessage msg, Model m) {
      switch(msg.getMessageType()) {
         case PlaceMonitorSubsystemCapability.HubOfflineEvent.NAME:
            scratch.putAlert(SmartHomeAlerts.create(
               SmartHomeAlert.ALERTTYPE_PLACE_HUB_OFFLINE,
               SmartHomeAlert.SEVERITY_BLOCK,
               Address.platformService(context.getPlaceId(), PlaceCapability.NAMESPACE),
               generateAttributes(m),
               context.getPlaceId()
            ));
            break;
         case PlaceMonitorSubsystemCapability.HubOnlineEvent.NAME:
         case HubCapability.HubConnectedEvent.NAME:
            scratch.removeAlert(AlertKeys.key(SmartHomeAlert.ALERTTYPE_PLACE_HUB_OFFLINE, context.getPlaceId()));
            break;
         default:
            break;
      }
   }

}