use of com.sun.identity.console.base.AMPipeDelimitAttrTokenizer in project OpenAM by OpenRock.
the class FederationViewBean method populateSAMLTable.
private void populateSAMLTable() {
tablePopulated = true;
FSSAMLServiceModel model = (FSSAMLServiceModel) getSAMLModel();
Map attrValues = model.getAttributeValues();
CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel(SAML_TABLE);
tblModel.clearAll();
removePageSessionAttribute(SAML_TABLE_ATTRIBUTE);
List cache = new ArrayList();
for (Iterator iter = attrValues.keySet().iterator(); iter.hasNext(); ) {
String name = (String) iter.next();
Set values = (Set) attrValues.get(name);
if (name.equals(TABLE_TRUSTED_PARTNERS)) {
AMPipeDelimitAttrTokenizer tokenizer = AMPipeDelimitAttrTokenizer.getInstance();
boolean firstEntry = true;
int counter = 0;
for (Iterator iter2 = values.iterator(); iter2.hasNext(); ) {
if (!firstEntry) {
tblModel.appendRow();
} else {
firstEntry = false;
}
String tokenizedValue = (String) iter2.next();
Map map = AMAdminUtils.upCaseKeys(tokenizer.tokenizes(tokenizedValue));
String partnerName = (String) map.get(SAMLConstants.PARTNERNAME);
if (partnerName == null) {
partnerName = (String) map.get(SAMLConstants.SOURCEID);
}
tblModel.setValue(SAML_TRUSTED_PARTNER_VALUE, partnerName);
tblModel.setValue(SAML_TRUSTED_PARTNER_HREF, Integer.toString(counter++));
cache.add(tokenizedValue);
// get trusted partner type
SAMLPropertyXMLBuilder builder = SAMLPropertyXMLBuilder.getInstance();
List profiles = (ArrayList) builder.getSAMLProperties(map);
StringBuffer trustedPartnerSourceType = new StringBuffer();
StringBuffer trustedPartnerDestinationType = new StringBuffer();
int size = profiles.size();
for (int i = 0; i < size; i++) {
if (((SAMLProperty) profiles.get(i)).getRole().equals("destination")) {
if (trustedPartnerDestinationType.length() != 0) {
trustedPartnerDestinationType.append(", ");
}
trustedPartnerDestinationType.append(getTrustedPartnersSelectType(((SAMLProperty) profiles.get(i)).getBindMethod()));
} else {
// source
if (trustedPartnerSourceType.length() != 0) {
trustedPartnerSourceType.append(", ");
}
trustedPartnerSourceType.append(getTrustedPartnersSelectType(((SAMLProperty) profiles.get(i)).getBindMethod()));
}
}
tblModel.setValue(SAML_TRUSTED_PARTNER_DESTINATION_TYPE, trustedPartnerDestinationType.toString());
tblModel.setValue(SAML_TRUSTED_PARTNER_SOURCE_TYPE, trustedPartnerSourceType.toString());
}
break;
}
}
setPageSessionAttribute(SAML_TABLE_ATTRIBUTE, (ArrayList) cache);
}
use of com.sun.identity.console.base.AMPipeDelimitAttrTokenizer in project OpenAM by OpenRock.
the class FSSAMLServiceViewBean method populatePipeSeparatedFormatTable.
private void populatePipeSeparatedFormatTable(String attrName, CCActionTableModel tmodel, Set values, String identifier, String columnName) {
AMPipeDelimitAttrTokenizer tokenizer = AMPipeDelimitAttrTokenizer.getInstance();
boolean firstEntry = true;
int counter = 0;
for (Iterator iter = values.iterator(); iter.hasNext(); counter++) {
if (!firstEntry) {
tmodel.appendRow();
} else {
firstEntry = false;
}
String tokenizedValue = (String) iter.next();
Map map = AMAdminUtils.upCaseKeys(tokenizer.tokenizes(tokenizedValue));
tmodel.setValue(columnName, (String) map.get(identifier));
populateEditDupLink(tmodel, counter, attrName);
}
}
Aggregations