public class MetadataGenerator extends Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
MetadataGenerator.Endpoints
The end points we understand.
|
| Modifier and Type | Field and Description |
|---|---|
(package private) static com.google.common.collect.ImmutableSet<MetadataGenerator.Endpoints> |
AA_ENDPOINTS
AttributeAuthority endpoints.
|
(package private) static com.google.common.collect.ImmutableSet<MetadataGenerator.Endpoints> |
ARTIFACT_ENDPOINTS
the Artifact endpoints.
|
(package private) static com.google.common.collect.ImmutableSet<MetadataGenerator.Endpoints> |
BACKCHANNEL_ENDPOINTS
Those endpoints which require a backchannel.
|
private String |
dnsName
The Dns Name.
|
private List<List<String>> |
encryptionCerts
The encryption certificates.
|
private EnumSet<MetadataGenerator.Endpoints> |
endpoints
Which endpoints to generate.
|
private String |
entityID
The EntityID.
|
private boolean |
saml2AttributeQueryCommented
Whether to comment out the SAML2 AA endpoint.
|
private boolean |
saml2LogoutCommented
Whether to comment out the SAML2 SLO endpoints.
|
private String |
scope
The Scope.
|
private List<List<String>> |
signingCerts
The signing certificates.
|
(package private) static com.google.common.collect.ImmutableSet<MetadataGenerator.Endpoints> |
SLO_ENDPOINTS
the SLO endpoints.
|
(package private) static com.google.common.collect.ImmutableSet<MetadataGenerator.Endpoints> |
SSO_ENDPOINTS
the SSO endpoints.
|
private BufferedWriter |
writer
Where to write to.
|
| Constructor and Description |
|---|
MetadataGenerator(File file)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeExtensions()
Write out the close <\Extensions> Element.
|
void |
generate()
Generate the metadata.
|
String |
getDNSName()
Get the DNSName.
|
List<List<String>> |
getEncryptionCerts()
Get the encryptionCerts.
|
EnumSet<MetadataGenerator.Endpoints> |
getEndpoints()
Get the Endpoints.
|
String |
getEntityID()
Get the entityID.
|
String |
getScope()
Get the Scope.
|
List<List<String>> |
getSigningCerts()
Get the signingCerts.
|
boolean |
isSAML2AttributeQueryCommented()
Returns whether to comment the SAML2 AA endpoint.
|
boolean |
isSAML2LogoutCommented()
Returns whether to comment the SAML2 Logout endpoints.
|
protected void |
openExtensions()
Write the open <Extensions> elements.
|
protected void |
outputEndpoint(MetadataGenerator.Endpoints endpoint)
Output the SAML for a single endpoint.
|
void |
removeBackChannel()
remove back channel endpoints.
|
void |
setDNSName(String id)
Set the DNSName.
|
void |
setEncryptionCerts(List<List<String>> certs)
Set the encryptionCerts.
|
void |
setEndpoints(EnumSet<MetadataGenerator.Endpoints> points)
Set the Endpoints.
|
void |
setEntityID(String id)
Set the entityID.
|
void |
setSAML2AttributeQueryCommented(boolean asComment)
Sets whether to comment the SAML2 AA endpoint.
|
void |
setSAML2LogoutCommented(boolean asComment)
Sets whether to comment the SAML2 Logout endpoints.
|
void |
setScope(String id)
Set the Scope.
|
void |
setSigningCerts(List<List<String>> certs)
Set the signingCerts.
|
private void |
writeAttributeAuthorityDescriptor()
Write the <AttributeAuthorityDescriptor>.
|
protected void |
writeComments()
Add appropriate comments to metadata header.
|
protected void |
writeExtensions()
Deprecated.
use
openExtensions() and closeExtensions() |
protected void |
writeIDPSSO()
Write the <IDPSSODescriptor>.
|
protected void |
writeKeyDescriptors()
Write out any <KeyDescriptor>Elements.
|
protected void |
writeKeyDescriptors(List<List<String>> certs,
String use)
Write out <KeyDescriptor>Elements.
|
protected void |
writeLangAttribute(String language)
Write the language attribute.
|
protected void |
writeMDUI()
Write out the <mdui:UIINFO> element and children.
|
protected void |
writeNameSpace(String prefix,
String name)
Writeout a prefix/namespace pair.
|
protected void |
writeNameSpaceQualified(String nameSpace,
String what)
Write a namespace:identifier pair.
|
protected void |
writeRoleDescriptor(String name,
List<String> protocols)
Write out an role descriptor.
|
protected void |
writeScope()
Write out the <shibmd:Scope> element.
|
static final com.google.common.collect.ImmutableSet<MetadataGenerator.Endpoints> BACKCHANNEL_ENDPOINTS
static final com.google.common.collect.ImmutableSet<MetadataGenerator.Endpoints> ARTIFACT_ENDPOINTS
static final com.google.common.collect.ImmutableSet<MetadataGenerator.Endpoints> SSO_ENDPOINTS
static final com.google.common.collect.ImmutableSet<MetadataGenerator.Endpoints> SLO_ENDPOINTS
static final com.google.common.collect.ImmutableSet<MetadataGenerator.Endpoints> AA_ENDPOINTS
private EnumSet<MetadataGenerator.Endpoints> endpoints
private String entityID
private String dnsName
private String scope
private boolean saml2AttributeQueryCommented
private boolean saml2LogoutCommented
private final BufferedWriter writer
public MetadataGenerator(@Nonnull File file) throws FileNotFoundException
file - file to output to.FileNotFoundException - if the file cannot be found.public String getEntityID()
public void setEntityID(String id)
id - what to set.public String getScope()
public void setScope(String id)
id - what to set.public String getDNSName()
public void setDNSName(String id)
id - what to set.public List<List<String>> getSigningCerts()
public void setSigningCerts(List<List<String>> certs)
certs - what to set.public List<List<String>> getEncryptionCerts()
public void setEncryptionCerts(List<List<String>> certs)
certs - what to set.public void removeBackChannel()
public EnumSet<MetadataGenerator.Endpoints> getEndpoints()
public void setEndpoints(@Nonnull EnumSet<MetadataGenerator.Endpoints> points)
points - what to set.public boolean isSAML2AttributeQueryCommented()
public void setSAML2AttributeQueryCommented(boolean asComment)
asComment - whether to comment or not.public boolean isSAML2LogoutCommented()
public void setSAML2LogoutCommented(boolean asComment)
asComment - whether to comment or notpublic void generate()
throws IOException
IOException - if we have a failure.protected void writeComments()
throws IOException
IOException - if badness occurs in the writerprotected void writeNameSpace(@Nullable String prefix, @Nonnull String name) throws IOException
prefix - the prefix, or nullname - the namespaceIOException - if badness happensprotected void writeIDPSSO()
throws IOException
IOException - if badness happensprivate void writeAttributeAuthorityDescriptor()
throws IOException
IOException - if badness happensprotected void writeRoleDescriptor(String name, List<String> protocols) throws IOException
name - the nameprotocols - the supported protocolsIOException - when badness happebnsprotected void openExtensions()
throws IOException
IOException - if badness happensprotected void closeExtensions()
throws IOException
IOException - if badness happens@Deprecated protected void writeExtensions() throws IOException
IOException - if badness happensprotected void writeScope()
throws IOException
IOException - if badness happensprotected void writeMDUI()
throws IOException
IOException - if badness happensprotected void writeLangAttribute(String language) throws IOException
language - which languagesIOException - if badness happensprotected void writeKeyDescriptors()
throws IOException
IOException - if badness happensprotected void writeKeyDescriptors(@Nullable List<List<String>> certs, @Nonnull@NotEmpty String use) throws IOException
certs - the certificatesuse - the type - signing or encryptionIOException - if badness happensprotected void outputEndpoint(MetadataGenerator.Endpoints endpoint) throws IOException
endpoint - the typeIOException - if badness happens.protected void writeNameSpaceQualified(@Nonnull String nameSpace, String what) throws IOException
nameSpace - the namespacewhat - the identifierIOException - if badness happensCopyright © 1999–2019 Shibboleth Consortium. All rights reserved.