new ExtendedFcpAdapter() {
/** The ID of the “ListPeers” request. */
- private String identifier = "list-peers-" + System.currentTimeMillis();
+ @SuppressWarnings("synthetic-access")
+ private String identifier = createIdentifier("list-peers");
/**
* {@inheritDoc}
return sskKeypairWrapper.get();
}
+ //
+ // PRIVATE METHODS
+ //
+
+ /**
+ * Creates a unique request identifier.
+ *
+ * @param basename
+ * The basename of the request
+ * @return The created request identifier
+ */
+ private String createIdentifier(String basename) {
+ return basename + "-" + System.currentTimeMillis() + "-" + (int) (Math.random() * Integer.MAX_VALUE);
+ }
+
/**
* Implementation of an {@link FcpListener} that can store an
* {@link FcpException} and wait for the arrival of a certain command.