|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfiftyone.mobile.detection.Provider
public class Provider
Provider used to perform a detection based on a user agent string.
| Field Summary | |
|---|---|
private Controller |
controller
|
Dataset |
dataSet
The data set associated with the provider. |
private long |
detectionCount
|
private SortedList<MatchMethods,Long> |
methodCounts
The number of detections performed using the method. |
private Cache<String,Match.MatchState> |
userAgentCache
A cache for user agents. |
| Constructor Summary | |
|---|---|
Provider()
Builds a new provider with the embedded data set. |
|
Provider(Dataset dataSet)
Constructs a new provided using the data set. |
|
Provider(Dataset dataSet,
Controller controller,
int cacheServiceInternal)
Constructs a new provider with the dataset, controller and cache specified. |
|
Provider(Dataset dataSet,
int cacheServiceInterval)
Constructs a new provided using the data set. |
|
Provider(int cacheServiceInterval)
Builds a new provider with the embedded data set and a cache with the service internal specified. |
|
| Method Summary | |
|---|---|
Match |
createMatch()
Creates a new match object to be used for matching. |
long |
getDetectionCount()
The total number of detections performed by the data set. |
private static String |
getDeviceUserAgent(Map<String,String> headers)
Used to check other header fields in case a device user agent is being used and returns the devices useragent string. |
private static byte[] |
getEmbeddedByteArray()
Reads the embedded data into a byte array to be used as a byte buffer in the factory. |
Match |
match(Map<String,String> headers)
For a given collection of HTTP headers returns a match containing information about the capabilities of the device and it's components. |
Match |
match(Map<String,String> headers,
Match match)
For a given collection of HTTP headers returns a match containing information about the capabilities of the device and it's components. |
Match |
match(String targetUserAgent)
For a given user agent returns a match containing information about the capabilities of the device and it's components. |
Match |
match(String targetUserAgent,
Match match)
For a given user agent returns a match containing information about the capabilities of the device and it's components. |
private Match |
matchNoCache(String targetUserAgent,
Match match)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Cache<String,Match.MatchState> userAgentCache
private long detectionCount
private final SortedList<MatchMethods,Long> methodCounts
public final Dataset dataSet
private Controller controller
| Constructor Detail |
|---|
public Provider()
throws IOException
IOException
public Provider(int cacheServiceInterval)
throws IOException
cacheServiceInterval - cache service internal in seconds.
IOExceptionpublic Provider(Dataset dataSet)
dataSet - Data set to use for device detection
public Provider(Dataset dataSet,
int cacheServiceInterval)
cacheServiceInterval - cache service internal in seconds.dataSet - Data set to use for device detection
Provider(Dataset dataSet,
Controller controller,
int cacheServiceInternal)
dataSet - controller - cacheServiceInternal - | Method Detail |
|---|
public long getDetectionCount()
private static byte[] getEmbeddedByteArray()
throws IOException
IOExceptionpublic Match createMatch()
Exception
public Match match(Map<String,String> headers)
throws IOException
headers - List of HTTP headers to use for the detection
IOException
public Match match(Map<String,String> headers,
Match match)
throws IOException
headers - List of HTTP headers to use for the detectionmatch - object created to store the results of the match
IOException
public Match match(String targetUserAgent)
throws IOException
targetUserAgent -
IOException
public Match match(String targetUserAgent,
Match match)
throws IOException
targetUserAgent - The user agent string to use as the targetmatch - A match object created by a previous match, or via the
CreateMatch method.
IOException
Exception
private Match matchNoCache(String targetUserAgent,
Match match)
throws IOException
IOExceptionprivate static String getDeviceUserAgent(Map<String,String> headers)
headers - Collection of Http headers associated with the request.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||