\r\n

51Degrees Pipeline Java  4.4

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.

See also
Specification

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  getEnginesVersion ()
Get engine Version No. More...
void  setEnginesVersion (String enginesVersion)
Set Engine Version Number. 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...
List< String >  getFlowElements ()
Return a list of FlowElement in the pipeline. More...
String  getHostAddress ()
Get the IP address of the machine that this code is running on. More...
void  processInternal (FlowData flowData)
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  sendUsageData () throws HttpException

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)

Protected Attributes

final ExecutorService  executor = Executors.newSingleThreadExecutor()
Executor service used to start data sending threads.
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.
final int  minEntriesPerMessage
The minimum number of request entries per message sent to 51Degrees.
final String  shareUsageUrl
The URL to send data to.
final String  osVersion
Version of the OS the pipeline is being run on, as reported by System.getProperty("os.name").
final String  languageVersion
The Java version the pipeline is being run on, as reported by System.getProperty("java.version")
final String  coreVersion
The version of the pipeline package.
long  lostData
Keep a count of data lost.
long  lostDataReset = LOST_DATA_RESET_DEFAULT
lostData is rest when it exceeds this value

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

final Logger  logger
TypedKey< TData >  typedKey = null

Static Protected Attributes

static final SimpleDateFormat  DATE_FMT

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.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

◆ getEnginesVersion()

String fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase.getEnginesVersion ( )

Get engine Version No.

Returns
engine version no

◆ getFlowElements()

List<String> fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase.getFlowElements ( )
protected

Return a list of FlowElement in the pipeline.

If the list is null then populate from the pipeline. If there are multiple or no pipelines then log an error.

Returns
list of flow elements

◆ getHostAddress()

String fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase.getHostAddress ( )
protected

Get the IP address of the machine that this code is running on.

Returns
machine IP

◆ setEnginesVersion()

void fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase.setEnginesVersion ( String   enginesVersion )

Set Engine Version Number.

Parameters
enginesVersion - version number string of the engine

◆ 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.

Member Data Documentation

◆ DATE_FMT

final SimpleDateFormat fiftyone.pipeline.engines.fiftyone.flowelements.ShareUsageBase.DATE_FMT
static protected
Initial value:
=
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss")
On This Page