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.cep.Contextualizable,ca.uqac.lif.cep.Duplicable,ca.uqac.lif.cep.DuplicableProcessor
public class HttpUpstreamGateway
extends ca.uqac.lif.cep.tmf.Sink
Sends character strings over the network through HTTP requests.
Graphically, this processor is represented as:
- Author:
- Sylvain Hallé
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classServer callback that fires when the URL for this upstream gateway receives a request for eventsNested classes/interfaces inherited from class ca.uqac.lif.cep.SynchronousProcessor
ca.uqac.lif.cep.SynchronousProcessor.InputPushable, ca.uqac.lif.cep.SynchronousProcessor.OutputPullableNested classes/interfaces inherited from class ca.uqac.lif.cep.Processor
ca.uqac.lif.cep.Processor.InternalProcessorState -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ca.uqac.lif.jerrydog.RequestCallback.MethodThe method (GET or POST) that will be used when listening to the pull URLprotected StringThe URL that the server will listen to for pull requestsprotected ca.uqac.lif.jerrydog.RequestCallback.MethodThe method (GET or POST) that will be used when calling the push URLprotected StringThe URL that will be called when events are pushed to this gatewayprotected ca.uqac.lif.jerrydog.ServerThe web server that will listen for downstream pull requestsprotected static final intThe number of times the processor will retry when it fails to establish a connection to the other endFields inherited from class ca.uqac.lif.cep.SynchronousProcessor
m_inputPushables, m_outputPullables, m_tempQueueFields inherited from class ca.uqac.lif.cep.Processor
m_context, m_hasBeenNotifiedOfEndOfTrace, m_inputArity, m_inputPullables, m_inputQueues, m_notifiedEndOfTraceDownstream, m_outputArity, m_outputPushables, m_outputQueues, MAX_PULL_RETRIES, s_versionString -
Constructor Summary
ConstructorsConstructorDescriptionHttpUpstreamGateway(String push_url) HttpUpstreamGateway(String push_url, ca.uqac.lif.jerrydog.RequestCallback.Method push_method, String pull_url, int pull_port) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanduplicate(boolean with_state) 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 downstreamvoidstart()voidstop()Methods inherited from class ca.uqac.lif.cep.tmf.Sink
pull, pullHardMethods inherited from class ca.uqac.lif.cep.SynchronousProcessor
getPullableOutput, getPushableInputMethods inherited from class ca.uqac.lif.cep.Processor
allNotifiedEndOfTrace, allNull, copyInputQueue, copyOutputQueue, duplicate, duplicateInto, equals, getAt, getContext, getContext, getEmptyQueue, getId, getInputArity, getInputQueue, getInputType, getInputTypesFor, getOutputArity, getOutputQueue, getOutputType, getPullableInput, getPullableOutput, getPushableInput, getPushableOutput, hashCode, leftShift, newContext, onEndOfTrace, or, or, or, printState, readState, reset, rightShift, setContext, setContext, setPullableInput, setPushableOutput, startAll, stopAll
-
Field Details
-
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_pushMethodThe method (GET or POST) that will be used when calling the push URL -
m_server
protected ca.uqac.lif.jerrydog.Server m_serverThe web server that will listen for downstream pull requests -
m_pullUrl
The URL that the server will listen to for pull requests -
m_pullMethod
protected ca.uqac.lif.jerrydog.RequestCallback.Method m_pullMethodThe method (GET or POST) that will be used when listening to the pull URL -
s_numRetries
protected static final int s_numRetriesThe number of times the processor will retry when it fails to establish a connection to the other end- See Also:
-
-
Constructor Details
-
HttpUpstreamGateway
-
HttpUpstreamGateway
-
-
Method Details
-
setPullMethod
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(Object[] inputs, Queue<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
- Specified by:
duplicatein interfaceca.uqac.lif.cep.Duplicable- Specified by:
duplicatein classca.uqac.lif.cep.Processor
-
