Validate event id for matching transition in context event.

@param eventId    the event id
@param context    the context
@param attributes the attributes
@return the event
970193
public static Event validateEventIdForMatchingTransitionInContext(final String eventId,
                                                                      final Optional<RequestContext> context,
                                                                      final Map<String, Object> attributes) {
        val attributesMap = new LocalAttributeMap<Object>(attributes);
        val event = new Event(eventId, eventId, attributesMap);

        return context.map(ctx -> {
            val def = ctx.getMatchingTransition(event.getId());
            if (def == null) {
                throw new AuthenticationException("Transition definition cannot be found for event " + event.getId());
            }
            return event;
        }).orElse(event);
    }
1026792
private Event newEvent(final String id, final Exception error) {
        return new EventFactorySupport().event(this, id, new LocalAttributeMap<>("error", error));
    }
896270
@Override
    public void configurationEvent(ConfigurationEvent event) {
        LOGGER.debug("event received : " + event.getPid() + " - " + event.getType());
        try {
            lock.lock();
            final List<InstanceDeclaration> impacted
                    = getDeclarationsByConfiguration(event.getPid(), event.getFactoryPid());

            if (impacted.isEmpty()) {
                return;
            }

            switch (event.getType()) {
                case ConfigurationEvent.CM_DELETED:
                    for (InstanceDeclaration declaration : impacted) {
                        LOGGER.info("Configuration " + event.getPid() + " deleted");
                        declaration.dispose(event.getPid());
                    }
                    break;
                case ConfigurationEvent.CM_UPDATED:
                    for (InstanceDeclaration declaration : impacted) {
                        final Configuration configuration = find(event.getPid());
                        if (configuration == null) {
                            LOGGER.error("Weird case, a matching declaration was found, but cannot be found a second " +
                                    "times, may be because of rapid changes in the config admin");
                        } else {
                            declaration.attachOrUpdate(configuration);
                        }
                    }

                    break;
            }
        } finally {
            lock.unlock();
        }

    }
748615
public EventBase getEvent(final String eventId) throws Exception {
        final String eventPath = StringUtils.join(new String[]{
                getUri(),
                "events",
                eventId
        }, '/');
        final JSONObject jsonObject = toJSONObject(client.get(eventPath, null));
        return new EventBase(jsonObject);
    }
199054
public void propertyChange(PropertyChangeEvent event)
	{
		if (contains(event.getSource()) && "beanContext".equals(event.getPropertyName()) && event.getOldValue() == getBeanContextPeer())
		{
			remove(event.getSource(), false);
		}
	}
1103319
@Override
	public void onApplicationEvent(ApplicationEvent event) {
		if (event instanceof ContextRefreshedEvent) {
		    // Firstly dump out all the properties read from the various files
		    dumpProperties();
            // now init the identity resolver
            setIdentityResolver(identityResolverFactory.getIdentityResolver());
            // start
            start();
		}
	}
1146389
public void pushAttributeValueEvent(final String deviceName, final String attributeName) throws DevFailed {
        xlogger.entry();
        for (final EventType eventType : EventType.getEventAttrValueTypeList()) {
            pushAttributeValueEventIdlLoop(deviceName, attributeName, eventType);
        }
        xlogger.exit();
    }
529185
public static Map<String, Object> getRequestParameters(final Collection<String> attributes, final HttpServletRequest context) {
        return attributes.stream()
            .filter(a -> StringUtils.isNotBlank(context.getParameter(a)))
            .map(m -> {
                val values = context.getParameterValues(m);
                val valuesSet = new LinkedHashSet<Object>();
                if (values != null && values.length > 0) {
                    Arrays.stream(values).forEach(v -> valuesSet.addAll(Arrays.stream(v.split(" ")).collect(Collectors.toSet())));
                }
                return Pair.of(m, valuesSet);
            })
            .collect(Collectors.toMap(Pair::getKey, Pair::getValue));
    }
888953
protected synchronized void fireAttributeAddedEvent(String name, AttributeValue attr) {
		if (this.listenerList != null && isEventFirable()) {
			final AttributeChangeListener[] list = new AttributeChangeListener[this.listenerList.size()];
			this.listenerList.toArray(list);
			final AttributeChangeEvent event = new AttributeChangeEvent(
					this,
					Type.ADDITION,
					null,
					null,
					name,
					attr);
			for (final AttributeChangeListener listener : list) {
				listener.onAttributeChangeEvent(event);
			}
		}
	}
791384
public Transition getTransition(Long id) {
        for (Transition transition : getTransitions()) {
            if (transition.getId().equals(id))
                return transition;
        }
        return null; // not found
    }
866773
@Override
	public void contextInitialized(ServletContextEvent evt) {
		ServletContext sc = evt.getServletContext();

		// Initialize Jawr JS servlet
		ServletRegistration.Dynamic sr = sc.addServlet("JavascriptServlet",
				"net.jawr.web.servlet.JawrServlet");
		sr.setInitParameter("configLocation", "/jawr.properties");
		sr.addMapping("*.js");
		sr.setLoadOnStartup(0);

		// Initialize Jawr CSS servlet
		sr = sc.addServlet("CssServlet", "net.jawr.web.servlet.JawrServlet");
		sr.setInitParameter("configLocation", "/jawr.properties");
		sr.setInitParameter("type", JawrConstant.CSS_TYPE);
		sr.addMapping("*.css");
		sr.setLoadOnStartup(1);

		// Initialize Jawr Binary servlet
		sr = sc.addServlet("BinaryServlet", "net.jawr.web.servlet.JawrServlet");
		sr.setInitParameter("configLocation", "/jawr.properties");
		sr.setInitParameter("type", JawrConstant.BINARY_TYPE);
		sr.addMapping("*.jpg", "*.png", "*.gif", "*.woff", "*.ttf", "*.svg", "*.eot");
		sr.setLoadOnStartup(0);
	}
340838
public int getEventInstanceId() {
    if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_eventInstanceId == null)
      jcasType.jcas.throwFeatMissing("eventInstanceId", "de.unihd.dbs.uima.types.heideltime.Event");
    return jcasType.ll_cas.ll_getIntValue(addr, ((Event_Type)jcasType).casFeatCode_eventInstanceId);}
172456
public String extractTransition(XEvent event) {
		XAttribute attribute = event.getAttributes().get(KEY_TRANSITION);
		if (attribute == null) {
			return null;
		} else {
			return ((XAttributeLiteral) attribute).getValue();
		}
	}
243620
private AttributesImpl validateId(final String localName, final Attributes atts, final AttributesImpl modified) throws SAXException {
        AttributesImpl res = modified;
        final String cls = atts.getValue(ATTRIBUTE_NAME_CLASS);
        if (MAP_MAP.matches(cls)) {
            topicIds.clear();
        } else if (TOPIC_TOPIC.matches(cls)) {
            final String id = atts.getValue(ATTRIBUTE_NAME_ID);
            if (id == null) {
                switch (processingMode) {
                case STRICT:
                    throw new SAXException(MessageUtils.getMessage("DOTJ067E", localName).setLocation(locator).toString());
                case LAX:
                    if (res == null) {
                        res = new AttributesImpl(atts);
                    }
                    final String gen = "gen_" + UUID.randomUUID().toString();
                    addOrSetAttribute(res, ATTRIBUTE_NAME_ID, gen);
                    logger.error(MessageUtils.getMessage("DOTJ066E", localName, gen).setLocation(locator).toString());
                    break;
                case SKIP:
                    logger.error(MessageUtils.getMessage("DOTJ067E", localName).setLocation(locator).toString());
                    break;
                }
            }
            topicIds.clear();
        } else if (TOPIC_RESOURCEID.matches(cls) || DELAY_D_ANCHORID.matches(cls)) {
            // not considered a normal element ID
        } else {
            final String id = atts.getValue(ATTRIBUTE_NAME_ID);
            if (id != null) {
                if (topicIds.contains(id)) {
                    if (processingMode == Mode.STRICT) {
                        throw new SAXException(MessageUtils.getMessage("DOTJ057E", id).setLocation(locator).toString());
                    } else {
                        logger.warn(MessageUtils.getMessage("DOTJ057E", id).setLocation(locator).toString());
                    }
                }
                topicIds.add(id);
            }
        }
        return res;
    }
137519
public String getOpeningTagById(int elementId, String attributes)
    {
        return "<" + table.getKeyByValue(new Integer(elementId)) + " " + attributes + ">";
    }
111493
public ViewTransitionBuilder animator(@NonNull Context context, int animatorId) {
        animator(AnimatorInflater.loadAnimator(context, animatorId));
        return this;
    }
1301210
@Override
    public void onApplicationEvent(@Nonnull ApplicationEvent event) {
        if (event instanceof ContextRefreshedEvent) {
            synchronized (this) {
                ApplicationContext applicationContext = ((ContextRefreshedEvent) event).getApplicationContext();
                setApplicationContext(new WebApplicationContextAdapter(applicationContext, this.servletConfig.getServletContext()));

                // Configure the MVC infrastructure
                configureMultipartResolver();
                configureExceptionResolvers();
                configureHandlerAdapters();
                registerCustomArgumentResolvers();
                configureHandlerMappings();
                addNebaViewResolver();

                // Picks up the previously registered MVC infrastructure
                onRefresh(applicationContext);

                this.initialized = true;
            }
        }
    }