See: Description
| Interface | Description |
|---|---|
| DatasetBuilder.CacheSet | |
| IReadonlyList<T extends BaseEntity> |
Provides a read-only set of features to access the list.
|
| ISimpleList |
Provides the ability to efficiently retrieve the items from the list using
a ranged enumerable.
|
| Class | Description |
|---|---|
| AutoUpdate |
Used to fetch new device data from 51Degrees if a Premium or Enterprise
licence key is available.
|
| Dataset |
Data set used for device detection and provide methods to work with device
data.
|
| DatasetBuilder |
Used for creating a DataSet.
|
| IndirectDataset |
A data set which includes a pool of
data readers that are used to fetch data from the source when the data
set is used to retrieve data not already in memory.
|
| Match |
Contains detection results with all the information relevant to the matched
device.
|
| MatchResult |
Used to persist the results of a match for future use.
|
| MatchState |
Used to persist the match results to the cache.
|
| Provider |
Exposes several match methods to be used for device detection.
|
| SortedList<K,V> |
This class should not be called as it is part of the internal logic.
|
| TrieProvider |
Decision trie data structure provider.
|
| TrieProviderV3 |
Decision Trie data structure provider.
|
| TrieProviderV32 |
Trie provider of version 3.2.
|
| Utilities |
Utility methods shared across 51Degrees packages.
|
| Enum | Description |
|---|---|
| AutoUpdateStatus |
The Enumeration contains all possible states that the AutoUpdate process can
potentially be in.
|
| DatasetBuilder.CacheTemplate | |
| DatasetBuilder.CacheType |
Cache types for Stream Dataset
|
| TrieProvider.OffsetType |
The type of integers used to represent the offset to the children.
|
| Exception | Description |
|---|---|
| WrappedIOException |
Class wraps a RuntimeException.
|
Use like:
Provider p = new Provider(StreamFactory.create("path_to_file", false));
Match m = p.match("User-Agent string here");
System.out.println(m.getValues("IsMobile"));
Where StreamFactory.create initialises a
Dataset object which is responsible
for interacting with device data.
Two factories are available: Stream and Memory.
Stream
factory creates a Dataset object that maintains a pool of binary readers.
Each reader maintains an open channel to the data file and is used to look
up device data when required.
Memory
factory creates a Dataset where the data file is loaded into memory as
either an array of bytes or a complete set of entities. Whether the data
file is loaded fully or as an array of bytes is controlled by the boolean
flag when invoking the
;
The Provider object should be
used to perform device detection. It exposes several match() methods
that take in a User-Agent, a collection of HTTP headers and a device Id and
return a Match object with
detection results.
Along with detection results Match objects also contain match
metrics information such as the device Id, detection method, difference and
rank. Match metrics information can be used for a number of things such as
spotting fake User-Agents.
How device detection works.
Device detection uses LRU (Least Recently Used) caching algorithm to speed up detections for the more frequently occurring User-Agents. Caching is also used internally with the stream detection method to speed up the retrieval of various entities.
AutoUpdate class provides a
method that should be used to retrieve the latest device data. The automatic
update requires a licence key.
Get a licence key.
51Degrees device data is supplied in the binary form but Java API can be used to work with data entities. The tutorials on the Web site as well as the examples in the example.illustration package (located in the different module of this Maven project) provide several examples of working with data. For more information about the data model please see: Pattern data model.
For more information please see the Java documentation pages.
Copyright © 2017 51Degrees. All rights reserved.