Class GraphsJSONResolver
- java.lang.Object
-
- com.djrapitops.plan.delivery.webserver.resolver.json.GraphsJSONResolver
-
-
Constructor Summary
Constructors Constructor Description GraphsJSONResolver(Identifiers identifiers, AsyncJSONResolverService jsonResolverService, GraphJSONCreator graphJSON)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canAccess(Request request)
Implement access control if authorization is enabled.java.util.Optional<Response>
resolve(Request request)
Resolves the request.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.djrapitops.plan.delivery.web.resolver.Resolver
newResponseBuilder, requiresAuth
-
-
-
-
Constructor Detail
-
GraphsJSONResolver
@Inject public GraphsJSONResolver(Identifiers identifiers, AsyncJSONResolverService jsonResolverService, GraphJSONCreator graphJSON)
-
-
Method Detail
-
canAccess
public boolean canAccess(Request request)
Description copied from interface:Resolver
Implement access control if authorization is enabled.Is not called when access control is not active.
- Specified by:
canAccess
in interfaceResolver
- Parameters:
request
- HTTP request, contains all information necessary to check access.- Returns:
- true if allowed or invalid target, false if response should be 403 (forbidden)
- See Also:
for that has access permissions.
-
resolve
public java.util.Optional<Response> resolve(Request request)
Resolves the request.- Specified by:
resolve
in interfaceResolver
- Parameters:
request
- HTTP request, contains all information necessary to resolve the request.- Returns:
- JSON response.
- Throws:
BadRequestException
- If 'type' parameter is not defined or supported.BadRequestException
- If 'server' parameter is not defined or server is not found in database.- See Also:
for return value
,for path /example/path etc
,for parameters ?param=value etc
-
-