* Should be used in case of calls where it's not clear which write crud operation respective
* call represents, for ex. setRouting
*/
- default <REP extends JVppReply<?>> REP getReplyForWrite(@Nonnull Future<REP> future,
+ default <R extends JVppReply<?>> R getReplyForWrite(@Nonnull Future<R> future,
@Nonnull final InstanceIdentifier<?> replyType)
throws WriteFailedException {
* Should be used in case of calls where it's not clear which write crud operation respective
* call represents, for ex. setRouting
*/
- default <REP extends JVppReply<?>> REP getReplyForWrite(@Nonnull Future<REP> future,
+ default <R extends JVppReply<?>> R getReplyForWrite(@Nonnull Future<R> future,
@Nonnull final InstanceIdentifier<?> replyType,
@Nonnegative final int timeoutInSeconds)
throws WriteFailedException {
/**
* Consumes reply for jvpp call representing create operation
*/
- default <REP extends JVppReply<?>> REP getReplyForCreate(@Nonnull Future<REP> future,
+ default <R extends JVppReply<?>> R getReplyForCreate(@Nonnull Future<R> future,
@Nonnull final InstanceIdentifier<?> replyType,
@Nonnull final DataObject data)
throws WriteFailedException.CreateFailedException {
/**
* Consumes reply for jvpp call representing create operation
*/
- default <REP extends JVppReply<?>> REP getReplyForCreate(@Nonnull Future<REP> future,
+ default <R extends JVppReply<?>> R getReplyForCreate(@Nonnull Future<R> future,
@Nonnull final InstanceIdentifier<?> replyType,
@Nonnull final DataObject data,
@Nonnegative final int timeoutInSeconds)
/**
* Consumes reply for jvpp call representing update operation
*/
- default <REP extends JVppReply<?>> REP getReplyForUpdate(@Nonnull Future<REP> future,
+ default <R extends JVppReply<?>> R getReplyForUpdate(@Nonnull Future<R> future,
@Nonnull final InstanceIdentifier<?> replyType,
@Nonnull final DataObject dataBefore,
@Nonnull final DataObject dataAfter)
/**
* Consumes reply for jvpp call representing update operation
*/
- default <REP extends JVppReply<?>> REP getReplyForUpdate(@Nonnull Future<REP> future,
+ default <R extends JVppReply<?>> R getReplyForUpdate(@Nonnull Future<R> future,
@Nonnull final InstanceIdentifier<?> replyType,
@Nonnull final DataObject dataBefore,
@Nonnull final DataObject dataAfter,
/**
* Consumes reply for jvpp call representing delete operation
*/
- default <REP extends JVppReply<?>> REP getReplyForDelete(@Nonnull Future<REP> future,
+ default <R extends JVppReply<?>> R getReplyForDelete(@Nonnull Future<R> future,
@Nonnull final InstanceIdentifier<?> replyType)
throws WriteFailedException.DeleteFailedException {
return getReplyForDelete(future, replyType, JvppReplyTimeoutHolder.getTimeout());
/**
* Consumes reply for jvpp call representing delete operation
*/
- default <REP extends JVppReply<?>> REP getReplyForDelete(@Nonnull Future<REP> future,
+ default <R extends JVppReply<?>> R getReplyForDelete(@Nonnull Future<R> future,
@Nonnull final InstanceIdentifier<?> replyType,
@Nonnegative final int timeoutInSeconds)
throws WriteFailedException.DeleteFailedException {
}
}
- default <REP extends JVppReply<?>> REP getReplyForRead(@Nonnull Future<REP> future,
+ default <R extends JVppReply<?>> R getReplyForRead(@Nonnull Future<R> future,
@Nonnull final InstanceIdentifier<?> replyType)
throws ReadFailedException {
return getReplyForRead(future, replyType, JvppReplyTimeoutHolder.getTimeout());
}
- default <REP extends JVppReply<?>> REP getReplyForRead(@Nonnull Future<REP> future,
+ default <R extends JVppReply<?>> R getReplyForRead(@Nonnull Future<R> future,
@Nonnull final InstanceIdentifier<?> replyType,
@Nonnegative final int timeoutInSeconds)
throws ReadFailedException {
}
}
- default <REP extends JVppReply<?>> REP getReply(@Nonnull Future<REP> future)
+ default <R extends JVppReply<?>> R getReply(@Nonnull Future<R> future)
throws TimeoutException, VppBaseCallException {
return getReply(future, JvppReplyTimeoutHolder.getTimeout());
}
- default <REP extends JVppReply<?>> REP getReply(@Nonnull Future<REP> future,
+ default <R extends JVppReply<?>> R getReply(@Nonnull Future<R> future,
@Nonnegative final int timeoutInSeconds)
throws TimeoutException, VppBaseCallException {
try {
} catch (ExecutionException e) {
// Execution exception could generally contains any exception
// when using exceptions instead of return codes just rethrow it for processing on corresponding place
- if (e instanceof ExecutionException && (e.getCause() instanceof VppBaseCallException)) {
+ if (e.getCause() instanceof VppBaseCallException) {
throw (VppBaseCallException) (e.getCause());
}
throw new IllegalStateException(e);
private static final Logger LOG = LoggerFactory.getLogger(JvppReplyTimeoutHolder.class);
private static Optional<Integer> timeout = Optional.empty();
+ private JvppReplyTimeoutHolder() {
+ throw new UnsupportedOperationException("Utility class cannot be instantiated.");
+ }
+
public static void setupTimeout(@Nonnegative final int jvppTimeout) {
if (timeout.isPresent()) {
// do not fail on reconfigure, to not disturb restarts