|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.internet2.middleware.shibboleth.common.attribute.AttributeAuthorityCLI
public class AttributeAuthorityCLI
A command line tool that allows individuals to invoke an attribute authority and inspect the resultant attribute
statement.
This tool expects to retrieve the MetadataProvider
it uses under the bean name SAMLMetadataProvider, a
SAML1AttributeAuthority
under the bean name SAML1AttributeAuthority, and a SAML2AttributeAuthority
under the bean name SAML2AttributeAuthority.
Nested Class Summary | |
---|---|
private static class |
AttributeAuthorityCLI.CLIParserBuilder
Helper class that creates the command line argument parser. |
Field Summary | |
---|---|
private static String[] |
aacliConfigs
List of assumed Spring configuration files used with the AACLI. |
private static org.slf4j.Logger |
log
Class logger. |
private static SAML1AttributeAuthority |
saml1AA
Loaded SAML 1 Attribute Authority. |
private static SAML2AttributeAuthority |
saml2AA
Loaded SAML 2 Attribute Authority. |
Constructor Summary | |
---|---|
AttributeAuthorityCLI()
|
Method Summary | |
---|---|
private static BaseSAMLProfileRequestContext |
buildAttributeRequestContext(jargs.gnu.CmdLineParser parser,
org.springframework.context.ApplicationContext appCtx)
Builds the attribute request context from the command line arguments. |
private static void |
errorAndExit(String errorMessage,
Exception e)
Logs, as an error, the error message and exits the program. |
private static org.springframework.context.ApplicationContext |
loadConfigurations(String configDir,
String springExts)
Loads the configuration files into a Spring application context. |
private static void |
loadLoggingConfiguration(String configDir)
Loads the logging configuration. |
static void |
main(String[] args)
Runs this application. |
private static jargs.gnu.CmdLineParser |
parseCommandArguments(String[] args)
Parses the command line arguments |
private static org.opensaml.common.SAMLObject |
performSAML1AttributeResolution(jargs.gnu.CmdLineParser parser,
org.springframework.context.ApplicationContext appCtx)
Constructs a SAML 1 attribute statement with the retrieved and filtered attributes. |
private static org.opensaml.common.SAMLObject |
performSAML2AttributeResolution(jargs.gnu.CmdLineParser parser,
org.springframework.context.ApplicationContext appCtx)
Constructs a SAML 2 attribute statement with the retrieved and filtered attributes. |
private static void |
printAttributeStatement(org.opensaml.common.SAMLObject attributeStatement)
Prints the given attribute statement to system output. |
private static void |
printHelp(PrintStream out)
Prints a help message to the given output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static org.slf4j.Logger log
private static String[] aacliConfigs
private static SAML1AttributeAuthority saml1AA
private static SAML2AttributeAuthority saml2AA
Constructor Detail |
---|
public AttributeAuthorityCLI()
Method Detail |
---|
public static void main(String[] args) throws Exception
args
- command line arguments
Exception
- thrown if there is a problem during program executionprivate static jargs.gnu.CmdLineParser parseCommandArguments(String[] args) throws Exception
args
- command line arguments
Exception
- thrown if the underlying libraries could not be initializedprivate static org.springframework.context.ApplicationContext loadConfigurations(String configDir, String springExts) throws IOException, org.opensaml.util.resource.ResourceException
configDir
- directory containing spring configuration filesspringExts
- colon-separated list of spring extension files
IOException
- throw if there is an error loading the configuration files
org.opensaml.util.resource.ResourceException
- if there is an error loading the configuration filesprivate static void loadLoggingConfiguration(String configDir)
configDir
- IdP configuration directoryprivate static org.opensaml.common.SAMLObject performSAML1AttributeResolution(jargs.gnu.CmdLineParser parser, org.springframework.context.ApplicationContext appCtx)
parser
- command line argumentsappCtx
- spring application context with loaded attribute authority
private static org.opensaml.common.SAMLObject performSAML2AttributeResolution(jargs.gnu.CmdLineParser parser, org.springframework.context.ApplicationContext appCtx)
parser
- command line argumentsappCtx
- spring application context with loaded attribute authority
private static BaseSAMLProfileRequestContext buildAttributeRequestContext(jargs.gnu.CmdLineParser parser, org.springframework.context.ApplicationContext appCtx)
parser
- command line argument parserappCtx
- spring application context
private static void printAttributeStatement(org.opensaml.common.SAMLObject attributeStatement)
attributeStatement
- attribute statement to printprivate static void printHelp(PrintStream out)
out
- output to print the help message toprivate static void errorAndExit(String errorMessage, Exception e)
errorMessage
- error messagee
- exception that caused it
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |