Skip to Content.
Sympa Menu

mace-opensaml-users - determining the statement type

Subject: OpenSAML user discussion

List archive

determining the statement type


Chronological Thread 
  • From: "Tom Scavo" <>
  • To: OpenSAML <>
  • Subject: determining the statement type
  • Date: Fri, 20 Apr 2007 13:36:11 -0400
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=oB1k8ptOcb24IjOHTjR79na+daUUeQCEEv55uZgVQWKx0Wn6Q+OuuIVkqmzkjrHi2dgGI9fasQM88Gel5sHHkSdq3v9HOAEGj7TbtqsAHby7Y4v/nWxOxl2xZ9FnSGMj/bHNa5hX+bYv+AkxuDlcF7MJM3rifExw+Wuir3nrvD8=

In OpenSAML 1.1, given an instance of a subclass of SAMLStatement, how
do I programmatically determine the instance type?

Maybe a code snippet will help explain what I'm trying to do:

Iterator statements = assertion.getStatements();
while (statements.hasNext()) {
SAMLStatement statement = (SAMLStatement) statements.next();
// TODO: log statement type
if (statement instanceof SAMLAuthenticationStatement) {
// process AuthenticationStatement
} else if (statement instanceof SAMLAttributeStatement) {
// process AttributeStatement
} else if (statement instanceof SAMLAuthorizationDecisionStatement) {
// process AuthorizationDecisionStatement
} else {
logger.warn("Unknown statement type");
}
}

Thanks,
Tom



Archive powered by MHonArc 2.6.16.

Top of Page