51Degrees Pipeline Java  4.1

51Degrees Pipeline for Java

fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase Class Reference abstract

Detailed Description

Abstract base class for ShareUsage elements.

Contains common functionality such as filtering the evidence and building the XML records.

Inheritance diagram for fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase:

[legend]

Collaboration diagram for fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase:

[legend]

Classes

class  ShareUsageData
Inner class that is used to store details of data in memory prior to it being sent to 51Degrees. More...

Public Member Functions

String  getElementDataKey ()
void  addPipeline (Pipeline pipeline)
EvidenceKeyFilter  getEvidenceKeyFilter ()
List< ElementPropertyMetaData >  getProperties ()
DataFactory< ElementData >  getDataFactory ()
String  encodeInvalidXMLChars (String text)
Encodes any unusual characters into their hex representation. More...

Public Member Functions inherited from fiftyone.pipeline.core.flowelements.FlowElementBase< TData extends ElementData, TProperty extends ElementPropertyMetaData >

 FlowElementBase (Logger logger, ElementDataFactory< TData > elementDataFactory)
Construct a new instance of the FlowElement. More...
void  addPipeline (Pipeline pipeline)
List< Pipeline >  getPipelines ()
Get a unmodifiable list of the Pipelines that this element has been added to. More...
abstract String  getElementDataKey ()
abstract EvidenceKeyFilter  getEvidenceKeyFilter ()
abstract List< TProperty >  getProperties ()
TProperty  getProperty (String name)
TypedKey< TData >  getTypedDataKey ()
void  process (FlowData data) throws Exception
DataFactory< TData >  getDataFactory ()
boolean  isConcurrent ()
boolean  isClosed ()
void  close () throws Exception

Public Member Functions inherited from fiftyone.pipeline.core.flowelements.FlowElement< TData, TProperty >

void  process (FlowData data) throws Exception
Carry out whatever operations this element is designed to do using the FlowData passed. More...
void  addPipeline (Pipeline pipeline)
Called when this element is added to a pipeline. More...
EvidenceKeyFilter  getEvidenceKeyFilter ()
Get a filter that will only include the evidence keys that this element can make use of. More...
String  getElementDataKey ()
Get the string name of the key used to access the data populated by this element in the FlowData. More...
TypedKey< TData >  getTypedDataKey ()
Get the typed data key used for retrieving strongly typed element data. More...
List< TProperty >  getProperties ()
Get details of the properties that this element can populate. More...
TProperty  getProperty (String name)
Get a property from the properties that this element can populate using its name. More...
boolean  isConcurrent ()
if true, requires that the Pipeline guards against concurrent access to FlowData structures More...
boolean  isClosed ()
Indicates whether the element has been closed using the close() method, either explicitly or as a result of a 'try with resource'. More...
DataFactory< TData >  getDataFactory ()
Get the factory used to create the element data instances that are populated by this flow element. More...

Protected Member Functions

 ShareUsageBase (Logger logger, double sharePercentage, int minimumEntriesPerMessage, int maximumQueueSize, int addTimeout, int takeTimeout, int repeatEvidenceIntervalMinutes, boolean trackSession, String shareUsageUrl, List< String > blockedHttpHeaders, List< String > includedQueryStringParameters, List< Map.Entry< String, String >> ignoreDataEvidenceFilter)
Constructor. More...
 ShareUsageBase (Logger logger, double sharePercentage, int minimumEntriesPerMessage, int maximumQueueSize, int addTimeout, int takeTimeout, int repeatEvidenceIntervalMinutes, boolean trackSession, String shareUsageUrl, List< String > blockedHttpHeaders, List< String > includedQueryStringParameters, List< Map.Entry< String, String >> ignoreDataEvidenceFilter, String sessionCookieName)
Constructor. More...
 ShareUsageBase (Logger logger, double sharePercentage, int minimumEntriesPerMessage, int maximumQueueSize, int addTimeout, int takeTimeout, int repeatEvidenceIntervalMinutes, boolean trackSession, String shareUsageUrl, List< String > blockedHttpHeaders, List< String > includedQueryStringParameters, List< Map.Entry< String, String >> ignoreDataEvidenceFilter, String sessionCookieName, Tracker tracker)
Constructor. More...
void  processInternal (FlowData flowData) throws Exception
void  cancel ()
Cancel the sending of usage data.
void  managedResourcesCleanup ()
void  unmanagedResourcesCleanup ()
void  trySendData ()
Attempt to send the data to the remote service. More...
abstract void  buildAndSendXml () throws HttpException
void  buildData (XmlBuilder builder, ShareUsageData data)
Virtual method to be overridden in extending usage share elements. More...
void  buildDeviceData (XmlBuilder builder, ShareUsageData data)
Write the specified device data using the specified writer. More...
void  writePipelineInfo (XmlBuilder builder)
Method to write details about the pipeline. More...

Protected Member Functions inherited from fiftyone.pipeline.core.flowelements.FlowElementBase< TData extends ElementData, TProperty extends ElementPropertyMetaData >

abstract void  processInternal (FlowData data) throws Exception
Abstract method to be overridden by a FlowElement author. More...
abstract void  managedResourcesCleanup ()
Cleanup any managed resources that the element is using.
abstract void  unmanagedResourcesCleanup ()
Cleanup any unmanaged resources that the element is using.
void  close (boolean closing)
void  finalize () throws Throwable

Protected Attributes

BlockingQueue< ShareUsageData >  evidenceCollection
Queue used to store entries in memory prior to them being sent to 51Degrees.
int  takeTimeout
Timeout to use when taking from the queue.
int  minEntriesPerMessage = 50
The minimum number of request entries per message sent to 51Degrees.
String  shareUsageUrl = ""
The URL to send data to.

Protected Attributes inherited from fiftyone.pipeline.core.flowelements.FlowElementBase< TData extends ElementData, TProperty extends ElementPropertyMetaData >

final Logger  logger
TypedKey< TData >  typedKey = null

Constructor & Destructor Documentation

◆ ShareUsageBase() [1/3]

fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase.ShareUsageBase ( Logger   logger,
double   sharePercentage,
int   minimumEntriesPerMessage,
int   maximumQueueSize,
int   addTimeout,
int   takeTimeout,
int   repeatEvidenceIntervalMinutes,
boolean   trackSession,
String   shareUsageUrl,
List< String >   blockedHttpHeaders,
List< String >   includedQueryStringParameters,
List< Map.Entry< String, String >>   ignoreDataEvidenceFilter  
)
protected

Constructor.

Parameters
logger - the logger to use
sharePercentage - the approximate proportion of requests to share. 1 = 100%, 0.5 = 50%, etc.
minimumEntriesPerMessage - the minimum number of request entries per message sent to 51Degrees
maximumQueueSize - the maximum number of items to hold in the queue at one time. This must be larger than minimum entries
addTimeout - the timeout in milliseconds to allow when attempting to add an item to the queue. If this timeout is exceeded then usage sharing will be disabled
takeTimeout - the timeout in milliseconds to allow when attempting to take an item to the queue
repeatEvidenceIntervalMinutes - the interval (in minutes) which is used to decide if repeat evidence is old enough to consider a new session
trackSession - set if the tracker should consider sessions in share usage
shareUsageUrl - the URL to send data to
blockedHttpHeaders - a list of the names of the HTTP headers that share usage should not send to 51Degrees
includedQueryStringParameters - a list of the names of query string parameters that share usage should send to 51Degrees
ignoreDataEvidenceFilter - the filter used to determine if an item of evidence should be ignored or not

◆ ShareUsageBase() [2/3]

fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase.ShareUsageBase ( Logger   logger,
double   sharePercentage,
int   minimumEntriesPerMessage,
int   maximumQueueSize,
int   addTimeout,
int   takeTimeout,
int   repeatEvidenceIntervalMinutes,
boolean   trackSession,
String   shareUsageUrl,
List< String >   blockedHttpHeaders,
List< String >   includedQueryStringParameters,
List< Map.Entry< String, String >>   ignoreDataEvidenceFilter,
String   sessionCookieName  
)
protected

Constructor.

Parameters
logger - the logger to use
sharePercentage - the approximate proportion of requests to share. 1 = 100%, 0.5 = 50%, etc.
minimumEntriesPerMessage - the minimum number of request entries per message sent to 51Degrees
maximumQueueSize - the maximum number of items to hold in the queue at one time. This must be larger than minimum entries
addTimeout - the timeout in milliseconds to allow when attempting to add an item to the queue. If this timeout is exceeded then usage sharing will be disabled
takeTimeout - the timeout in milliseconds to allow when attempting to take an item to the queue
repeatEvidenceIntervalMinutes - the interval (in minutes) which is used to decide if repeat evidence is old enough to consider a new session
trackSession - set if the tracker should consider sessions in share usage
shareUsageUrl - the URL to send data to
blockedHttpHeaders - a list of the names of the HTTP headers that share usage should not send to 51Degrees
includedQueryStringParameters - a list of the names of query string parameters that share usage should send to 51Degrees
ignoreDataEvidenceFilter - the filter used to determine if an item of evidence should be ignored or not
sessionCookieName - the name of the cookie that contains the session id

◆ ShareUsageBase() [3/3]

fiftyone.pipeline.engines -->   ignoreDataEvidenceFilter,
String   sessionCookieName  
)
protected

Constructor.

Parameters
logger - the logger to use
sharePercentage - the approximate proportion of requests to share. 1 = 100%, 0.5 = 50%, etc.
minimumEntriesPerMessage - the minimum number of request entries per message sent to 51Degrees
maximumQueueSize - the maximum number of items to hold in the queue at one time. This must be larger than minimum entries
addTimeout - the timeout in milliseconds to allow when attempting to add an item to the queue. If this timeout is exceeded then usage sharing will be disabled
takeTimeout - the timeout in milliseconds to allow when attempting to take an item to the queue
repeatEvidenceIntervalMinutes - the interval (in minutes) which is used to decide if repeat evidence is old enough to consider a new session
trackSession - set if the tracker should consider sessions in share usage
shareUsageUrl - the URL to send data to
blockedHttpHeaders - a list of the names of the HTTP headers that share usage should not send to 51Degrees
includedQueryStringParameters - a list of the names of query string parameters that share usage should send to 51Degrees
ignoreDataEvidenceFilter - the filter used to determine if an item of evidence should be ignored or not
sessionCookieName - the name of the cookie that contains the session id

◆ ShareUsageBase() [3/3]

fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase.ShareUsageBase ( Logger   logger,
double   sharePercentage,
int   minimumEntriesPerMessage,
int   maximumQueueSize,
int   addTimeout,
int   takeTimeout,
int   repeatEvidenceIntervalMinutes,
boolean   trackSession,
String   shareUsageUrl,
List< String >   blockedHttpHeaders,
List< String >   includedQueryStringParameters,
List< Map.Entry< String, String >>   ignoreDataEvidenceFilter,
String   sessionCookieName,
Tracker   tracker  
)
protected

Constructor.

Parameters
logger - the logger to use
sharePercentage - the approximate proportion of requests to share. 1 = 100%, 0.5 = 50%, etc.
minimumEntriesPerMessage - the minimum number of request entries per message sent to 51Degrees
maximumQueueSize - the maximum number of items to hold in the queue at one time. This must be larger than minimum entries
addTimeout - the timeout in milliseconds to allow when attempting to add an item to the queue. If this timeout is exceeded then usage sharing will be disabled
takeTimeout - the timeout in milliseconds to allow when attempting to take an item to the queue
repeatEvidenceIntervalMinutes - the interval (in minutes) which is used to decide if repeat evidence is old enough to consider a new session
trackSession - set if the tracker should consider sessions in share usage
shareUsageUrl - the URL to send data to
blockedHttpHeaders - a list of the names of the HTTP headers that share usage should not send to 51Degrees
includedQueryStringParameters - a list of the names of query string parameters that share usage should send to 51Degrees
ignoreDataEvidenceFilter - the filter used to determine if an item of evidence should be ignored or not
sessionCookieName - the name of the cookie that contains the session id
tracker - the Tracker to use to determine if a given FlowData instance should be shared or not

Member Function Documentation

◆ buildData()

void fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase.buildData ( XmlBuilder   builder,
ShareUsageData   data  
)
protected

Virtual method to be overridden in extending usage share elements.

Write the specified data using the specified writer.

Parameters
builder - the XmlBuilder to use
data - the data to write

◆ buildDeviceData()

void fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase.buildDeviceData ( XmlBuilder   builder,
ShareUsageData   data  
)
protected

Write the specified device data using the specified writer.

Parameters
builder - the XmlBuilder to use
data - the data to write

◆ encodeInvalidXMLChars()

String fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase.encodeInvalidXMLChars ( String   text )

Encodes any unusual characters into their hex representation.

Parameters
text - the text to encode
Returns
encoded text

◆ trySendData()

void fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase.trySendData ( )
protected

Attempt to send the data to the remote service.

This only happens if there is not a task already running. If any error occurs while sending the data, then usage sharing is stopped.

◆ writePipelineInfo()

void fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase.writePipelineInfo ( XmlBuilder   builder )
protected

Method to write details about the pipeline.

Parameters
builder - XmlBuilder to use