@Override
public void onSnatInterfaceAddDelFeatureReply(final SnatInterfaceAddDelFeatureReply msg) {
- System.out.printf("Received SnatInterfaceAddDelFeatureReply: context=%d\n",
+ System.out.printf("Received SnatInterfaceAddDelFeatureReply: context=%d%n",
msg.context);
}
@Override
public void onError(VppCallbackException ex) {
- System.out.printf("Received onError exception: call=%s, context=%d, retval=%d\n", ex.getMethodName(),
+ System.out.printf("Received onError exception: call=%s, context=%d, retval=%d%n", ex.getMethodName(),
ex.getCtxId(), ex.getErrorCode());
}
}
request.isInside = 1;
request.swIfIndex = 1;
final int result = jvpp.send(request);
- System.out.printf("SnatInterfaceAddDelFeature send result = %d\n", result);
+ System.out.printf("SnatInterfaceAddDelFeature send result = %d%n", result);
Thread.sleep(1000);
@Override
public void onGetNodeIndexReply(final GetNodeIndexReply msg) {
- System.out.printf("Received GetNodeIndexReply: %s\n", msg);
+ System.out.printf("Received GetNodeIndexReply: %s%n", msg);
}
@Override
public void onShowVersionReply(final ShowVersionReply msg) {
System.out.printf("Received ShowVersionReply: context=%d, program=%s, version=%s, "
- + "buildDate=%s, buildDirectory=%s\n",
+ + "buildDate=%s, buildDirectory=%s%n",
msg.context, new String(msg.program), new String(msg.version),
new String(msg.buildDate), new String(msg.buildDirectory));
}
@Override
public void onSwInterfaceDetails(final SwInterfaceDetails msg) {
System.out.printf("Received SwInterfaceDetails: interfaceName=%s, l2AddressLength=%d, adminUpDown=%d, "
- + "linkUpDown=%d, linkSpeed=%d, linkMtu=%d\n",
+ + "linkUpDown=%d, linkSpeed=%d, linkMtu=%d%n",
new String(msg.interfaceName), msg.l2AddressLength, msg.adminUpDown,
msg.linkUpDown, msg.linkSpeed, (int) msg.linkMtu);
}
@Override
public void onError(VppCallbackException ex) {
- System.out.printf("Received onError exception: call=%s, context=%d, retval=%d\n", ex.getMethodName(),
+ System.out.printf("Received onError exception: call=%s, context=%d, retval=%d%n", ex.getMethodName(),
ex.getCtxId(), ex.getErrorCode());
}
}
System.out.println("Sending ShowVersion request...");
final int result = jvpp.send(new ShowVersion());
- System.out.printf("ShowVersion send result = %d\n", result);
+ System.out.printf("ShowVersion send result = %d%n", result);
System.out.println("Sending GetNodeIndex request...");
GetNodeIndex getNodeIndexRequest = new GetNodeIndex();
@Override
public void onError(final VppCallbackException ex) {
- System.out.printf("Received onError exception: call=%s, context=%d, retval=%d\n",
+ System.out.printf("Received onError exception: call=%s, context=%d, retval=%d%n",
ex.getMethodName(), ex.getCtxId(), ex.getErrorCode());
}
});
@Override
public void onError(final VppCallbackException ex) {
- System.out.printf("Received onError exception: call=%s, context=%d, retval=%d\n",
+ System.out.printf("Received onError exception: call=%s, context=%d, retval=%d%n",
ex.getMethodName(), ex.getCtxId(), ex.getErrorCode());
}
});
@Override
public void onShowVersionReply(final ShowVersionReply msg) {
System.out.printf("ShowVersionCallback1 received ShowVersionReply: context=%d, program=%s,"
- + "version=%s, buildDate=%s, buildDirectory=%s\n", msg.context, new String(msg.program),
+ + "version=%s, buildDate=%s, buildDirectory=%s%n", msg.context, new String(msg.program),
new String(msg.version), new String(msg.buildDate), new String(msg.buildDirectory));
}
@Override
public void onError(VppCallbackException ex) {
- System.out.printf("Received onError exception in showVersionCallback1: call=%s, reply=%d, context=%d\n",
+ System.out.printf("Received onError exception in showVersionCallback1: call=%s, reply=%d, context=%d%n",
ex.getMethodName(), ex.getErrorCode(), ex.getCtxId());
}
};
@Override
public void onShowVersionReply(final ShowVersionReply msg) {
System.out.printf("ShowVersionCallback2 received ShowVersionReply: context=%d, program=%s,"
- + "version=%s, buildDate=%s, buildDirectory=%s\n", msg.context, new String(msg.program),
+ + "version=%s, buildDate=%s, buildDirectory=%s%n", msg.context, new String(msg.program),
new String(msg.version), new String(msg.buildDate), new String(msg.buildDirectory));
}
@Override
public void onError(VppCallbackException ex) {
- System.out.printf("Received onError exception in showVersionCallback2: call=%s, reply=%d, context=%d\n",
+ System.out.printf("Received onError exception in showVersionCallback2: call=%s, reply=%d, context=%d%n",
ex.getMethodName(), ex.getErrorCode(), ex.getCtxId());
}
private static GetNodeIndexCallback getNodeIndexCallback = new GetNodeIndexCallback() {
@Override
public void onGetNodeIndexReply(final GetNodeIndexReply msg) {
- System.out.printf("Received GetNodeIndexReply: %s\n", msg);
+ System.out.printf("Received GetNodeIndexReply: %s%n", msg);
}
@Override
public void onError(VppCallbackException ex) {
- System.out.printf("Received onError exception in getNodeIndexCallback: call=%s, reply=%d, context=%d\n",
+ System.out.printf("Received onError exception in getNodeIndexCallback: call=%s, reply=%d, context=%d%n",
ex.getMethodName(), ex.getErrorCode(), ex.getCtxId());
}
};
@Override
public void onError(VppCallbackException ex) {
- System.out.printf("Received onError exception in getNodeIndexCallback: call=%s, reply=%d, context=%d\n",
+ System.out.printf("Received onError exception in getNodeIndexCallback: call=%s, reply=%d, context=%d%n",
ex.getMethodName(), ex.getErrorCode(), ex.getCtxId());
}
registry.register(jvpp, new ControlPingCallback() {
@Override
public void onControlPingReply(final ControlPingReply reply) {
- System.out.printf("Received ControlPingReply: %s\n", reply);
+ System.out.printf("Received ControlPingReply: %s%n", reply);
}
@Override
}
private static void print(CreateSubifReply reply) {
- System.out.printf("CreateSubifReply: %s\n", reply);
+ System.out.printf("CreateSubifReply: %s%n", reply);
}
private static void testCreateSubInterface() throws Exception {
final ShowVersionReply reply = replyFuture.get();
LOG.info(
String.format(
- "Received ShowVersionReply: context=%d, program=%s, version=%s, buildDate=%s, buildDirectory=%s\n",
+ "Received ShowVersionReply: context=%d, program=%s, version=%s, buildDate=%s, buildDirectory=%s%n",
reply.context, new String(reply.program), new String(reply.version), new String(reply.buildDate),
new String(reply.buildDirectory)));
}
final GetNodeIndexReply reply = replyFuture.get();
LOG.info(
String.format(
- "Received GetNodeIndexReply: context=%d, nodeIndex=%d\n", reply.context, reply.nodeIndex));
+ "Received GetNodeIndexReply: context=%d, nodeIndex=%d%n", reply.context, reply.nodeIndex));
} catch (Exception e) {
LOG.log(Level.SEVERE, "GetNodeIndex request failed", e);
}
Objects.requireNonNull(details, "reply.swInterfaceDetails contains null element!");
LOG.info(
String.format("Received SwInterfaceDetails: interfaceName=%s, l2AddressLength=%d, adminUpDown=%d, "
- + "linkUpDown=%d, linkSpeed=%d, linkMtu=%d\n",
+ + "linkUpDown=%d, linkSpeed=%d, linkMtu=%d%n",
new String(details.interfaceName), details.l2AddressLength, details.adminUpDown,
details.linkUpDown, details.linkSpeed, (int) details.linkMtu));
}
}
private static void print(ClassifyAddDelTableReply reply) {
- System.out.printf("ClassifyAddDelTableReply: %s\n", reply);
+ System.out.printf("ClassifyAddDelTableReply: %s%n", reply);
}
private static void print(ClassifyTableIdsReply reply) {
- System.out.printf("ClassifyTableIdsReply: %s\n", reply);
+ System.out.printf("ClassifyTableIdsReply: %s%n", reply);
}
private static void print(final ClassifyTableInfoReply reply) {
}
private static void print(ClassifyAddDelSessionReply reply) {
- System.out.printf("ClassifyAddDelSessionReply: context=%s\n", reply);
+ System.out.printf("ClassifyAddDelSessionReply: context=%s%n", reply);
}
private static void print(final ClassifySessionDetailsReplyDump reply) {
}
private static void print(final InputAclSetInterfaceReply reply) {
- System.out.printf("InputAclSetInterfaceReply: context=%s\n", reply);
+ System.out.printf("InputAclSetInterfaceReply: context=%s%n", reply);
}
private static void print(final ClassifyTableByInterfaceReply reply) {
- System.out.printf("ClassifyAddDelTableReply: %s\n", reply);
+ System.out.printf("ClassifyAddDelTableReply: %s%n", reply);
}
private static void testL2Acl() throws Exception {
private NotificationUtils() {}
static PrintStream printNotification(final SwInterfaceSetFlagsNotification msg) {
- return System.out.printf("Received interface notification: ifc: %s\n", msg);
+ return System.out.printf("Received interface notification: ifc: %s%n", msg);
}
static SwInterfaceSetFlags getChangeInterfaceState() {
public static final class CompletableDumpFuture<T extends JVppReplyDump<?, ?>> extends CompletableFuture<T> {
private final T replyDump;
- private final long contextId;
+ private final int contextId;
- public CompletableDumpFuture(final long contextId, final T emptyDump) {
+ public CompletableDumpFuture(final int contextId, final T emptyDump) {
this.contextId = contextId;
this.replyDump = emptyDump;
}
- public long getContextId() {
+ public int getContextId() {
return contextId;
}