jakartaee / jakartaee/rest

Router interface

Open
#73 4 comments 0 reactions 1 assignee View on GitHub

@glassfishrobot is already working on this.

Since Feb 10, 2018.

Component: model api
Dominant language
Java
Stars
400
Forks
143
PR merge metrics
No merged PRs in 30d

Description

(Email from Guilherme Silveira, [http://java.net/projects/jax-rs-spec/lists/jsr339-experts/archive/2011-03/message/90](http://java.net/projects/jax-rs-spec/lists/jsr339-experts/archive/2011-03/message/90) )

7\. The heart of a new request. The semantic model for the HTTP<->Resource layer:

public interface Router {
void add(Route route);
ResourceMethod parse(String uri, HttpMethod method, MutableRequest request)
throws ResourceNotFoundException, MethodNotAllowedException, IllegalStateException;
String urlFor(Class type, Method method, Object... params);
List allRoutes();
}

And a route:

public interface Route {

boolean canHandle(String uri);
EnumSet allowedMethods();
String urlFor(Class type, Method m, Object... params);
boolean canHandle(Class type, Method method);
int getPriority();
String getOriginalUri();
}
#### Affected Versions
[2.0]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.