|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.props.Props
com.cometway.ak.Agent
com.cometway.ak.ServiceAgent
com.cometway.httpd.WebServerExtension
com.cometway.httpd.HTTPSetProperty
public class HTTPSetProperty
This WebServerExtension reads in a file of patterns and properties pairs, separated by a space. The patterns are regular expressions and will be applied to the entire request header (the 'request' property in the HTTPAgentRequest). If there is a match the name/value pair given will be set in the HTTPAgentRequest. If the value of the name/value pair is '$MATCH', the value will be the matched String. All patterns are checked even if there are multiple matches. This WebServerExtension will always pass through regardless of any matches. Example match file: Firefox/2.0.0.8 browser_type=newest firefox Mozilla/[0-9]\.[0-9] mozilla_version=$MATCH The 'browser_tyoe' property will be set to 'newest firefox' if the String 'Firefox/2.0.0.8' appears anywhere in the HTTP request header. The 'mozilla_version' property will be set to the matching String if 'Mozilla/[0-9\.[0-9]' matches anything in the HTTP request header.
| Field Summary |
|---|
| Fields inherited from class com.cometway.ak.Agent |
|---|
agent_id, agentController, CREATING_STATE, debugReporter, DESTROYED_STATE, DESTROYING_STATE, errorReporter, FAILED_STATE, printlnReporter, props, RUNNING_STATE, STARTING_STATE, STOPPED_STATE, STOPPING_STATE, warningReporter |
| Constructor Summary | |
|---|---|
HTTPSetProperty()
|
|
| Method Summary | |
|---|---|
boolean |
handleRequest(HTTPAgentRequest request)
This will be called by the WebServer (specifically the ConnectionKMethod) to handle an HTTPAgentRequest. |
void |
initProps()
Override this method to initialize this agent's properties before it is started. |
void |
readMatchFile()
|
void |
start()
This method inherited from com.cometway.ak.ServiceAgent includes functionality to register itself with the WebServer (temporary). |
void |
stop()
Unregisters this instance with the service manager using the service_name property. |
| Methods inherited from class com.cometway.ak.Agent |
|---|
currentStateEquals, debug, destroy, error, error, getAgentController, getDateTimeStr, getProps, getServiceImpl, getStateMachineModel, println, register, registerService, setAgentController, setProps, toString, unregister, unregisterService, warning, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HTTPSetProperty()
| Method Detail |
|---|
public void initProps()
Agent
initProps in interface AgentInterfaceinitProps in class Agentpublic void start()
WebServerExtension
start in interface AgentInterfacestart in class WebServerExtensionpublic void stop()
ServiceAgent
stop in interface AgentInterfacestop in class ServiceAgentpublic void readMatchFile()
public boolean handleRequest(HTTPAgentRequest request)
WebServerExtension
handleRequest in class WebServerExtension
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||