Package ca.uqac.lif.cep.http
Class HttpUpstreamGateway
- java.lang.Object
-
- ca.uqac.lif.cep.Processor
-
- ca.uqac.lif.cep.SynchronousProcessor
-
- ca.uqac.lif.cep.tmf.Sink
-
- ca.uqac.lif.cep.http.HttpUpstreamGateway
-
- All Implemented Interfaces:
ca.uqac.lif.azrael.Printable,ca.uqac.lif.azrael.Readable,ca.uqac.lif.cep.Contextualizable,ca.uqac.lif.cep.Duplicable,ca.uqac.lif.cep.DuplicableProcessor
public class HttpUpstreamGateway extends ca.uqac.lif.cep.tmf.SinkSends character strings over the network through HTTP requests. Graphically, this processor is represented as:- Author:
- Sylvain Hallé
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classHttpUpstreamGateway.PullCallbackServer callback that fires when the URL for this upstream gateway receives a request for events
-
Field Summary
Fields Modifier and Type Field Description protected ca.uqac.lif.jerrydog.RequestCallback.Methodm_pullMethodThe method (GET or POST) that will be used when listening to the pull URLprotected java.lang.Stringm_pullUrlThe URL that the server will listen to for pull requestsprotected ca.uqac.lif.jerrydog.RequestCallback.Methodm_pushMethodThe method (GET or POST) that will be used when calling the push URLprotected java.lang.Stringm_pushUrlThe URL that will be called when events are pushed to this gatewayprotected ca.uqac.lif.jerrydog.Serverm_serverThe web server that will listen for downstream pull requestsprotected static ints_numRetriesThe number of times the processor will retry when it fails to establish a connection to the other end-
Fields inherited from class ca.uqac.lif.cep.SynchronousProcessor
m_inputPushables, m_outputPullables, m_tempQueue
-
Fields inherited from class ca.uqac.lif.cep.Processor
m_context, m_eventTracker, m_hasBeenNotifiedOfEndOfTrace, m_inputArity, m_inputCount, m_inputPullables, m_inputQueues, m_notifiedEndOfTraceDownstream, m_outputArity, m_outputCount, m_outputPushables, m_outputQueues, MAX_PULL_RETRIES, s_versionString
-
-
Constructor Summary
Constructors Constructor Description HttpUpstreamGateway(java.lang.String push_url)HttpUpstreamGateway(java.lang.String push_url, ca.uqac.lif.jerrydog.RequestCallback.Method push_method, java.lang.String pull_url, int pull_port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancompute(java.lang.Object[] inputs, java.util.Queue<java.lang.Object[]> outputs)HttpUpstreamGatewayduplicate(boolean with_state)HttpUpstreamGatewaysetPullMethod(ca.uqac.lif.jerrydog.RequestCallback.Method m)Sets the method (GET or POST) the gateway will respond to when listening to pull requests from downstreamvoidstart()voidstop()-
Methods inherited from class ca.uqac.lif.cep.SynchronousProcessor
getPullableOutput, getPushableInput, setEventTracker
-
Methods inherited from class ca.uqac.lif.cep.Processor
allNotifiedEndOfTrace, allNull, associateTo, associateToInput, associateToOutput, copyInputQueue, copyOutputQueue, duplicate, duplicateInto, equals, getAt, getContext, getContext, getEmptyQueue, getEventTracker, getId, getInputArity, getInputCount, getInputQueue, getInputType, getInputTypesFor, getLeaves, getLeaves, getOutputArity, getOutputCount, getOutputQueue, getOutputType, getPullableInput, getPullableOutput, getPushableInput, getPushableOutput, hashCode, leftShift, newContext, onEndOfTrace, or, or, print, printState, read, readState, reset, rightShift, setContext, setContext, setPullableInput, setPushableOutput, startAll, stopAll
-
-
-
-
Field Detail
-
m_pushUrl
protected java.lang.String m_pushUrl
The URL that will be called when events are pushed to this gateway
-
m_pushMethod
protected ca.uqac.lif.jerrydog.RequestCallback.Method m_pushMethod
The method (GET or POST) that will be used when calling the push URL
-
m_server
protected ca.uqac.lif.jerrydog.Server m_server
The web server that will listen for downstream pull requests
-
m_pullUrl
protected java.lang.String m_pullUrl
The URL that the server will listen to for pull requests
-
m_pullMethod
protected ca.uqac.lif.jerrydog.RequestCallback.Method m_pullMethod
The method (GET or POST) that will be used when listening to the pull URL
-
s_numRetries
protected static final int s_numRetries
The number of times the processor will retry when it fails to establish a connection to the other end- See Also:
- Constant Field Values
-
-
Method Detail
-
setPullMethod
public HttpUpstreamGateway setPullMethod(ca.uqac.lif.jerrydog.RequestCallback.Method m)
Sets the method (GET or POST) the gateway will respond to when listening to pull requests from downstream- Parameters:
m- The method- Returns:
- This gateway
-
compute
protected boolean compute(java.lang.Object[] inputs, java.util.Queue<java.lang.Object[]> outputs) throws ca.uqac.lif.cep.ProcessorException- Specified by:
computein classca.uqac.lif.cep.SynchronousProcessor- Throws:
ca.uqac.lif.cep.ProcessorException
-
start
public void start() throws ca.uqac.lif.cep.ProcessorException- Overrides:
startin classca.uqac.lif.cep.Processor- Throws:
ca.uqac.lif.cep.ProcessorException
-
stop
public void stop() throws ca.uqac.lif.cep.ProcessorException- Overrides:
stopin classca.uqac.lif.cep.Processor- Throws:
ca.uqac.lif.cep.ProcessorException
-
duplicate
public HttpUpstreamGateway duplicate(boolean with_state)
- Specified by:
duplicatein interfaceca.uqac.lif.cep.Duplicable- Specified by:
duplicatein classca.uqac.lif.cep.Processor
-
-
