Package me.hsgamer.hscore.request
Class RequestManager<I,D>
java.lang.Object
me.hsgamer.hscore.request.RequestManager<I,D>
- Type Parameters:
I- the type of the identifierD- the type of the data
The generic request manager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddRequest(I identifier) Add a requestvoidcompleteRequest(I identifier, D data) Complete the request of the identifier.voidcompleteRequest(I identifier, D data, boolean handleAll) Complete the request of the identifiervoidremoveRequest(I identifier) Remove a requestvoidremoveRequests(I identifier) Remove all requests
-
Constructor Details
-
RequestManager
public RequestManager()
-
-
Method Details
-
addRequest
Add a request- Parameters:
identifier- the identifier- Returns:
- the data future
-
removeRequests
Remove all requests- Parameters:
identifier- the identifier
-
removeRequest
Remove a request- Parameters:
identifier- the identifier
-
completeRequest
Complete the request of the identifier- Parameters:
identifier- the identifierdata- the datahandleAll- if true, all requests will be completed
-
completeRequest
Complete the request of the identifier. This method will handle only one request.- Parameters:
identifier- the identifierdata- the data
-