public class PropertyExtractorHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Set<String> |
excludeProperties |
protected Iterable<PropertyContributor> |
propertyDecorators |
| Constructor and Description |
|---|
PropertyExtractorHelper(Set<String> excludeProperties,
PropertyContributor... propertyContributors) |
| Modifier and Type | Method and Description |
|---|---|
String |
extractName(Object event) |
Map<String,Object> |
extractProperty(String name,
Object value) |
String |
extractRequestCorrelationId(RequestInfo requestInfo) |
String |
extractSubProduct(Object event,
String product)
Produce a 'sub product' identifier that can help identify exactly
where this event comes from.
|
boolean |
isExcluded(String name) |
protected void |
putNonCoreJavaTypes(com.google.common.collect.ImmutableMap.Builder<String,Object> result,
String name,
Object value)
Put types in addition to the core Java types.
|
protected final Iterable<PropertyContributor> propertyDecorators
public PropertyExtractorHelper(Set<String> excludeProperties, PropertyContributor... propertyContributors)
protected void putNonCoreJavaTypes(com.google.common.collect.ImmutableMap.Builder<String,Object> result, String name, Object value)
public boolean isExcluded(String name)
public String extractSubProduct(Object event, String product)
In some cases event names overlap, for example usercreated from embedded Crowd and the JIRA user event. In these cases we need to include some mechanism to disambiguate them.
This method tries to strike a balance between specificity, readability and size. For this reason we take the package name then: - If it's a BrowserEvent make it just 'browser' - Strip any com?.atlassian?.(product e.g 'jira')? at the start - Remove the words 'event(s)' or 'plugin(s)' from any components of the package
Some examples: - com.atlassian.confluence.plugins.macros.dashboard.recentupdates.events.DashboardRecentlyUpdatedViewEvent = macros.dashboard.recentupdates - com.atlassian.confluence.event.events.content.mail.notification.SpaceNotificationRemovedEvent = content.mail.notification - com.atlassian.crowd.event.monitor.poller.PollingFinishedEvent = crowd.monitor.poller - com.fakevendor.events.UserCreatedEvent = fakevendor - com.atlassian.jira.event.config.ApplicationPropertyChangeEvent = config
N.B. Client side events will all show 'browser' because they are processed by the same endpoint in this plugin (and use a com.atlassian.analytics.client.api.browser.BrowserEvent). There's nothing we can do really, we could try to introspect the Javascript stack to see which .js file triggered the event (by overriding the push prototype on the AJS.EventQueue array), but this is very problematic cross browser (and not possible at all in IE less than 10)
@Nullable public String extractRequestCorrelationId(RequestInfo requestInfo)
Copyright © 2018 Atlassian. All rights reserved.