/** {@inheritDoc} */ public int getMajorVersion(){ return version.getMajorVersion(); }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException { RequestAbstractType request = (RequestAbstractType) samlElement; if (request.getID() != null) { domElement.setAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, request.getID()); if (request.getVersion() != SAMLVersion.VERSION_10) { domElement.setIdAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, true); } } if (request.getIssueInstant() != null) { String date = SAMLConfigurationSupport.getSAMLDateFormatter().print(request.getIssueInstant()); domElement.setAttributeNS(null, RequestAbstractType.ISSUEINSTANT_ATTRIB_NAME, date); } domElement.setAttributeNS(null, RequestAbstractType.MAJORVERSION_ATTRIB_NAME, Integer.toString(request.getVersion().getMajorVersion())); domElement.setAttributeNS(null, RequestAbstractType.MINORVERSION_ATTRIB_NAME, Integer.toString(request.getVersion().getMinorVersion())); } }
if (version.getMajorVersion() != 1) { throw new MessageHandlerException("Request major version was invalid"); if (version.getMajorVersion() != 1) { throw new MessageHandlerException("Request major version was invalid"); if (version.getMajorVersion() != 2) { throw new MessageHandlerException("Response major version was invalid"); if (version.getMajorVersion() != 2) { throw new MessageHandlerException("Response major version was invalid");
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException { ResponseAbstractType response = (ResponseAbstractType) samlElement; if (response.getID() != null) { domElement.setAttributeNS(null, ResponseAbstractType.ID_ATTRIB_NAME, response.getID()); if (response.getVersion() != SAMLVersion.VERSION_10) { domElement.setIdAttributeNS(null, ResponseAbstractType.ID_ATTRIB_NAME, true); } } if (response.getInResponseTo() != null) { domElement.setAttributeNS(null, ResponseAbstractType.INRESPONSETO_ATTRIB_NAME, response.getInResponseTo()); } if (response.getIssueInstant() != null) { String date = SAMLConfigurationSupport.getSAMLDateFormatter().print(response.getIssueInstant()); domElement.setAttributeNS(null, ResponseAbstractType.ISSUEINSTANT_ATTRIB_NAME, date); } domElement.setAttributeNS(null, RequestAbstractType.MAJORVERSION_ATTRIB_NAME, Integer.toString(response.getVersion().getMajorVersion())); domElement.setAttributeNS(null, RequestAbstractType.MINORVERSION_ATTRIB_NAME, Integer.toString(response.getVersion().getMinorVersion())); if (response.getRecipient() != null) { domElement.setAttributeNS(null, ResponseAbstractType.RECIPIENT_ATTRIB_NAME, response.getRecipient()); } }