if (DatatypeHelper.isEmpty(encodedMessage)) { log.error("Request did not contain either a SAMLRequest or " + "SAMLResponse paramter. Invalid request for SAML 2 HTTP POST binding.");
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException { ResourceMatchType matchType = (ResourceMatchType) xmlObject; if (!DatatypeHelper.isEmpty(matchType.getMatchId())) { domElement.setAttribute(ResourceMatchType.MATCH_ID_ATTRIB_NAME, matchType.getMatchId()); } }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException { RuleCombinerParametersType ruleCombinerParametersType = (RuleCombinerParametersType)xmlObject; if(!DatatypeHelper.isEmpty(ruleCombinerParametersType.getRuleIdRef())){ domElement.setAttribute(RuleCombinerParametersType.RULE_ID_REF_ATTRIB_NAME, ruleCombinerParametersType.getRuleIdRef()); } }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException { FunctionType functionType = (FunctionType) xmlObject; if(!DatatypeHelper.isEmpty(functionType.getFunctionId())){ domElement.setAttribute(FunctionType.FUNCTION_ID_ATTRIB_NAME,functionType.getFunctionId()); } }
/** * Checks that Method is present. * * @param subjectConfirmation * @throws ValidationException */ protected void validateMethod(SubjectConfirmation subjectConfirmation) throws ValidationException { if (DatatypeHelper.isEmpty(subjectConfirmation.getMethod())) { throw new ValidationException("Method required"); } } }
/** * Validates the SessionIndex element content. * * @param si * @throws ValidationException */ protected void validateSessionIndex(SessionIndex si) throws ValidationException { if (DatatypeHelper.isEmpty(si.getSessionIndex())) { throw new ValidationException("SessionIndex must be non-empty"); } } }
/** * Checks that the AttributeName attribute is present and valid * @param designator * @throws ValidationException */ protected void validateName(AttributeDesignator designator) throws ValidationException { if (DatatypeHelper.isEmpty(designator.getAttributeName())) { throw new ValidationException("AttributeName attribute not present or invalid"); } } }
/** * Checks that Number is present. * * @param telephoneNumber * @throws ValidationException */ protected void validateNumber(TelephoneNumber telephoneNumber) throws ValidationException { if (DatatypeHelper.isEmpty(telephoneNumber.getNumber())) { throw new ValidationException("Number required"); } } }
/** * Checks that Format is present. * * @param nameIDFormat * @throws ValidationException */ protected void validateFormat(NameIDFormat nameIDFormat) throws ValidationException { if (DatatypeHelper.isEmpty(nameIDFormat.getFormat())) { throw new ValidationException("Format required"); } } }
/** * Checks that the URI reference is present. * * @param assertionURIRef * @throws ValidationException */ protected void validateURIRef(AssertionURIRef assertionURIRef) throws ValidationException { if (DatatypeHelper.isEmpty(assertionURIRef.getAssertionURI())) { throw new ValidationException("AssertionURI required"); } } }
protected void validateURIPresent(Audience audience) throws ValidationException { if (DatatypeHelper.isEmpty(audience.getUri())) { throw new ValidationException("AudienceURI Required"); } } }
protected void validateMessage(StatusMessage sm) throws ValidationException { if (DatatypeHelper.isEmpty(sm.getMessage())) { throw new ValidationException("Message element just be non-empty"); } } }
/** * Check the location Attribute for validity * @param authorityBinding * @throws ValidationException */ protected void validateLocation(AuthorityBinding authorityBinding) throws ValidationException { if (DatatypeHelper.isEmpty(authorityBinding.getLocation())) { throw new ValidationException("Location attribute not present or invalid "); } }
/** * Check the binding Attribute for validity * @param authorityBinding * @throws ValidationException */ protected void validateBinding(AuthorityBinding authorityBinding) throws ValidationException { if (DatatypeHelper.isEmpty(authorityBinding.getBinding())) { throw new ValidationException("Binding attribute not present or invalid "); } } }
protected void validateRequesterID(RequesterID reqid) throws ValidationException { if (DatatypeHelper.isEmpty(reqid.getRequesterID())) { throw new ValidationException("RequesterID element must be non-empty"); } }
/** * Validates the Value attribute * * @param sc * @throws ValidationException */ protected void validateValue(StatusCode sc) throws ValidationException { if (DatatypeHelper.isEmpty(sc.getValue())) { throw new ValidationException("Value attribute is required"); } }
/** * Checks that ProfileURI is present. * * @param attributeProfile * @throws ValidationException */ protected void validateProfileURI(AttributeProfile attributeProfile) throws ValidationException { if (DatatypeHelper.isEmpty(attributeProfile.getProfileURI())) { throw new ValidationException("ProfileURI required"); } } }
/** * Validate that the ID is present and valid * * @param response * @throws ValidationException */ protected void validateID(ResponseAbstractType response) throws ValidationException { if (DatatypeHelper.isEmpty(response.getID())) { throw new ValidationException("RequestID is null, empty or whitespace"); } }
/** {@inheritDoc} */ public void setURI(LocalizedString newURI) { uri = prepareForAssignment(uri, newURI); boolean hasXMLLang = false; if (uri != null && !DatatypeHelper.isEmpty(uri.getLanguage())) { hasXMLLang = true; } manageQualifiedAttributeNamespace(LangBearing.XML_LANG_ATTR_NAME, hasXMLLang); }
/** {@inheritDoc} */ public XMLObject unmarshall(Element domElement) throws UnmarshallingException { // After regular unmarshalling, check the minor version and set ID-ness if not SAML 1.0 ResponseAbstractType response = (ResponseAbstractType) super.unmarshall(domElement); if (response.getMinorVersion() != 0 && !DatatypeHelper.isEmpty(response.getID())) { domElement.setIdAttributeNS(null, ResponseAbstractType.ID_ATTRIB_NAME, true); } return response; }