/** {@inheritDoc} */ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException { ContactPerson person = (ContactPerson) parentSAMLObject; if (childSAMLObject instanceof Extensions) { person.setExtensions((Extensions) childSAMLObject); } else if (childSAMLObject instanceof Company) { person.setCompany((Company) childSAMLObject); } else if (childSAMLObject instanceof GivenName) { person.setGivenName((GivenName) childSAMLObject); } else if (childSAMLObject instanceof SurName) { person.setSurName((SurName) childSAMLObject); } else if (childSAMLObject instanceof EmailAddress) { person.getEmailAddresses().add((EmailAddress) childSAMLObject); } else if (childSAMLObject instanceof TelephoneNumber) { person.getTelephoneNumbers().add((TelephoneNumber) childSAMLObject); } else { super.processChildElement(parentSAMLObject, childSAMLObject); } }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { ContactPerson person = (ContactPerson) samlObject; if (person.getType() != null) { domElement.setAttributeNS(null, ContactPerson.CONTACT_TYPE_ATTRIB_NAME, person.getType().toString()); } marshallUnknownAttributes(person, domElement); } }
/** * look for the <ContactPerson> and within that the SurName. * * @param contactType the type of contact to look for * @return An appropriate string or null */ @Nullable public String getContactSurName(@Nullable final String contactType) { final ContactPerson contact = getContactPerson(getContactType(contactType)); if (null == contact || null == contact.getSurName()) { return null; } return contact.getSurName().getName(); }
final List<EmailAddress> emails = contact.getEmailAddresses(); String emailAddress = null; return buildURL(emailAddress, contactName); final SurName surName = contact.getSurName(); final GivenName givenName = contact.getGivenName(); final StringBuilder fullName = new StringBuilder(); if (null != givenName) {
/** * look for the <ContactPerson> and within that the Email. * * @param contactType the type of contact to look for * @return An appropriate string or null */ @Nullable public String getContactEmail(@Nullable final String contactType) { final ContactPerson contact = getContactPerson(getContactType(contactType)); if (null == contact || null == contact.getEmailAddresses() || contact.getEmailAddresses().isEmpty()) { return null; } return policeURLNonLogo(contact.getEmailAddresses().get(0).getAddress()); }
/** * look for the <ContactPerson> and within that the GivenName. * * @param contactType the type of contact to look for * @return An appropriate string or null */ @Nullable public String getContactGivenName(@Nullable final String contactType) { final ContactPerson contact = getContactPerson(getContactType(contactType)); if (null == contact || null == contact.getGivenName()) { return null; } return contact.getGivenName().getName(); }
/** {@inheritDoc} */ protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException { ContactPerson person = (ContactPerson) samlObject; if (attribute.getLocalName().equals(ContactPerson.CONTACT_TYPE_ATTRIB_NAME) && attribute.getNamespaceURI() == null) { if (ContactPersonTypeEnumeration.TECHNICAL.toString().equals(attribute.getValue())) { person.setType(ContactPersonTypeEnumeration.TECHNICAL); } else if (ContactPersonTypeEnumeration.SUPPORT.toString().equals(attribute.getValue())) { person.setType(ContactPersonTypeEnumeration.SUPPORT); } else if (ContactPersonTypeEnumeration.ADMINISTRATIVE.toString().equals(attribute.getValue())) { person.setType(ContactPersonTypeEnumeration.ADMINISTRATIVE); } else if (ContactPersonTypeEnumeration.BILLING.toString().equals(attribute.getValue())) { person.setType(ContactPersonTypeEnumeration.BILLING); } else if (ContactPersonTypeEnumeration.OTHER.toString().equals(attribute.getValue())) { person.setType(ContactPersonTypeEnumeration.OTHER); } else { super.processAttribute(samlObject, attribute); } } else { processUnknownAttribute(person, attribute); } } }
/** * Lookup the specified type of Contact in the RP metadata. * * @param contactType what type to look up. * @return the {@link ContactPerson} or null. */ @Nullable public ContactPerson getContactPerson(final ContactPersonTypeEnumeration contactType) { if (null == getRPEntityDescriptor()) { return null; } final List<ContactPerson> contacts = getRPEntityDescriptor().getContactPersons(); if (null == contacts || contacts.isEmpty()) { log.trace("No Contacts found at all"); return null; } for (final ContactPerson contact : contacts) { if (contactType == contact.getType()) { return contact; } } log.trace("No matching Contacts found at all"); return null; }