/* (non-Javadoc)
@see org.apereo.portal.rendering.PipelineComponent#getEventReader(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
166869
@Override
    public PipelineEventReader<XMLEventReader, XMLEvent> getEventReader(
            HttpServletRequest request, HttpServletResponse response) {
        // Get the reader from the parent and add the attribute incorporating wrapper
        final PipelineEventReader<XMLEventReader, XMLEvent> cachingEventReader =
                this.wrappedComponent.getEventReader(request, response);
        final XMLEventReader eventReader =
                new AttributeIncorporatingXMLEventReader(
                        request, response, cachingEventReader.getEventReader());

        final Map<String, String> outputProperties = cachingEventReader.getOutputProperties();
        return new PipelineEventReaderImpl<XMLEventReader, XMLEvent>(eventReader, outputProperties);
    }
1273406
public static EventEngine getEventService() {
        WebContainer instance = (WebContainer) self.get();
        if (instance != null)
            return instance.eventService;

        return null;
    }
641790
@Override
	public Reader getResource(JoinableResourceBundle bundle, String resourceName, boolean processingBundle,
			List<Class<?>> excludedReader) throws ResourceNotFoundException {

		if (ThreadLocalJawrContext.isInterruptingProcessingBundle()) {
			throw new InterruptBundlingProcessException();
		}
		Reader rd = null;

		String resourceExtension = FileNameUtils.getExtension(resourceName);
		boolean generatedPath = generatorRegistry.isPathGenerated(resourceName);
		if (generatedPath || allowedExtensions.contains(resourceExtension.toLowerCase())) {
			List<TextResourceReader> list = new ArrayList<>();
			list.addAll(resourceReaders);
			for (TextResourceReader rsReader : list) {
				if (!isInstanceOf(rsReader, excludedReader)) {
					if (!(rsReader instanceof ResourceGenerator)
							|| ((ResourceGenerator) rsReader).getResolver().matchPath(resourceName)) {
						try {
							rd = rsReader.getResource(bundle, resourceName, processingBundle);
						} catch (Exception e) {
							if (LOGGER.isDebugEnabled()) {
								LOGGER.debug("An exception occured while trying to read resource '" + resourceName
										+ "'. Continuing with other readers. Error : ", e);
							} else if (LOGGER.isInfoEnabled()) {
								LOGGER.info("An exception occured while trying to read resource '" + resourceName
										+ "'. Continuing with other readers. Error : " + e.getMessage());
							}
						}
						if (rd != null) {
							break;
						}
					}
				}
			}
		} else {
			LOGGER.warn("The resource '" + resourceName + "' will not be read as its extension is not an allowed one.");
		}

		if (rd == null) {
			throw new ResourceNotFoundException(resourceName);
		}

		return rd;
	}
881038
protected PortalEvent.PortalEventBuilder createPortalEventBuilder(
            Object source, HttpServletRequest request) {
        request = getCurrentPortalRequest(request);
        final IPerson person = this.getPerson(request);
        return this.createPortalEventBuilder(source, person, request);
    }
894807
private EventHandler getEventHandler(Connection connection, String name) {
        final String READ_ONE_EVENT_HANDLER_QUERY = "SELECT json_data FROM meta_event_handler WHERE name = ?";

        return query(connection, READ_ONE_EVENT_HANDLER_QUERY,
                q -> q.addParameter(name).executeAndFetchFirst(EventHandler.class));
    }
1173919
@Override
    public XMLEventReader createFilteredReader(XMLEventReader reader, EventFilter filter) {
        return new Stax2FilteredEventReader(Stax2EventReaderAdapter.wrapIfNecessary(reader), filter);
    }
661355
public EventReader createReader() {
        return new EventReader(eventsProcessor, sourceFilter, eventFilter, progressReporter, exceptionHandler, sqsManager, s3Manager, config);
    }
983277
public <H extends EventHandler> H getHandler(GwtEvent.Type<H> type, int index) {
		return this.eventBus.superGetHandler(type, index);
	}
10064
public FireableEventType getEventId(EventLookupFacility eventLookupFacility,
			Response response) {

		String statusCodeName = null;
		final int responseStatus = response.getStatusCode();
		if (responseStatus == 100) {
			statusCodeName = "TRYING";
		} else if (100 < responseStatus && responseStatus < 200) {
			statusCodeName = "PROVISIONAL";
		} else if (responseStatus < 300) {
			statusCodeName = "SUCCESS";
		} else if (responseStatus < 400) {
			statusCodeName = "REDIRECT";
		} else if (responseStatus < 500) {
			statusCodeName = "CLIENT_ERROR";
		} else if (responseStatus < 600) {
			statusCodeName = "SERVER_ERROR";
		} else {
			statusCodeName = "GLOBAL_FAILURE";
		}

		// in dialog responses use the 1.1 event id prefix
		return getEventId(eventLookupFacility, new StringBuilder(RESPONSE_EVENT_PREFIX).append(statusCodeName).toString());
	}
978685
public static synchronized XMLEventReader createStringReader(final String paramString)
        throws IOException, XMLStreamException {
        final XMLInputFactory factory = XMLInputFactory.newInstance();
        factory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
        final InputStream in = new ByteArrayInputStream(paramString.getBytes());
        return factory.createXMLEventReader(in);
    }
1289197
public URLStreamHandler getHandler() throws Exception {
        String handlerString = getSSLProtocolPackageHandler() + ".https.Handler";
        URLStreamHandler streamHandler = null;

        try {
            ClassLoader cl = AccessController.doPrivileged(getCtxClassLoader);
            if (cl != null) {
                streamHandler = (URLStreamHandler) cl.loadClass(handlerString).newInstance();
            } else {
                streamHandler = (URLStreamHandler) Class.forName(handlerString).newInstance();
            }
            return streamHandler;
        } catch (Exception e) {
            FFDCFilter.processException(e, getClass().getName(), "getHandler", this);
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "Exception loading https stream handler.", new Object[] { e });
            Tr.error(tc, "ssl.load.https.stream.handler.CWPKI0025E", new Object[] { handlerString, e.getMessage() });
            throw e;
        }
    }
206305
public CloudTrailEvent getNextEvent() throws IOException {
        CloudTrailEventData eventData = new CloudTrailEventData();
        String key;

         /* Get next CloudTrailEvent event from log file. When failed to parse a event,
         * IOException will be thrown. In this case, the charEnd index the place we
         * encountered parsing error. */

        // return the starting location of the current token; that is, position of the first character
        // from input that starts the current token
        int charStart = (int) jsonParser.getTokenLocation().getCharOffset();

        while(jsonParser.nextToken() != JsonToken.END_OBJECT) {
            key = jsonParser.getCurrentName();

            switch (key) {
            case "eventVersion":
                String eventVersion = jsonParser.nextTextValue();
                if (Double.parseDouble(eventVersion) > SUPPORTED_EVENT_VERSION) {
                    logger.debug(String.format("EventVersion %s is not supported by CloudTrail.", eventVersion));
                }
                eventData.add(key, eventVersion);
                break;
            case "userIdentity":
                this.parseUserIdentity(eventData);
                break;
            case "eventTime":
                eventData.add(CloudTrailEventField.eventTime.name(), convertToDate(jsonParser.nextTextValue()));
                break;
            case "eventID":
                eventData.add(key, convertToUUID(jsonParser.nextTextValue()));
                break;
            case "readOnly":
                this.parseReadOnly(eventData);
                break;
            case "resources":
                this.parseResources(eventData);
                break;
            case "managementEvent":
                this.parseManagementEvent(eventData);
                break;
            default:
                eventData.add(key, parseDefaultValue(key));
                break;
            }
        }
        this.setAccountId(eventData);

        // event's last character position in the log file.
        int charEnd = (int) jsonParser.getTokenLocation().getCharOffset();

        CloudTrailEventMetadata metaData = getMetadata(charStart, charEnd);

        return new CloudTrailEvent(eventData, metaData);
    }
1145928
protected XMLEvent readStartTag(XMLEventReader reader, QName tagName)
            throws XMLStreamException, JournalException {
        XMLEvent event = reader.nextTag();
        if (!isStartTagEvent(event, tagName)) {
            throw getNotStartTagException(tagName, event);
        }
        return event;
    }
225368
private I_CmsReport getEventReport(CmsEvent event) {

        I_CmsReport report = null;
        if (event.getData() != null) {
            report = (I_CmsReport)event.getData().get(I_CmsEventListener.KEY_REPORT);
        }
        if (report == null) {
            report = new CmsLogReport(Locale.ENGLISH, getClass());
        }
        return report;
    }
24444
@Beta
    public EventGridEvent[] deserializeEventGridEvents(final String requestContent, final SerializerAdapter<ObjectMapper> serializerAdapter) throws IOException {
        EventGridEvent[] eventGridEvents = serializerAdapter.<EventGridEvent[]>deserialize(requestContent, EventGridEvent[].class);
        for (EventGridEvent receivedEvent : eventGridEvents) {
            if (receivedEvent.data() == null) {
                continue;
            } else {
                final String eventType = receivedEvent.eventType();
                final Type eventDataType;
                if (SystemEventTypeMappings.containsMappingFor(eventType)) {
                    eventDataType = SystemEventTypeMappings.getMapping(eventType);
                } else if (containsCustomEventMappingFor(eventType)) {
                    eventDataType = getCustomEventMapping(eventType);
                } else {
                    eventDataType = null;
                }
                if (eventDataType != null) {
                    final String eventDataAsString = serializerAdapter.serializeRaw(receivedEvent.data());
                    final Object eventData = serializerAdapter.<Object>deserialize(eventDataAsString, eventDataType);
                    setEventData(receivedEvent, eventData);
                }
            }
        }
        return eventGridEvents;
    }
563409
public static event[] get(nitro_service client) throws Exception
	{
		event resource = new event();
		resource.validate("get");
		return (event[]) resource.get_resources(client);
	}
290019
public static EventEngine getEventService() {
        SSLChannelProvider p = instance.get();
        if (p != null)
            return p.eventService;

        throw new IllegalStateException("Requested service is null: no active component instance");
    }