public Token(String id, OMElement tokenElem, Date created, Date expires) throws TrustException { this.id = id; OMMetaFactory metaFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM); OMXMLStreamReaderConfiguration configuration = new OMXMLStreamReaderConfiguration(); configuration.setNamespaceURIInterning(true); this.token = OMXMLBuilderFactory.createStAXOMBuilder(metaFactory.getOMFactory(), tokenElem.getXMLStreamReader(true, configuration)).getDocumentElement(); this.created = created; this.expires = expires; }
public Token(String id, OMElement tokenElem, OMElement lifetimeElem) throws TrustException { this.id = id; OMMetaFactory metaFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM); OMXMLStreamReaderConfiguration configuration = new OMXMLStreamReaderConfiguration(); configuration.setNamespaceURIInterning(true); this.token = OMXMLBuilderFactory.createStAXOMBuilder(metaFactory.getOMFactory(), tokenElem.getXMLStreamReader(true, configuration)).getDocumentElement(); this.processLifeTime(lifetimeElem); }