@Test public void testDoGetMetadata() throws Exception { String metadataString = new Scanner(new File("../uaa/src/main/resources/idp.xml")).useDelimiter("\\Z").next(); ConfigMetadataProvider provider = new ConfigMetadataProvider(IdentityZone.getUaa().getId(), "testalias", metadataString); ConfigMetadataProvider provider2 = new ConfigMetadataProvider(IdentityZone.getUaa().getId(), "testalias", metadataString); DefaultBootstrap.bootstrap(); provider.setParserPool(new BasicParserPool()); XMLObject xmlObject = provider.doGetMetadata(); assertNotNull(xmlObject); assertEquals("http://openam.example.com:8181/openam", ((EntityDescriptorImpl) xmlObject).getEntityID()); assertEquals(provider, provider2); } }
/** {@inheritDoc} */ public List<XMLObject> getOrderedChildren() { ArrayList<XMLObject> children = new ArrayList<XMLObject>(); if (getSignature() != null) { children.add(getSignature()); } children.add(getExtensions()); children.addAll(roleDescriptors); children.add(getAffiliationDescriptor()); children.add(getOrganization()); children.addAll(contactPersons); children.addAll(additionalMetadata); return Collections.unmodifiableList(children); } }
/** {@inheritDoc} */ public void setValidUntil(DateTime newValidUntil) { validUntil = prepareForAssignment(validUntil, newValidUntil); }
/** {@inheritDoc} */ public AuthnAuthorityDescriptor getAuthnAuthorityDescriptor(String supportedProtocol) { List<RoleDescriptor> descriptors = getRoleDescriptors(AuthnAuthorityDescriptor.DEFAULT_ELEMENT_NAME, supportedProtocol); if (descriptors.size() > 0) { return (AuthnAuthorityDescriptor) descriptors.get(0); } return null; }
/** {@inheritDoc} */ public void setID(String newID) { String oldID = this.id; this.id = prepareForAssignment(this.id, newID); registerOwnID(oldID, this.id); }
/** {@inheritDoc} */ public EntityDescriptor buildObject(String namespaceURI, String localName, String namespacePrefix) { return new EntityDescriptorImpl(namespaceURI, localName, namespacePrefix); } }
/** {@inheritDoc} */ public void setAffiliationDescriptor(AffiliationDescriptor descriptor) { affiliationDescriptor = prepareForAssignment(affiliationDescriptor, descriptor); }
/** {@inheritDoc} */ public AttributeAuthorityDescriptor getAttributeAuthorityDescriptor(String supportedProtocol) { List<RoleDescriptor> descriptors = getRoleDescriptors(AttributeAuthorityDescriptor.DEFAULT_ELEMENT_NAME, supportedProtocol); if (descriptors.size() > 0) { return (AttributeAuthorityDescriptor) descriptors.get(0); } return null; }
/** {@inheritDoc} */ public void setCacheDuration(Long duration) { cacheDuration = prepareForAssignment(cacheDuration, duration); }
/** {@inheritDoc} */ public PDPDescriptor getPDPDescriptor(String supportedProtocol) { List<RoleDescriptor> descriptors = getRoleDescriptors(PDPDescriptor.DEFAULT_ELEMENT_NAME, supportedProtocol); if (descriptors.size() > 0) { return (PDPDescriptor) descriptors.get(0); } return null; }
/** {@inheritDoc} */ public void setExtensions(Extensions newExtensions) { extensions = prepareForAssignment(extensions, newExtensions); }
/** {@inheritDoc} */ public IDPSSODescriptor getIDPSSODescriptor(String supportedProtocol) { List<RoleDescriptor> descriptors = getRoleDescriptors(IDPSSODescriptor.DEFAULT_ELEMENT_NAME, supportedProtocol); if (descriptors.size() > 0) { return (IDPSSODescriptor) descriptors.get(0); } return null; }
/** {@inheritDoc} */ public void setOrganization(Organization newOrganization) { organization = prepareForAssignment(organization, newOrganization); }
/** {@inheritDoc} */ public SPSSODescriptor getSPSSODescriptor(String supportedProtocol) { List<RoleDescriptor> descriptors = getRoleDescriptors(SPSSODescriptor.DEFAULT_ELEMENT_NAME, supportedProtocol); if (descriptors.size() > 0) { return (SPSSODescriptor) descriptors.get(0); } return null; }
/** {@inheritDoc} */ public void setEntityID(String newId) { if (newId != null && newId.length() > 1024) { throw new IllegalArgumentException("Entity ID can not exceed 1024 characters in length"); } entityID = prepareForAssignment(entityID, newId); }