- java.lang.Object
- 
- aeonics.entity.Entity
- 
- aeonics.http.Endpoint.Type
 
 
- 
- All Implemented Interfaces:
- Exportable,- Snapshotable
 - Direct Known Subclasses:
- Endpoint.File.Type,- Endpoint.Rest.Type,- Endpoint.Websocket.Type
 - Enclosing class:
- Endpoint
 
 public abstract static class Endpoint.Type extends Entity This is the base endpoint.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface aeonics.util.SnapshotableSnapshotable.SnapshotMode
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedType()Empty constructor
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Stringcategory()Hardcoded category to theEndpointclassDataexport()The default entity export implementation includes informational metadata fields as well as all declaredEntity.parameters()and all declaredEntity.relationships().booleanmatches(java.lang.String url)Returns true if the provided URL matches this endpointjava.lang.Stringmethod()Returns the HTTP method this endpoint accepts<T extends Endpoint.Type>
 Tmethod(java.lang.String value)Set the HTTP method this endpoint acceptsjava.lang.Stringname()Returns this entity name<T extends Entity>
 Tname(java.lang.String value)Sets this entity name.abstract Dataprocess(Message request)Processes the request and generates a response.java.lang.Stringurl()Returns the URL of this endpoint<T extends Endpoint.Type>
 Turl(java.lang.String value)Sets the URL of this endpoint- 
Methods inherited from class aeonics.entity.EntityaddRelation, addRelation, addRelation, cast, clearRelation, config, context, countRelations, countRelations, defineRelation, equals, firstRelation, hashCode, hasRelation, id, internal, internal, onCreate, onRemove, onUpdate, parameter, relations, relationships, removeRelation, snapshot, snapshotMode, template, type, valueOf, valueOf
 
- 
 
- 
- 
- 
Method Detail- 
methodpublic java.lang.String method() Returns the HTTP method this endpoint accepts- Returns:
- the HTTP method this endpoint accepts
 
 - 
methodpublic <T extends Endpoint.Type> T method(java.lang.String value) Set the HTTP method this endpoint accepts- Type Parameters:
- T- this endpoint type
- Parameters:
- value- the HTTP method this endpoint accepts
- Returns:
- this
 
 - 
urlpublic java.lang.String url() Returns the URL of this endpoint- Returns:
- the URL of this endpoint
 
 - 
urlpublic <T extends Endpoint.Type> T url(java.lang.String value) Sets the URL of this endpoint- Type Parameters:
- T- this endpoint type
- Parameters:
- value- the URL of this endpoint
- Returns:
- this
 
 - 
matchespublic boolean matches(java.lang.String url) Returns true if the provided URL matches this endpoint- Parameters:
- url- the URL to compare
- Returns:
- true if the provided URL matches this endpoint
 
 - 
processpublic abstract Data process(Message request) throws java.lang.Exception 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.
 
 - Parameters:
- request- the original message data
- Returns:
- the generated response
- Throws:
- java.lang.Exception- if anything happens, the exception will be wrapped in an- HttpException
 
 - 
exportpublic Data export() Description copied from class:EntityThe default entity export implementation includes informational metadata fields as well as all declaredEntity.parameters()and all declaredEntity.relationships().If there are potentially private or confidential data returned by the default implementation, you should override it and modify the result before returning it. Note that you may provide your own custom implementation although it may introduce inconsistencies with the frontent application in case of unexpected format or missing information. Therefore, it is always prefeable to call super.export()and manipulate the result instead.- Specified by:
- exportin interface- Exportable
- Overrides:
- exportin class- Entity
- Returns:
- a public data representation of this class instance
 
 - 
namepublic java.lang.String name() Description copied from class:EntityReturns this entity name
 - 
namepublic <T extends Entity> T name(java.lang.String value) Description copied from class:EntitySets this entity name.
 - 
categorypublic final java.lang.String category() Hardcoded category to theEndpointclass- Overrides:
- categoryin class- Entity
- Returns:
- the entity category
- See Also:
- Registry.of(String)
 
 
- 
 
-