/** * */ package eu.stork.vidp.api.messages; import java.io.Serializable; import java.util.HashMap; import java.util.Map; import java.util.Arrays; /** * Class encapsulating the HTML content to be returned to the user's browser * * @author bzwattendorfer * */ public class StartAuthResponse implements Serializable { private int httpStatusCode; private byte[] content; private Map httpHeaders; /** * Creates a new StartAuthenticationResponse object * @param httpStatusCode HTTP Status code to be returned to the user's browser * @param content HTML content to be returned to the user's browser * @param httpHeaders HTTP headers to be returned to the user's browser */ public StartAuthResponse() { super(); } public StartAuthResponse(int httpStatusCode, byte[] content, Map httpHeaders) { super(); this.httpStatusCode = httpStatusCode; this.content = content; this.httpHeaders = httpHeaders; } /** * Creates a new StartAuthenticationResponse object * @param httpStatusCode HTTP Status code to be returned to the user's browser * @param content HTML content to be returned to the user's browser */ public StartAuthResponse(int httpStatusCode, byte[] content) { super(); this.httpStatusCode = httpStatusCode; this.content = content; this.httpHeaders = new HashMap(); } /** * Gets the HTTP status code * @return HTTP status code */ public int getHttpStatusCode() { return httpStatusCode; } /** * Sets the HTTP status code * @param httpStatusCode HTTP status code */ public void setHttpStatusCode(int httpStatusCode) { this.httpStatusCode = httpStatusCode; } /** * Gets the HTML content * @return HTML content */ public byte[] getContent() { return content; } /** * Sets the HTML content * @param content HTML content */ public void setContent(byte[] content) { this.content = content; } /** * Gets the Map containing the HTTP headers * @return HTTP header map */ public Map getHttpHeaders() { return httpHeaders; } /** * Sets the Map with HTTP Headers * @param httpHeaders HTTP Headers Map */ public void setHttpHeaders(Map httpHeaders) { this.httpHeaders = httpHeaders; } /** * Adds a HTTP Header to the Map * @param key HTTP Header name * @param value HTTP Header value */ public void addHeader(String key, String value) { } /** * Removes a HTTP Header * @param key HTTP Header name */ public void removeHeader(String key) { } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("StartAuthResponse ["); builder.append("content="); builder.append(Arrays.toString(content)); builder.append(", httpHeaders="); builder.append(httpHeaders); builder.append(", httpStatusCode="); builder.append(httpStatusCode); builder.append("]"); return builder.toString(); } }