use of com.google.gerrit.server.change.PutTopic.Input in project gerrit by GerritCodeReview.
the class PutTopic method applyImpl.
@Override
protected Response<String> applyImpl(BatchUpdate.Factory updateFactory, ChangeResource req, Input input) throws UpdateException, RestApiException, PermissionBackendException {
req.permissions().check(ChangePermission.EDIT_TOPIC_NAME);
Op op = new Op(input != null ? input : new Input());
try (BatchUpdate u = updateFactory.create(dbProvider.get(), req.getChange().getProject(), req.getUser(), TimeUtil.nowTs())) {
u.addOp(req.getId(), op);
u.execute();
}
return Strings.isNullOrEmpty(op.newTopicName) ? Response.none() : Response.ok(op.newTopicName);
}
Aggregations