use of org.graylog2.plugin.Version in project graylog2-server by Graylog2.
the class UdpTransportTest method transportReceivesDataExactlyRecvBufferSize.
@Test
public void transportReceivesDataExactlyRecvBufferSize() throws Exception {
final CountingChannelUpstreamHandler handler = new CountingChannelUpstreamHandler();
final UdpTransport transport = launchTransportForBootStrapTest(handler);
final InetSocketAddress localAddress = (InetSocketAddress) transport.getLocalAddress();
// This will be variable depending on the version of the IP protocol and the UDP packet size.
final int udpOverhead = 16;
final int maxPacketSize = RECV_BUFFER_SIZE - udpOverhead;
sendUdpDatagram(BIND_ADDRESS, localAddress.getPort(), maxPacketSize);
await().atMost(5, TimeUnit.SECONDS).until(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return !handler.getBytesWritten().isEmpty();
}
});
transport.stop();
assertThat(handler.getBytesWritten()).containsOnly(maxPacketSize);
}
use of org.graylog2.plugin.Version in project graylog2-server by Graylog2.
the class GettingStartedResource method dismissGettingStarted.
@POST
@Path("dismiss")
@ApiOperation("Dismiss auto-showing getting started guide for this version")
@AuditEvent(type = AuditEventTypes.GETTING_STARTED_GUIDE_OPT_OUT_CREATE)
public void dismissGettingStarted() {
final GettingStartedState gettingStartedState = clusterConfigService.getOrDefault(GettingStartedState.class, GettingStartedState.create(Sets.<String>newHashSet()));
gettingStartedState.dismissedInVersions().add(currentMinorVersionString());
clusterConfigService.write(gettingStartedState);
}
Aggregations