DTLSConnector implements Connector, RecordLayer { @Override public final synchronized void destroy() { stop(); connectionStore.clear(); } DTLSConnector(DtlsConnectorConfig configuration);  DTLSConnector(final DtlsConnectorConfig configuration, final SessionCache sessionCache); protected  DTLSConnector(final DtlsConnectorConfig configuration, final ResumptionSupportingConnectionStore connectionStore); final synchronized void setExecutor(ExecutorService executor); final void close(InetSocketAddress peerAddress); @Override final synchronized void start(); final synchronized void forceResumeSessionFor(InetSocketAddress peer); final synchronized void forceResumeAllSessions(); final synchronized void clearConnectionState(); @Override final void stop(); @Override final synchronized void destroy(); Future<Void> startDropConnectionsForPrincipal(final Principal principal); Future<Void> startTerminateConnectionsForPrincipal(
			final LeastRecentlyUsedCache.Predicate<Principal> principalHandler); Future<Void> startForEach(LeastRecentlyUsedCache.Predicate<Connection> handler); @Override void processRecord(Record record, Connection connection); @Override final void send(final RawData message); final DTLSSession getSessionByAddress(InetSocketAddress address); @Override void dropReceivedRecord(Record record); @Override int getMaxDatagramSize(boolean ipv6); @NoPublicAPI @Override void sendFlight(List<DatagramPacket> datagrams); @Deprecated final int getMaximumTransmissionUnit(); final int getMaximumFragmentLength(InetSocketAddress peer); @Override final InetSocketAddress getAddress(); @Override final boolean isRunning(); @Override void setRawDataReceiver(final RawDataChannel messageHandler); @Override void setEndpointContextMatcher(EndpointContextMatcher endpointContextMatcher); final void setAlertHandler(AlertHandler handler); @Override String getProtocol(); @Override String toString(); static final String KEY_TLS_SERVER_HOST_NAME; }
@Test public void testAcceptClientHelloAfterIncompleteHandshake() throws Exception { if (client != null) { client.destroy(); } givenAnIncompleteHandshake(); clientConfig = newStandardConfig(clientEndpoint); clientConnectionStore = new InMemoryConnectionStore(CLIENT_CONNECTION_STORE_CAPACITY, 60); clientConnectionStore.setTag("client"); client = new DTLSConnector(clientConfig, clientConnectionStore); givenAnEstablishedSessionWithRetry(); }
@Test public void testDestroyClearsConnectionStore() throws Exception { givenAnEstablishedSession(); assertThat(clientConnectionStore.get(serverHelper.serverEndpoint), is(notNullValue())); client.destroy(); assertThat(clientConnectionStore.remainingCapacity(), is(CLIENT_CONNECTION_STORE_CAPACITY)); assertThat(clientConnectionStore.get(serverHelper.serverEndpoint), is(nullValue())); }