/** * Get request generation time if it is set. * * @return time of request, or null if it is not set. * @throws DVCSParsingException if a request time is present but cannot be extracted. */ public Date getRequestTime() throws DVCSParsingException { DVCSTime time = data.getRequestTime(); if (time == null) { return null; } try { if (time.getGenTime() != null) { return time.getGenTime().getDate(); } else { TimeStampToken token = new TimeStampToken(time.getTimeStampToken()); return token.getTimeStampInfo().getGenTime(); } } catch (Exception e) { throw new DVCSParsingException("unable to extract time: " + e.getMessage(), e); } }
private void validate(String name, DVCSTime result, DVCSTime expected) { if (areNull(name, result, expected)) { return; } validate(name + ".genTime", result.getGenTime(), expected.getGenTime()); validate(name + ".timeStampToken", result.getTimeStampToken(), expected.getTimeStampToken()); }
public void setRequestTime(Date requestTime) { requestInformationBuilder.setRequestTime(new DVCSTime(requestTime)); }