Here you can find the source of calculateClientRequestId(String timestamp)
Parameter | Description |
---|---|
timestamp | the timestamp to generate clientRequestId from. It should be in "yyyyMMddHHmmss" format |
public static String calculateClientRequestId(String timestamp)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); /**/*from www. j a v a2s . c o m*/ * This method is used to calculate the clientRequestId parameter of a request. * * @param timestamp the timestamp to generate clientRequestId from. It should be in "yyyyMMddHHmmss" format * @return the clientRequestId or -1 if it can't be calculated */ public static String calculateClientRequestId(String timestamp) { try { return String.valueOf(sdf.parse(timestamp).getTime()); } catch (ParseException e) { return "-1"; } } }