package at.gv.egovernment.moa.id.auth.data; import org.w3c.dom.Element; /** * Contains an infobox token included in an InfoboxReadResponse. * Depending on whether the token is extracted from an XMLContent or a * Base64Content it is either returned as DOM element * ({@link #getXMLToken()}) or base64 encoded string ({@link #getBase64Token()}). * * @author Harald Bratko */ public interface InfoboxToken { /** * The key of the corresponding infobox. * This is the value of Key attribute of the <Pair> child * element in an <AssocArrayData> content of an InfoboxReadResponse. * Maybe null if the InfoboxReadResponse conatains BinaryFileData. * * * @return The key identifier of the corresponding infobox. */ public String getKey(); /** * Specifies if this token is the first token (e.g in an array of tokens) included in an * InfoboxReadResponse. If true this token is the token to be * validated by a corresponding * {@link at.gv.egovernment.moa.id.auth.validator.InfoboxValidator InfoboxValidator}. * If false this token maybe needed to validate the primary token. * * @return True if this token is the first token. */ public boolean isPrimary(); /** * Returns the infobox token. * Maybe null if the token is returned by method {@link #getBase64Token()} * as base64 encoded string. *
* Note that this token is not validated against the * application specific schema (e.g. Mandates schema in the mandates context). * Thus the validating application has to validate the token * against the appropriate schema. * * @return The infobox token. If null the token is returned by method * {@link #getBase64Token()} as base64 encoded string. */ public Element getXMLToken(); /** * Returns the infobox token. * Maybe null if the token is returned by method {@link #getXMLToken()} * as a DOM element. *
* Note, that the base64 encoded string actually may include more than one infobox * elements. * * @return The infobox token. If null the token is returned by method * {@link #getBase64Token()} as base64 encoded string. */ public String getBase64Token(); }