Package dev.openfunction.functions
Interface Context
-
public interface Context
An interface for event function context.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BindingEventgetBindingEvent()getBindingEvent returns the binding event.io.cloudevents.CloudEventgetCloudEvent()getCloudEvent returns the cloud Event.io.dapr.client.DaprClientgetDaprClient()getDaprClient return a dapr client, so that use user can call the dapr API directly.java.lang.StringgetHttpPattern()getHttpPattern returns the path of the server listening for http function.HttpRequestgetHttpRequest()getHttpRequest returns the Http request.HttpResponsegetHttpResponse()getHttpResponse returns the Http response.java.lang.StringgetName()getName returns the function's name.OutgetOut()GetOut returns the returned value of function.java.util.Map<java.lang.String,Component>getOutputs()getOutputs returns the Outputs of function.java.util.Map<java.lang.String,Component>getStates()getStates returns the states of function.TopicEventgetTopicEvent()getTopicEvent returns the topic event.java.lang.Errorsend(java.lang.String outputName, java.lang.String data)send provides the ability to allow the user to send data to a specified output target.
-
-
-
Method Detail
-
send
java.lang.Error send(java.lang.String outputName, java.lang.String data)
send provides the ability to allow the user to send data to a specified output target.- Parameters:
outputName- output target namedata- Data String- Returns:
- Error
-
getHttpRequest
HttpRequest getHttpRequest()
getHttpRequest returns the Http request.- Returns:
- HttpRequest
-
getHttpResponse
HttpResponse getHttpResponse()
getHttpResponse returns the Http response.- Returns:
- HttpResponse
-
getBindingEvent
BindingEvent getBindingEvent()
getBindingEvent returns the binding event.- Returns:
- BindingEvent GetBindingEvent();
-
getTopicEvent
TopicEvent getTopicEvent()
getTopicEvent returns the topic event.- Returns:
- TopicEvent
-
getCloudEvent
io.cloudevents.CloudEvent getCloudEvent()
getCloudEvent returns the cloud Event.- Returns:
- CloudEvent
-
getName
java.lang.String getName()
getName returns the function's name.- Returns:
- Function Name
-
getHttpPattern
java.lang.String getHttpPattern()
getHttpPattern returns the path of the server listening for http function.- Returns:
- String
-
getOutputs
java.util.Map<java.lang.String,Component> getOutputs()
getOutputs returns the Outputs of function.- Returns:
- Outputs
-
getStates
java.util.Map<java.lang.String,Component> getStates()
getStates returns the states of function.- Returns:
- states
-
getDaprClient
io.dapr.client.DaprClient getDaprClient()
getDaprClient return a dapr client, so that use user can call the dapr API directly. Be carefully, the dapr client maybe null;- Returns:
- Dapr client
-
-