/** * Adds a new <code>Timestamp</code> to a soap envelope. * * A complete <code>Timestamp</code> is constructed and added to the * <code>wsse:Security</code> header. * * @return Document with Timestamp added * @throws Exception */ public Document build() { LOG.debug("Begin add timestamp..."); prepare(); prependToHeader(); return getDocument(); }
protected WSSecTimestamp createTimestamp() { if (binding.isIncludeTimestamp()) { Object o = message.getContextualProperty(SecurityConstants.TIMESTAMP_TTL); int ttl = 300; //default is 300 seconds if (o instanceof Number) { ttl = ((Number)o).intValue(); } else if (o instanceof String) { ttl = Integer.parseInt((String)o); } if (ttl <= 0) { ttl = 300; } timestampEl = new WSSecTimestamp(secHeader); timestampEl.setIdAllocator(wssConfig.getIdAllocator()); timestampEl.setWsTimeSource(wssConfig.getCurrentTime()); timestampEl.setTimeToLive(ttl); timestampEl.prepare(); String namespace = binding.getName().getNamespaceURI(); PolicyUtils.assertPolicy(aim, new QName(namespace, SPConstants.INCLUDE_TIMESTAMP)); } return timestampEl; }
protected WSSecTimestamp createTimestamp() { if (binding.isIncludeTimestamp()) { Object o = message.getContextualProperty(SecurityConstants.TIMESTAMP_TTL); int ttl = 300; //default is 300 seconds if (o instanceof Number) { ttl = ((Number)o).intValue(); } else if (o instanceof String) { ttl = Integer.parseInt((String)o); } if (ttl <= 0) { ttl = 300; } timestampEl = new WSSecTimestamp(secHeader); timestampEl.setIdAllocator(wssConfig.getIdAllocator()); timestampEl.setWsTimeSource(wssConfig.getCurrentTime()); timestampEl.setTimeToLive(ttl); timestampEl.prepare(); String namespace = binding.getName().getNamespaceURI(); PolicyUtils.assertPolicy(aim, new QName(namespace, SPConstants.INCLUDE_TIMESTAMP)); } return timestampEl; }