コード例 #1
0
 private void randomDomainNamePos() {
   Random rand = new Random();
   List<String> domainList = this.diamondConfigure.getDomainNameList();
   if (!domainList.isEmpty()) {
     this.domainNamePos.set(rand.nextInt(domainList.size()));
   }
 }
コード例 #2
0
 /**
  * Generates a new nonce. The <code>isValidNonce</code> method will return true when using nonces
  * generated by this method.
  *
  * @return a unique nonce
  */
 public String generateNonce() {
   String nonce = String.valueOf(nonceGenerator.nextLong());
   nonceCache.put(nonce, System.currentTimeMillis());
   return nonce;
 }
コード例 #3
0
 public String getFiveDigitRandomNo() {
   Random r = new Random(System.currentTimeMillis());
   int tempRandomVal = 10000 + r.nextInt(20000);
   return String.valueOf(tempRandomVal);
 }