package at.gv.egovernment.moa.id.config.auth;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* This class contains the parameters for verifying all the infoboxes configured for an
* online application.
*
* @author Harald Bratko
*/
public class VerifyInfoboxParameters {
/**
* A map of {@link VerifyInfoboxParameter} objects.
* Each of these objects contains parameters that maybe needed for validating an
* infobox.
*/
protected Map infoboxParameters_;
/**
* A list of the identifiers of the infoboxes supported by this
* VerifyInfoboxParameters;
*/
protected List identifiers_;
/**
* Holds the (comma separated) identifiers of those infoboxes MOA-IF is able to validate
* in the context of the actual online application.
* The string will be added as value of the PushInfobox
parameter in the
* HTML form used for reading the infoboxes from the BKU.
*/
protected String pushInfobox_;
/**
* Initializes this VerifyInfoboxParameters with an empty {@link #infoboxParameters_}
* map.
*/
public VerifyInfoboxParameters() {
infoboxParameters_ = new Hashtable();
pushInfobox_ = "";
}
/**
* Initializes this VerifyInfoboxParameters with the given
* infoboxParameters
map and builds the {@link #pushInfobox_} string
* from the keys of the given map.
*/
public VerifyInfoboxParameters(List identifiers, Map infoboxParameters) {
identifiers_ = identifiers;
infoboxParameters_ = infoboxParameters;
// build the pushInfobox string
if ((identifiers != null) && (!identifiers.isEmpty())) {
StringBuffer identifiersSB = new StringBuffer();
int identifiersNum = identifiers.size();
int i = 1;
Iterator it = identifiers.iterator();
while (it.hasNext()) {
identifiersSB.append((String)it.next());
if (i != identifiersNum) {
identifiersSB.append(",");
}
i++;
}
pushInfobox_ = identifiersSB.toString();
} else {
pushInfobox_ = "";
}
}
/**
* Returns the (comma separated) identifiers of the infoboxes configured for the actual
* online application.
*
* @see #pushInfobox_
*
* @return The (comma separated) identifiers of the infoboxes configured for the actual
* online application.
*/
public String getPushInfobox() {
return pushInfobox_;
}
/**
* Sets the {@link #pushInfobox_} string.
*
* @param pushInfobox The pushInfobox string to be set.
*/
public void setPushInfobox(String pushInfobox) {
pushInfobox_ = pushInfobox;
}
/**
* Returns map of {@link VerifyInfoboxParameter} objects.
* Each of these objects contains parameters that maybe needed for validating an
* infobox.
*
* @return The map of {@link VerifyInfoboxParameter} objects.
*/
public Map getInfoboxParameters() {
return infoboxParameters_;
}
/**
* Sets the map of {@link VerifyInfoboxParameter} objects.
*
* @see #infoboxParameters_
*
* @param infoboxParameters The infoboxParameters to set.
*/
public void setInfoboxParameters(Map infoboxParameters) {
infoboxParameters_ = infoboxParameters;
}
/**
* Returns the identifiers of the supported infoboxes.
*
* @return The identifiers.
*/
public List getIdentifiers() {
return identifiers_;
}
/**
* Sets the identifiers.
*
* @param identifiers The identifiers to set.
*/
public void setIdentifiers(List identifiers) {
identifiers_ = identifiers;
}
}