class CellServiceErrorGenerator extends AlertGenerator {

   @Override
   protected void handleModelChanged(SubsystemContext<PlaceMonitorSubsystemModel> context, Model model, AlertScratchPad scratchPad) {
      Model hub = SmartHomeAlerts.hubModel(context);
      if(hub == null) {
         context.logger().info("ignoring model changes for cellbackup because {} has not hub", context.getPlaceId());
         return;
      }

      if(CellBackupSubsystemModel.isStatusERRORED(model)) {
         String key = SmartHomeAlert.ALERTTYPE_PLACE_4G_SERVICE_ERROR;
         if(CellBackupSubsystemModel.isErrorStateDISABLED(model)) {
            scratchPad.removeAlert(AlertKeys.key(SmartHomeAlert.ALERTTYPE_PLACE_4G_SERVICE_ERROR, context.getPlaceId()));
            key = SmartHomeAlert.ALERTTYPE_PLACE_4G_SERVICE_SUSPENDED;
         } else {
            scratchPad.removeAlert(AlertKeys.key(SmartHomeAlert.ALERTTYPE_PLACE_4G_SERVICE_SUSPENDED, context.getPlaceId()));
         }
         scratchPad.putAlert(SmartHomeAlerts.create(
            key,
            SmartHomeAlert.SEVERITY_LOW,
            Address.platformService(context.getPlaceId(), PlaceCapability.NAMESPACE),
            ImmutableMap.of(CONTEXT_ATTR_HUBID, hub.getId()),
            context.getPlaceId()
         ));
      } else {
         scratchPad.removeAlert(AlertKeys.key(SmartHomeAlert.ALERTTYPE_PLACE_4G_SERVICE_SUSPENDED, context.getPlaceId()));
         scratchPad.removeAlert(AlertKeys.key(SmartHomeAlert.ALERTTYPE_PLACE_4G_SERVICE_ERROR, context.getPlaceId()));
      }
   }

}