Skip to content

Consider reviewing EndpointFilter #11581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
snicoll opened this issue Jan 9, 2018 · 1 comment
Closed

Consider reviewing EndpointFilter #11581

snicoll opened this issue Jan 9, 2018 · 1 comment
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Jan 9, 2018

At the moment EndpointFilter takes an EndpointInfo and a EndpointDiscoverer. The latter is odd as discovering the endpoints (again?) as part of the filtering shouldn't add a lot of value on the filtering of a particular item.

In practice, this argument is used to check the implementation type of the discoverer as way to identify the "nature" of the search:

class WebEndpointFilter implements EndpointFilter<WebOperation> {

	@Override
	public boolean match(EndpointInfo<WebOperation> info,
			EndpointDiscoverer<WebOperation> discoverer) {
		return (discoverer instanceof WebAnnotationEndpointDiscoverer);
	}

}

Rather than passing an object which seems unrelated, perhaps we could pass a "Scope" object of some kind that implementations can use to restrict themselves. The scope might be as magic as the EndpointDiscoverer though.

This is a bit related to #10257 as we might be interested by all "Web" endpoints regardless to the fact they are "regular" web endpoints or "custom" web endpoints. The discoverer won't be the same in that case.

@snicoll snicoll added for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Jan 9, 2018
@philwebb
Copy link
Member

philwebb commented Jan 9, 2018

Perhaps just Class<? extends EndpointDiscoverer> would be enough of a signal that it's only the discoverer type that's of interest. Extracting both to a context would perhaps be even better.

@philwebb philwebb added this to the 2.0.0.RC1 milestone Jan 10, 2018
@philwebb philwebb added type: enhancement A general enhancement priority: normal and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Jan 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants