EndpointDispatch class abstract

The EndpointDispatch is responsible for directing requests to the Server to the correct Endpoint and method. Typically, this class is overridden by an Endpoints class that is generated.

Constructors

EndpointDispatch.new()

Properties

connectors Map<String, EndpointConnector>
All connectors associating endpoint method names with the actual methods.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
modules Map<String, EndpointDispatch>
References to modules.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getConnectorByName(String endpointName) EndpointConnector?
Finds an EndpointConnector by its name. If the connector is in a module, a period should separate the module name from the endpoint name.
getEndpointConnector({required Session session, required String endpointPath}) Future<EndpointConnector>
Tries to get an EndpointConnector for a given endpoint and method name. If the endpoint is not found, an EndpointNotFoundException is thrown. If the user is not authorized to access the endpoint, a NotAuthorizedException is thrown.
getMethodCallContext({required Session createSessionCallback(EndpointConnector connector), required String endpointPath, required String methodName, required Map<String, dynamic> parameters, required SerializationManager serializationManager}) Future<MethodCallContext>
Tries to get a MethodCallContext for a given endpoint and method name. If the method is not found, a MethodNotFoundException is thrown. If the endpoint is not found, an EndpointNotFoundException is thrown. If the user is not authorized to access the endpoint, a NotAuthorizedException is thrown. If the input parameters are invalid, an InvalidParametersException is thrown. If the found method is not a MethodConnector, an InvalidEndpointMethodTypeException is thrown.
getMethodStreamCallContext({required Session createSessionCallback(EndpointConnector connector), required String endpointPath, required String methodName, required Map<String, dynamic> arguments, required SerializationManager serializationManager, required List<String> requestedInputStreams}) Future<MethodStreamCallContext>
Tries to get a MethodStreamCallContext for a given endpoint and method name. If the method is not found, a MethodNotFoundException is thrown. If the endpoint is not found, an EndpointNotFoundException is thrown. If the user is not authorized to access the endpoint, a NotAuthorizedException is thrown. If the input parameters are invalid, an InvalidParametersException is thrown. If the found method is not a MethodStreamConnector, an InvalidEndpointMethodTypeException is thrown.
initializeEndpoints(Server server) → void
Initializes all endpoints that are connected to the dispatch.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

canUserAccessEndpoint(Future<AuthenticationInfo?> authInfoProvider(), bool requiresLogin, Set<Scope> requiredScopes) Future<ResultAuthenticationFailed?>
Checks if a user can access an Endpoint. If access is granted null is returned, otherwise a ResultAuthenticationFailed describing the issue is returned.
parseRequestedInputStreams({required Map<String, StreamParameterDescription> descriptions, required List<String> requestedInputStreams}) List<StreamParameterDescription>
Parses a list of requested input stream parameter descriptions and returns a list of stream parameter descriptions.