oracle.cabo.share.agent
Class HttpAgents
java.lang.Object
|
+--oracle.cabo.share.agent.HttpAgents
- public class HttpAgents
- extends java.lang.Object
HttpAgents creates Agent objects based on the "user-agent" HTTP header.
Field Summary |
static java.lang.String |
AGENT_PARAM
URL parameter constant signifying that a serialized agent is present on an URL, and thus, importAgent should be called to instantiate it. |
Method Summary |
static Agent |
getAgent(javax.servlet.http.HttpServletRequest request)
Returns an agent based on an HttpServletRequest object. |
static Agent |
getAgent(int type, int application, java.lang.String version, int os)
Returns an Agent based on fully specified metadata. |
static Agent |
getAgent(java.lang.String userAgent, java.lang.String accept)
Returns an agent based on a user agent and accept string. |
static Agent |
getUnknownAgent()
Returns an agent that can be used for the entirely "unknown" case. |
static Agent |
importAgent(java.lang.String agentString)
Coverts a String created by exportAgent back into an Agent |
static Agent |
mergeCapabilities(Agent agent, java.lang.Object[] capabilities)
Creates a new Agent with a different set of capabilities than the base. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AGENT_PARAM
public static final java.lang.String AGENT_PARAM
- URL parameter constant signifying that a serialized agent is present on an URL, and thus,
importAgent
should be called to instantiate it.
importAgent
public static Agent importAgent(java.lang.String agentString)
- Coverts a String created by
exportAgent
back into an Agent
getAgent
public static Agent getAgent(javax.servlet.http.HttpServletRequest request)
- Returns an agent based on an HttpServletRequest object.
getAgent
public static Agent getAgent(java.lang.String userAgent,
java.lang.String accept)
- Returns an agent based on a user agent and accept string.
getAgent
public static Agent getAgent(int type,
int application,
java.lang.String version,
int os)
- Returns an Agent based on fully specified metadata.
mergeCapabilities
public static Agent mergeCapabilities(Agent agent,
java.lang.Object[] capabilities)
- Creates a new Agent with a different set of capabilities than the base.
-
- Parameters:
agent
- an Agent object created by HttpAgents
capabilities
- an array of capability objects, alternating capability keys with capability values.
getUnknownAgent
public static Agent getUnknownAgent()
- Returns an agent that can be used for the entirely "unknown" case.