Handles the {@link ChargingStationStatusNotificationReceivedEvent}.

@param event the event to handle.
485115
@EventHandler
    public void handle(ChargingStationStatusNotificationReceivedEvent event) {
        ChargingStation chargingStation = repository.findOne(event.getChargingStationId().getId());

        if (chargingStation != null) {
            chargingStation.setStatus(event.getStatusNotification().getStatus());
            repository.createOrUpdate(chargingStation);
        }
    }
171377
@UiHandler("m_projectSelector")
    protected void onProjectChange(ValueChangeEvent<String> event) {

        if (m_initialized) {
            m_publishDialog.setProjectId(new CmsUUID(event.getValue()));
            m_publishDialog.setProjectChanged();
            m_publishDialog.updateResourceList();
        }
    }
898550
@EventHandler
    public void handle(ChargingStationPlacedEvent event) {
        LOG.info("ChargingStationPlacedEvent");

        updateLocationForChargingStation(event.getChargingStationId(), event.getCoordinates(), event.getAddress(), event.getAccessibility());
    }
1074746
@Controller(events = EventType.QUICK_REPLY, pattern = "(yes|no)")
    public void onReceiveQuickReply(Event event) {
        if ("yes".equals(event.getMessage().getQuickReply().getPayload())) {
            reply(event, "Cool! You can type: \n 1) Show Buttons \n 2) Show List \n 3) Setup meeting");
        } else {
            reply(event, "See you soon!");
        }
    }
299267
public void onApplicationEvent(ApplicationEvent event)
    {
        if ((event instanceof LoginEvent)
                && (event.getSource() != LoginEvent.NO_AUTHENTICATION))
            handleLoginEvent((LoginEvent) event);
        else if ((event instanceof LogoutEvent))
            handleLogoutEvent((LogoutEvent) event);
    }
995456
@Override
  public void onNext(final T event) {
    final EventHandler<T> handler = (EventHandler<T>) map.get(event.getClass());
    if (handler == null) {
      throw new WakeRuntimeException("No event " + event.getClass() + " handler");
    }
    handler.onNext(event);
  }
711919
private void fireReceiveAllowedStateChangeEvent(boolean newState)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "fireReceiveAllowedStateChangeEvent", Boolean.valueOf(newState));

        MessageProcessor messageProcessor = getMessageProcessor();

        if (messageProcessor.getMessagingEngine().isEventNotificationEnabled())
        {
            // Build the message for the Notification

            String message =
                            nls.getFormattedMessage("NOTIFY_RECEIVE_ALLOWED_STATE_CHANGE_CWSIP0552",
                                                    new Object[] { getName(),
                                                                  getUuid().toString(),
                                                                  Boolean.valueOf(newState) },
                                                    null);

            // Build the properties for the Notification
            Properties props = new Properties();

            props.put(SibNotificationConstants.KEY_DESTINATION_NAME, getName());
            props.put(SibNotificationConstants.KEY_DESTINATION_UUID, getUuid().toString());

            if (newState)
                props.put(SibNotificationConstants.KEY_RECEIVE_ALLOWED_STATE,
                          SibNotificationConstants.RECEIVE_ALLOWED_TRUE);
            else
                props.put(SibNotificationConstants.KEY_RECEIVE_ALLOWED_STATE,
                          SibNotificationConstants.RECEIVE_ALLOWED_FALSE);

            // Now create the Event object to pass to the control adapter
            MPRuntimeEvent MPevent =
                            new MPRuntimeEvent(SibNotificationConstants.TYPE_SIB_MESSAGEPOINT_RECEIVE_ALLOWED_STATE,
                                            message,
                                            props);
            // Fire the event
            runtimeEventOccurred(MPevent);
        }
        else
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(tc, "fireReceiveAllowedStateChangeEvent", "Event Notification is disabled, cannot fire event");
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "fireReceiveAllowedStateChangeEvent");
    }
964812
@Override
    public void configurationEvent(ConfigurationEvent event) {
        if (event.getType() == ConfigurationEvent.CM_UPDATED && event.getPid().equals(pid)) {
            processProperties();
            initializeInterceptor();
        }

    }
1299952
@EventHandler
    public void handle(ComponentAvailabilityChangedToOperativeEvent event) {
        updateComponentAvailability(event.getChargingStationId(), event.getComponentId(), event.getComponent(), Availability.OPERATIVE);
    }
582118
@EventHandler
    public void handle(ChargingStationOpeningTimesAddedEvent event) {
        LOG.info("ChargingStationOpeningTimesAddedEvent");

        ChargingStation chargingStation = getChargingStation(event.getChargingStationId());
        if (chargingStation != null) {
            if (chargingStation.getOpeningTimes() == null) {
                chargingStation.setOpeningTimes(new HashSet<io.motown.vas.viewmodel.persistence.entities.OpeningTime>());
            }
            chargingStation.getOpeningTimes().addAll(convertFromApiOpeningTimes(event.getOpeningTimes()));
            chargingStationRepository.createOrUpdate(chargingStation);
        }
    }
510089
public void notifyEventListeners(ZWaveEvent event) {
		logger.debug("Notifying event listeners");
		for (ZWaveEventListener listener : this.zwaveEventListeners) {
			logger.trace("Notifying {}", listener.toString());
			listener.ZWaveIncomingEvent(event);
		}
	}
501165
private void onMessageSent(MessageSentEvent event) {
        handler.post(() -> listener.onMessageSent(event));
        log("Event published " + event.toString());
    }
14099
public void addNotification(@Observes final DesignerNotificationEvent event) {
        if (user.getIdentifier().equals(event.getUserId())) {

            if (event.getNotification() != null && !event.getNotification().equals("openinxmleditor")) {
                final NotificationPopupView view = new NotificationPopupView();
                activeNotifications.add(view);
                view.setPopupPosition(getMargin(),
                                      activeNotifications.size() * SPACING);

                view.setNotification(event.getNotification());
                view.setType(event.getType());
                view.setNotificationWidth(getWidth() + "px");
                view.show(new Command() {

                    @Override
                    public void execute() {
                        //The notification has been shown and can now be removed
                        deactiveNotifications.add(view);
                        remove();
                    }
                });
            }
        }
    }
1065367
public void notifyMonitors(ProcessInstance processInstance, String event) {
        // notify registered monitors
        Process processVO = getMainProcessDefinition(processInstance);
        Package pkg = PackageCache.getProcessPackage(processVO.getId());
        // runtime context for enablement does not contain hydrated variables map (too expensive)
        List<ProcessMonitor> monitors = MonitorRegistry.getInstance()
                .getProcessMonitors(new ProcessRuntimeContext(pkg, processVO, processInstance,
                        getDataAccess().getPerformanceLevel(), isInService(), new HashMap<>()));
        if (!monitors.isEmpty()) {
            Map<String,Object> vars = new HashMap<>();
            if (processInstance.getVariables() != null) {
                for (VariableInstance var : processInstance.getVariables()) {
                    Object value = var.getData();
                    if (value instanceof DocumentReference) {
                        try {
                            Document docVO = getDocument((DocumentReference) value, false);
                            value = docVO == null ? null : docVO.getObject(var.getType(), pkg);
                        }
                        catch (DataAccessException ex) {
                            logger.severeException(ex.getMessage(), ex);
                        }
                    }
                    vars.put(var.getName(), value);
                }
            }
            ProcessRuntimeContext runtimeContext = new ProcessRuntimeContext(pkg, processVO, processInstance,
                    getDataAccess().getPerformanceLevel(), isInService(), vars);

            for (ProcessMonitor monitor : monitors) {
                try {
                    if (monitor instanceof OfflineMonitor) {
                        @SuppressWarnings("unchecked")
                        OfflineMonitor<ProcessRuntimeContext> processOfflineMonitor = (OfflineMonitor<ProcessRuntimeContext>) monitor;
                        new OfflineMonitorTrigger<>(processOfflineMonitor, runtimeContext).fire(event);
                    }
                    else {
                        if (WorkStatus.LOGMSG_PROC_START.equals(event)) {
                            Map<String,Object> updated = monitor.onStart(runtimeContext);
                            if (updated != null) {
                                for (String varName : updated.keySet()) {
                                    if (processInstance.getVariables() == null)
                                        processInstance.setVariables(new ArrayList<>());
                                    Variable varVO = processVO.getVariable(varName);
                                    if (varVO == null || !varVO.isInput())
                                        throw new ProcessException("Process '" + processVO.getFullLabel() + "' has no such input variable defined: " + varName);
                                    if (processInstance.getVariable(varName) != null)
                                        throw new ProcessException("Process '" + processVO.getFullLabel() + "' input variable already populated: " + varName);
                                    if (VariableTranslator.isDocumentReferenceVariable(runtimeContext.getPackage(), varVO.getType())) {
                                        DocumentReference docRef = createDocument(varVO.getType(), OwnerType.VARIABLE_INSTANCE, new Long(0),
                                                updated.get(varName));
                                        VariableInstance varInst = createVariableInstance(processInstance, varName, docRef);
                                        updateDocumentInfo(docRef, processVO.getVariable(varInst.getName()).getType(), OwnerType.VARIABLE_INSTANCE,
                                                varInst.getInstanceId(), null, null);
                                        processInstance.getVariables().add(varInst);
                                    }
                                    else {
                                        VariableInstance varInst = createVariableInstance(processInstance, varName, updated.get(varName));
                                        processInstance.getVariables().add(varInst);
                                    }
                                }
                            }
                        }
                        else if (WorkStatus.LOGMSG_PROC_ERROR.equals(event)) {
                            monitor.onError(runtimeContext);
                        }
                        else if (WorkStatus.LOGMSG_PROC_COMPLETE.equals(event)) {
                            monitor.onFinish(runtimeContext);
                        }
                    }
                }
                catch (Exception ex) {
                    logger.severeException(ex.getMessage(), ex);
                }
            }
        }
    }
445670
public void onNotify(RequestEvent event, ActivityContextInterface aci) {
		if (tracer.isFineEnabled())
			tracer.fine("Received Notify, on activity: " + aci.getActivity() + "\nRequest:\n" + event.getRequest());
		
		Request request = event.getRequest();
		SubscriptionData subscriptionData = getSubscriptionDataCMP();
		EventHeader eventHeader = (EventHeader) request.getHeader(EventHeader.NAME);
		if (eventHeader == null || !eventHeader.getEventType().equals(subscriptionData.getEventPackage())) {
			try {
				Response badEventResponse = this.messageFactory.createResponse(Response.BAD_EVENT, request);
				event.getServerTransaction().sendResponse(badEventResponse);
				// TODO: terminate dialog?
			} catch (Exception e) {
				if (tracer.isSevereEnabled()) {
					tracer.severe("Failed to create 489 answer to NOTIFY", e);
				}

			}
			return;
			
		} else {

			try {
				Response okResponse = this.messageFactory.createResponse(Response.OK, request);
				event.getServerTransaction().sendResponse(okResponse);				
			} catch (Exception e) {
				if (tracer.isSevereEnabled()) {
					tracer.severe("Failed to create 200 answer to NOTIFY", e);
				}
				return;
			}
		}
		// lets create Notify
		Notify notify = new Notify();
		notify.setSubscriber(subscriptionData.getSubscriberURI());

		ContentTypeHeader contentType = (ContentTypeHeader) request.getHeader(ContentTypeHeader.NAME);
		if (contentType != null) {
			// use CT Header?
			notify.setContentType(contentType.getContentType());
			notify.setContentSubType(contentType.getContentSubType());
			notify.setContent(new String(request.getRawContent()));
		}
		notify.setNotifier(subscriptionData.getNotifierURI());
		// check, whats in header.

		SubscriptionStateHeader subscriptionStateHeader = (SubscriptionStateHeader) request.getHeader(SubscriptionStateHeader.NAME);

		SubscriptionStatus state = SubscriptionStatus.fromString(subscriptionStateHeader.getState());
		notify.setStatus(state);
		
		// do magic
		switch (state) {
		case active:
		case pending:
			// check for exp
			if (subscriptionStateHeader.getExpires() != Notify.NO_TIMEOUT) {
				notify.setExpires(subscriptionStateHeader.getExpires());
				// set timer if needed
				SubscribeRequestType subscribeRequestType = getSubscribeRequestTypeCMP();
				if (subscribeRequestType == SubscribeRequestType.NEW || subscribeRequestType == SubscribeRequestType.REFRESH) {
					startExpiresTimer(aci,subscriptionStateHeader.getExpires());
					setSubscribeRequestTypeCMP(null);
				}								
			}

			break;
		case waiting:
			// nothing...
			break;
		case extension:
			notify.setStatusExtension(subscriptionStateHeader.getState());
		case terminated:
		 	// check reason
			String reasonString = subscriptionStateHeader.getReasonCode();
			TerminationReason reason = TerminationReason.fromString(reasonString);
			notify.setTerminationReason(reason);
			if (reason != null) {
				switch (reason) {
				case rejected:
				case noresource:
				case deactivated:
				case timeout:
					break;
				case probation:
				case giveup:
					if (subscriptionStateHeader.getRetryAfter() != Notify.NO_TIMEOUT) {
						notify.setRetryAfter(subscriptionStateHeader.getRetryAfter());
					}
					break;

				case extension:
					notify.setTerminationReasonExtension(reasonString);
					break;
				}
			}
			break;

		}
		// deliver to parent
		try {
			SbbLocalObjectExt sbbLocalObjectExt = sbbContext.getSbbLocalObject();
			if(state == SubscriptionStatus.terminated)
			{
				cancelExpiresTimer(aci);
				aci.detach(sbbLocalObjectExt);
				event.getDialog().delete();
			}
			((SubscriptionClientParentSbbLocalObject)sbbLocalObjectExt.getParent()).onNotify(notify, (SubscriptionClientChildSbbLocalObject) sbbLocalObjectExt);
		} catch (Exception e) {
			if (tracer.isSevereEnabled()) {
				tracer.severe("Received exception from parent on notify callback", e);
			}
		}

	}
530271
@Override
    public void onReceive(Context context, Intent intent) {
        String messageId = intent.getStringExtra(ID);
        MFPPush.getInstance().changeStatus(messageId, MFPPushNotificationStatus.DISMISSED);
    }
422517
public void processEvent(ContentEvent event, int counter) {
		if (this.piInstances == null || this.piInstances.size() < this.getParallelism())
			throw new IllegalStateException("ThreadsWorkerProcessingItem(s) need to be setup before process any event (i.e. in ThreadsTopology.start()).");
		
		ThreadsProcessingItemInstance piInstance = this.piInstances.get(counter);
		ThreadsEventRunnable runnable = new ThreadsEventRunnable(piInstance, event);
		ThreadsEngine.getThreadWithIndex(piInstance.getThreadIndex()).submit(runnable);
	}