- java.lang.Object
-
- aeonics.entity.Entity
-
- aeonics.http.Endpoint.Type
-
- aeonics.http.Endpoint.File.Type
-
- All Implemented Interfaces:
Exportable
,Snapshotable
- Enclosing class:
- Endpoint.File
public static class Endpoint.File.Type extends Endpoint.Type
-
-
Constructor Summary
Constructors Constructor Description Type()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
matches(java.lang.String url)
Returns true if the provided URL matches this endpointData
process(Message request)
Processes the request and generates a response.Storage.Type
store()
-
Methods inherited from class aeonics.http.Endpoint.Type
category, export, method, method, name, name, url, url
-
Methods inherited from class aeonics.entity.Entity
addRelation, addRelation, addRelation, cast, clearRelation, config, defineRelation, equals, firstRelation, hashCode, hasRelation, id, internal, onCreate, onRemove, onUpdate, parameter, relations, relationships, removeRelation, snapshot, type, valueOf, valueOf
-
-
-
-
Method Detail
-
store
public Storage.Type store()
-
matches
public boolean matches(java.lang.String url)
Description copied from class:Endpoint.Type
Returns true if the provided URL matches this endpoint- Overrides:
matches
in classEndpoint.Type
- Parameters:
url
- the URL to compare- Returns:
- true if the provided URL matches this endpoint
-
process
public Data process(Message request) throws java.lang.Exception
Description copied from class:Endpoint.Type
Processes the request and generates a response.The generated response can be any of the following:
- null: a 204 response is sent
- an exception: it is the same as if you throw it
- a scalar data type: it is sent as-is with an
'application/octet-stream'
mime type and a code 200 - a list or map data type: it is converted to its JSON representation and sent with an
'application/json'
mime type and a code 200 - a special response data map containing:
- isHttpResponse [required]: true [required]
- code: the http status code to send. Default 200.
- status: the http status text. If not specified, it will be derived from the response code.
- mime: the mime type to send. Default 'application/octet-stream'.
- body: the content to send (if a data map or list, then its JSON representation is used). Default to "".
- headers: any http response headers to send as a data map.
- Specified by:
process
in classEndpoint.Type
- Parameters:
request
- the original message data- Returns:
- the generated response
- Throws:
java.lang.Exception
- if anything happens, the exception will be wrapped in anHttpException
-
-