public class SecurityDomainManager extends Object
When the class is loaded, it will examine the System environment looking for the standard SSL/TLS environment variarbles. If present, they will be use to create a default SecurityDomain
#setTLSEnabled(boolean) method. Unless set, the default is to allow TLS.| Constructor and Description |
|---|
SecurityDomainManager() |
| Modifier and Type | Method and Description |
|---|---|
String |
formatKey(String host,
int port)
Concatenates a host string and port integer into a "host:port" string
|
String |
formatKey(URI uri)
Converts a well-formed URI containing a hostname and port into
string which allows for lookups in the Security Domain table
|
Set<String> |
getRegisteredSecurityDomains()
Returns the names of the registered security domains.
|
SecurityDomain |
getSecurityDomain(String name)
Returns the security domain with the given name.
|
SecurityDomain |
getSecurityDomain(String host,
int port) |
SecurityDomain |
getSecurityDomain(URI uri)
Returns the SecurityDomain object registered as associated with the URI.
|
void |
registerDefaultSecurityDomain(SecurityDomain securityDomain)
Registers the properies file to be used as the default security domain.
|
void |
registerSecurityDomain(SecurityDomain securityDomain)
Registers the SecurityDomain object with the ConfigurationManager.
|
void |
registerURItoSecurityDomain(URI uri,
String name)
Registers the association of the given URI to the named security domain.
|
void |
unregisterDefaultSecurityDomain()
Unregisters the default security domain, if it exists
|
void |
unregisterURItoSecurityDomain(URI uri)
Removes the URI from registered set of URI's
|
public void registerSecurityDomain(SecurityDomain securityDomain)
About the Security Domain name
The security domain name SecurityDomain#getName() is used as a key by subsequent calls such as {@link #registerURItoSecurityDomain(URI, String)}
to associate the security properties registered here.
securityDomain - domain to add to the configuration managerpublic void registerDefaultSecurityDomain(SecurityDomain securityDomain)
SecurityDomain.getName() method.
About the Security Domain name
The security domain name is used as a key by subsequent calls such as registerURItoSecurityDomain(URI, String)
to associate the security properties registered here.
securityDomain - public void registerURItoSecurityDomain(URI uri, String name) throws NoSecurityDomainException, URISyntaxException
uri - URI to register, may not be nullname - of SecurityDomain to associateURISyntaxException{@link - IllegalArgumentException If the specified domain doesn't exist, or if the URI is nullNoSecurityDomainExceptionpublic void unregisterURItoSecurityDomain(URI uri)
uri - public void unregisterDefaultSecurityDomain()
public SecurityDomain getSecurityDomain(String name)
name - public SecurityDomain getSecurityDomain(URI uri) throws NoSecurityDomainException, URISyntaxException
uri - NoSecurityDomainException - if no security name has been associated with the URIURISyntaxExceptionpublic SecurityDomain getSecurityDomain(String host, int port) throws NoSecurityDomainException, URISyntaxException
host - port - NoSecurityDomainExceptionURISyntaxExceptionpublic Set<String> getRegisteredSecurityDomains()
public String formatKey(URI uri) throws URISyntaxException
uri - URI to convertURISyntaxExceptionpublic String formatKey(String host, int port) throws URISyntaxException
host - port - URISyntaxExceptionCopyright © 2016 Open eHealth Foundation. All rights reserved.