diff options
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKResponse.java')
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKResponse.java | 92 |
1 files changed, 67 insertions, 25 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKResponse.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKResponse.java index 36f5a80b4..4e0f57779 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKResponse.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKResponse.java @@ -8,68 +8,110 @@ import eu.stork.peps.auth.commons.STORKAttrQueryResponse; import eu.stork.peps.auth.commons.STORKAuthnResponse; /** - * Implements MOA request and stores StorkAuthn/Attr-Request related data + * Implements MOA request and stores StorkAuthn/Attr-Request related data. * * @author bsuzic */ - public class MOASTORKResponse implements Serializable { + + /** The Constant serialVersionUID. */ private static final long serialVersionUID = -5798803155055518747L; - private STORKAuthnResponse storkAuthnRequest; - private STORKAttrQueryResponse storkAttrQueryRequest; - private boolean isAttrRequest = false; - private boolean isAuthnRequest = false; - + + /** The stork authn request. */ + private STORKAuthnResponse storkAuthnResponse; + + /** The stork attr query request. */ + private STORKAttrQueryResponse storkAttrQueryResponse; + + /** + * Sets the sTORK authn response. + * + * @param request the new sTORK authn response + */ public void setSTORKAuthnResponse(STORKAuthnResponse request) { - this.storkAuthnRequest = request; - if (request != null) { - isAuthnRequest = true; - } + this.storkAuthnResponse = request; } + /** + * Sets the sTORK attr response. + * + * @param request the new sTORK attr response + */ public void setSTORKAttrResponse(STORKAttrQueryResponse request) { - this.storkAttrQueryRequest = request; - if (request != null) { - isAttrRequest = true; - } + this.storkAttrQueryResponse = request; } + /** + * Checks if the container holds an AttrQuery + * + * @return true, if is attr response + */ public boolean isAttrResponse() { - return this.isAttrRequest; + return null != storkAttrQueryResponse; } + /** + * Checks if the container holds an AuthnRequest + * + * @return true, if is authn response + */ public boolean isAuthnResponse() { - return this.isAuthnRequest; + return null != storkAuthnResponse; } + /** + * Gets the AuthnResponse. + * + * @return the stork authn response + */ public STORKAuthnResponse getStorkAuthnResponse() { - return this.storkAuthnRequest; + return this.storkAuthnResponse; } + /** + * Gets the AttrQueryResponse. + * + * @return the stork attr query response + */ public STORKAttrQueryResponse getStorkAttrQueryResponse() { - return this.storkAttrQueryRequest; + return this.storkAttrQueryResponse; } + /** + * Gets the personal attribute list. + * + * @return the personal attribute list + */ public IPersonalAttributeList getPersonalAttributeList() { if(isAttrResponse()) - return this.storkAttrQueryRequest.getPersonalAttributeList(); + return this.storkAttrQueryResponse.getPersonalAttributeList(); else - return this.storkAuthnRequest.getPersonalAttributeList(); + return this.storkAuthnResponse.getPersonalAttributeList(); } + /** + * Sets the personal attribute list. + * + * @param populateAttributes the new personal attribute list + */ public void setPersonalAttributeList(PersonalAttributeList populateAttributes) { if(isAttrResponse()) - this.storkAttrQueryRequest.setPersonalAttributeList(populateAttributes); + this.storkAttrQueryResponse.setPersonalAttributeList(populateAttributes); else - this.storkAuthnRequest.setPersonalAttributeList(populateAttributes); + this.storkAuthnResponse.setPersonalAttributeList(populateAttributes); } + /** + * Sets the country. + * + * @param spCountry the new country + */ public void setCountry(String spCountry) { if(isAttrResponse()) - this.storkAttrQueryRequest.setCountry(spCountry); + this.storkAttrQueryResponse.setCountry(spCountry); else - this.storkAuthnRequest.setCountry(spCountry); + this.storkAuthnResponse.setCountry(spCountry); } } |