Package org.apache.nlpcraft.model
Interface NCRequest
-
- All Superinterfaces:
NCMetadata
public interface NCRequest extends NCMetadata
Information about the user request.- See Also:
NCContext.getRequest()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<String>
getClientAgent()
Gets string representation of the user client agent that made the call with this request.NCCompany
getCompany()
Gets descriptor of the user's company on behalf of which this request was submitted.String
getNormalizedText()
Gets normalized text of the user input.long
getReceiveTimestamp()
Gets UTC/GMT timestamp in ms when user input was received.Optional<String>
getRemoteAddress()
Gets optional address of the remote client.Map<String,Object>
getRequestData()
Gets optional JSON data passed in with the user request.String
getServerRequestId()
Gets globally unique server ID of the current request.NCUser
getUser()
Gets descriptor of the user on behalf of which this request was submitted.-
Methods inherited from interface org.apache.nlpcraft.model.NCMetadata
getMetadata, meta, meta, metaOpt, metax
-
-
-
-
Method Detail
-
getUser
NCUser getUser()
Gets descriptor of the user on behalf of which this request was submitted.- Returns:
- User descriptor.
-
getCompany
NCCompany getCompany()
Gets descriptor of the user's company on behalf of which this request was submitted.- Returns:
- User company descriptor.
-
getServerRequestId
String getServerRequestId()
Gets globally unique server ID of the current request.Server request is defined as a processing of a one user input request. Note that the model can be accessed multiple times during processing of a single user request and therefore multiple instances of this interface can return the same server request ID. In fact, users of this interfaces can use this fact by using this ID, for example, as a map key for a session scoped storage.
- Returns:
- Server request ID.
-
getNormalizedText
String getNormalizedText()
Gets normalized text of the user input.- Returns:
- Normalized text of the user input.
-
getReceiveTimestamp
long getReceiveTimestamp()
Gets UTC/GMT timestamp in ms when user input was received.- Returns:
- UTC/GMT timestamp in ms when user input was received.
-
getRemoteAddress
Optional<String> getRemoteAddress()
Gets optional address of the remote client.- Returns:
- Optional address of the remote client.
-
getClientAgent
Optional<String> getClientAgent()
Gets string representation of the user client agent that made the call with this request.- Returns:
- User agent string from user client (web browser, REST client, etc.).
-
-