use of com.sun.identity.liberty.ws.disco.jaxb.DescriptionType in project OpenAM by OpenRock.
the class SMDiscoEntryData method getDescriptionType.
private DescriptionType getDescriptionType(String id, List list) {
DescriptionType descType = null;
boolean found = false;
for (Iterator iter = list.iterator(); iter.hasNext() && (descType == null); ) {
DescriptionType desc = (DescriptionType) iter.next();
if (desc != null) {
List descTypeList = desc.getSecurityMechID();
if (descTypeList.contains(id)) {
descType = desc;
}
}
}
return descType;
}
use of com.sun.identity.liberty.ws.disco.jaxb.DescriptionType in project OpenAM by OpenRock.
the class SMDiscoEntryData method createDirectiveEntry.
private void createDirectiveEntry(DiscoEntryElement de, DirectiveType dType, List idRefs, List descriptionTypeList) throws AMConsoleException {
if (idRefs != null && !idRefs.isEmpty()) {
for (Iterator iter = idRefs.iterator(); iter.hasNext(); ) {
String idRef = (String) iter.next();
DescriptionType desc = getDescriptionType(idRef, descriptionTypeList);
if (desc == null) {
throw new AMConsoleException("invalidDescIdRefs.message");
}
dType.getDescriptionIDRefs().add(desc);
}
}
de.getAny().add(dType);
}
use of com.sun.identity.liberty.ws.disco.jaxb.DescriptionType in project OpenAM by OpenRock.
the class SMDiscoveryServiceData method setDirectiveData.
private static void setDirectiveData(DirectiveType dType, Map map, String directiveName) {
List idRefsList = dType.getDescriptionIDRefs();
List idRefsSelected = Collections.EMPTY_LIST;
if ((idRefsList != null) && !idRefsList.isEmpty()) {
idRefsSelected = new ArrayList(idRefsList.size());
for (Iterator iter = idRefsList.iterator(); iter.hasNext(); ) {
DescriptionType descType = (DescriptionType) iter.next();
List list = descType.getSecurityMechID();
idRefsSelected.add(list.get(0));
}
}
map.put(directiveName, idRefsSelected);
}
use of com.sun.identity.liberty.ws.disco.jaxb.DescriptionType in project OpenAM by OpenRock.
the class SMDiscoEntryData method createServiceInstanceEntry.
/**
* Returns <code>ServiceInstanceType</code> object.
*
* @return <code>ServiceInstanceType</code> object.
*/
private ServiceInstanceType createServiceInstanceEntry() throws JAXBException {
ServiceInstanceType svc = discoFac.createServiceInstanceType();
svc.setProviderID(providerId);
svc.setServiceType(serviceType);
List descriptionTypeList = (List) svc.getDescription();
for (Iterator iter = descData.iterator(); iter.hasNext(); ) {
DescriptionType dType = createDescriptionEntry((SMDescriptionData) iter.next());
descriptionTypeList.add(dType);
}
return svc;
}
use of com.sun.identity.liberty.ws.disco.jaxb.DescriptionType in project OpenAM by OpenRock.
the class SMDiscoEntryData method createDescriptionEntry.
private DescriptionType createDescriptionEntry(SMDescriptionData smDesc) throws JAXBException {
DescriptionType description = discoFac.createDescriptionType();
description.setId(smDesc.descriptionID);
List ids = smDesc.securityMechId;
if ((ids != null) && !ids.isEmpty()) {
description.getSecurityMechID().addAll(ids);
}
if (smDesc.isBriefSoapHttp) {
String soapAction = smDesc.soapAction;
if ((soapAction != null) && soapAction.trim().length() > 0) {
description.setSoapAction(soapAction);
}
description.setEndpoint(smDesc.endPointUrl);
} else {
QName q = new QName(smDesc.nameSpace, smDesc.localPart);
description.setServiceNameRef(q);
description.setWsdlURI(smDesc.wsdlUri);
}
return description;
}
Aggregations