Get the actor for an event.

@param event the portal event
@return the LrsActor
190148
protected LrsActor getActor(PortalEvent event) {
        String username = event.getUserName();
        return actorService.getLrsActor(username);
    }
806924
@Override
    public String getActor() {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        if (authentication != null && authentication.getPrincipal() instanceof UserDetails) {
            return ((UserDetails) authentication.getPrincipal()).getUsername();
        } else if (authentication != null && authentication.getPrincipal() instanceof String) {
            return (String) authentication.getPrincipal();
        }
        return undefienedActorName;
    }
492714
private ListenerEvent getEvent(int eventBit, MouseEvent<?> event) {
		return new ListenerEvent(eventBit, getScreenPosition(event), getClientPosition(event), getTarget(event),
				getTransformer(), event.isAltKeyDown(), event.isControlKeyDown(), event.isShiftKeyDown(),
				event.getNativeButton());
	}
1143582
public synchronized EventAgent getEventAgent() {
    if (this.eventAgent == null) {
      if (isService) {
        this.eventAgent =
            new EventAgent(
                this.serviceName,
                this.projectId,
                this.sslEnabled,
                this.nfvoIp,
                this.nfvoPort,
                this.version,
                this.serviceKey);
      } else {
        this.eventAgent =
            new EventAgent(
                this.username,
                this.password,
                this.projectId,
                this.sslEnabled,
                this.nfvoIp,
                this.nfvoPort,
                this.version);
      }
    }
    return this.eventAgent;
  }
761533
public EventDispatcher getEventDispatcher(EventPublisher source) {
	EventDispatcher ret = dispatchers.get(source);
	if (ret == null) {
	    ret = createDispatcher(source);
	}
	return ret;
    }
707618
public static <T> T getPasswordlessAuthenticationAccount(final Event event, final Class<T> clazz) {
        return event.getAttributes().get("passwordlessAccount", clazz);
    }
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);
    }
1040673
public static List<Actor> getActors(String urlString) throws TvDbException {
        List<Actor> results = new ArrayList<>();
        Actor actor;
        Document doc;
        NodeList nlActor;
        Node nActor;
        Element eActor;

        try {
            doc = DOMHelper.getEventDocFromUrl(urlString);
            if (doc == null) {
                return results;
            }
        } catch (WebServiceException ex) {
            LOG.trace(ERROR_GET_XML, ex);
            return results;
        }

        nlActor = doc.getElementsByTagName("Actor");

        for (int loop = 0; loop < nlActor.getLength(); loop++) {
            nActor = nlActor.item(loop);

            if (nActor.getNodeType() == Node.ELEMENT_NODE) {
                eActor = (Element) nActor;
                actor = new Actor();

                actor.setId(DOMHelper.getValueFromElement(eActor, "id"));
                String image = DOMHelper.getValueFromElement(eActor, "Image");
                if (!image.isEmpty()) {
                    actor.setImage(URL_BANNER + image);
                }
                actor.setName(DOMHelper.getValueFromElement(eActor, "Name"));
                actor.setRole(DOMHelper.getValueFromElement(eActor, "Role"));
                actor.setSortOrder(DOMHelper.getValueFromElement(eActor, "SortOrder"));

                results.add(actor);
            }
        }

        Collections.sort(results);

        return results;
    }
849065
public <T> Future<T> fireEventAsynchronously(final Event<?> event) {
        final FutureTask<T> futureTask = new FutureTask<T>(() -> {
            synchronizedEventQueue.fireEvent(event);

            return null; // XXX: Our future????
        });

        Latkes.EXECUTOR_SERVICE.execute(futureTask);

        return futureTask;
    }
1271301
private static <T> EventInterfaceDescriptor<T> getDescriptor(Class<T> t) {
        EventInterfaceDescriptor<T> r = descriptors.get(t);
        if(r==null) {
            r = new EventInterfaceDescriptor<T>(t);
            descriptors.put(t,r);
        }
        return r;
    }
581832
public String extractRole(XEvent event) {
		XAttribute attribute = event.getAttributes().get(KEY_ROLE);
		if (attribute == null) {
			return null;
		} else {
			return ((XAttributeLiteral) attribute).getValue();
		}
	}
1225148
@Override
    public LrsStatement toLrsStatement(PortalEvent event) {
        return new LrsStatement(getActor(event), getVerb(event), getLrsObject(event));
    }
1112308
@Override
    public void onEvent(InteractionEvent event) {
        switch (event.getType()) {
        case BEFORE_WAIT:
            onBeforeWaitEvent((BeforeWaitInteractionEvent) event);
            break;
        case BEFORE:
            onBeforeEvent((BeforeInteractionEvent) event);
            break;
        case AFTER_SUCCESS:
            onAfterSuccessEvent((AfterSuccessInteractionEvent) event);
            onAfterEvent((AfterInteractionEvent) event);
            break;
        case AFTER_FAIL:
            onAfterFailEvent((AfterFailInteractionEvent) event);
            onAfterEvent((AfterInteractionEvent) event);
            break;
        }
    }
699414
@Override
    public PipelineEventReader<XMLEventReader, XMLEvent> getEventReader(
            HttpServletRequest request, HttpServletResponse response) {
        final PipelineEventReader<XMLEventReader, XMLEvent> pipelineEventReader =
                this.wrappedComponent.getEventReader(request, response);

        final XMLEventReader eventReader = pipelineEventReader.getEventReader();

        final IStylesheetDescriptor stylesheetDescriptor =
                stylesheetAttributeSource.getStylesheetDescriptor(request);

        final IPortalRequestInfo portalRequestInfo =
                this.urlSyntaxProvider.getPortalRequestInfo(request);

        final XMLEventReader filteredEventReader;
        if (portalRequestInfo.getTargetedPortletWindowId() == null) {
            final IStylesheetParameterDescriptor defaultWindowStateParam =
                    stylesheetDescriptor.getStylesheetParameterDescriptor(
                            "dashboardForcedWindowState");
            if (defaultWindowStateParam != null) {
                // Set all window states to the specified default
                final WindowState windowState =
                        PortletUtils.getWindowState(defaultWindowStateParam.getDefaultValue());
                filteredEventReader =
                        new SinglePortletWindowStateSettingXMLEventReader(
                                request, eventReader, windowState);
            } else {
                // Make sure there aren't any portlets in a "targeted" window state
                filteredEventReader =
                        new NonTargetedPortletWindowStateSettingXMLEventReader(
                                request, eventReader);
            }
        } else {
            // Not mobile, don't bother filtering
            filteredEventReader = eventReader;
        }

        final Map<String, String> outputProperties = pipelineEventReader.getOutputProperties();
        return new PipelineEventReaderImpl<XMLEventReader, XMLEvent>(
                filteredEventReader, outputProperties);
    }
1303708
@Override
    public PipelineEventReader<XMLEventReader, XMLEvent> getEventReader(
            HttpServletRequest request, HttpServletResponse response) {
        final PipelineEventReader<XMLEventReader, XMLEvent> pipelineEventReader =
                this.wrappedComponent.getEventReader(request, response);

        final Transformer transformer = this.transformerSource.getTransformer(request, response);

        // Setup a URIResolver based on the current resource loader
        transformer.setURIResolver(this.uriResolver);

        // Configure the Transformer via injected class
        if (this.xsltParameterSource != null) {
            final Map<String, Object> transformerParameters =
                    this.xsltParameterSource.getParameters(request, response);
            if (transformerParameters != null) {
                this.logger.debug(
                        "{} - Setting Transformer Parameters: ",
                        this.beanName,
                        transformerParameters);
                for (final Map.Entry<String, Object> transformerParametersEntry :
                        transformerParameters.entrySet()) {
                    final String name = transformerParametersEntry.getKey();
                    final Object value = transformerParametersEntry.getValue();
                    if (value != null) {
                        transformer.setParameter(name, value);
                    }
                }
            }

            final Properties outputProperties =
                    this.xsltParameterSource.getOutputProperties(request, response);
            if (outputProperties != null) {
                this.logger.debug(
                        "{} - Setting Transformer Output Properties: ",
                        this.beanName,
                        outputProperties);
                transformer.setOutputProperties(outputProperties);
            }
        }

        // The event reader from the previous component in the pipeline
        final XMLEventReader eventReader = pipelineEventReader.getEventReader();

        // Wrap the event reader in a stream reader to avoid a JDK bug
        final XMLStreamReader streamReader;
        try {
            streamReader = new FixedXMLEventStreamReader(eventReader);
        } catch (XMLStreamException e) {
            throw new RuntimeException("Failed to create XMLStreamReader from XMLEventReader", e);
        }
        final Source xmlReaderSource = new StAXSource(streamReader);

        // Setup logging for the transform
        transformer.setErrorListener(this.errorListener);

        // Transform to a SAX ContentHandler to avoid JDK bug:
        // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6775588
        final XMLEventBufferWriter eventWriterBuffer = new XMLEventBufferWriter();
        final ContentHandler contentHandler = StaxUtils.createContentHandler(eventWriterBuffer);
        contentHandler.setDocumentLocator(new LocatorImpl());

        final SAXResult outputTarget = new SAXResult(contentHandler);
        try {
            this.logger.debug("{} - Begining XML Transformation", this.beanName);
            transformer.transform(xmlReaderSource, outputTarget);
            this.logger.debug("{} - XML Transformation complete", this.beanName);
        } catch (TransformerException e) {
            throw new RuntimeException("Failed to transform document", e);
        }

        final String mediaType = transformer.getOutputProperty(OutputKeys.MEDIA_TYPE);

        final List<XMLEvent> eventBuffer = eventWriterBuffer.getEventBuffer();
        final XMLEventReader outputEventReader =
                new XMLEventBufferReader(eventBuffer.listIterator());

        final Map<String, String> outputProperties = pipelineEventReader.getOutputProperties();
        final PipelineEventReaderImpl<XMLEventReader, XMLEvent> pipelineEventReaderImpl =
                new PipelineEventReaderImpl<XMLEventReader, XMLEvent>(
                        outputEventReader, outputProperties);
        pipelineEventReaderImpl.setOutputProperty(OutputKeys.MEDIA_TYPE, mediaType);
        return pipelineEventReaderImpl;
    }
632035
public static <T extends Actor> T AsActor(Class<T> actorClazz) {
        return (T) instance.newProxy(actorClazz, defaultScheduler.get(), -1);
    }
846041
protected <T> Optional<T> getSource(Event event, Class<T> type) {
        return getValue(event, event::getSource, type);
    }