JCL-394: AccessRequest builder by acoburn · Pull Request #577 · inrupt/solid-client-java
This adds the implementation code for a builder pattern for access requests. In particular, this makes it possible to set an issuance date in the future, which is otherwise not possible in the current API.
The first commit just adds the boilerplate code for the new AccessRequest.RequestParameter class and connects that to the AccessGrantClient.requestAccess method (adding a new overload). The getIssuedAt value is then propagated through the rest of the methods (e.g. grantAccess() and denyAccess()).
Note: I re-ordered the parameters for some internal (private) methods to group the arguments into a more logical order. This does not affect the public API.
Some items still needed here include:
- javadocs
- tests
The way this would be used is like so:
var req = AccessRequest.RequestParameters.newBuilder() .recipient(agent) .resource(uri) .modes(modes) .purposes(purposes) .expiration(expiration) .issuedAt(issuance).build(); agclient.requestAccess(req);