Search in sources :

Example 1 with DescriptionType

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;
}
Also used : DescriptionType(com.sun.identity.liberty.ws.disco.jaxb.DescriptionType) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) List(java.util.List)

Example 2 with DescriptionType

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);
}
Also used : DescriptionType(com.sun.identity.liberty.ws.disco.jaxb.DescriptionType) Iterator(java.util.Iterator) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 3 with DescriptionType

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);
}
Also used : DescriptionType(com.sun.identity.liberty.ws.disco.jaxb.DescriptionType) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) List(java.util.List)

Example 4 with DescriptionType

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;
}
Also used : ServiceInstanceType(com.sun.identity.liberty.ws.disco.jaxb.ServiceInstanceType) DescriptionType(com.sun.identity.liberty.ws.disco.jaxb.DescriptionType) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) List(java.util.List)

Example 5 with DescriptionType

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;
}
Also used : DescriptionType(com.sun.identity.liberty.ws.disco.jaxb.DescriptionType) QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

DescriptionType (com.sun.identity.liberty.ws.disco.jaxb.DescriptionType)6 ArrayList (java.util.ArrayList)5 Iterator (java.util.Iterator)5 List (java.util.List)5 ServiceInstanceType (com.sun.identity.liberty.ws.disco.jaxb.ServiceInstanceType)2 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)1 OptionsType (com.sun.identity.liberty.ws.disco.jaxb.OptionsType)1 ResourceIDType (com.sun.identity.liberty.ws.disco.jaxb.ResourceIDType)1 ResourceOfferingType (com.sun.identity.liberty.ws.disco.jaxb.ResourceOfferingType)1 QName (javax.xml.namespace.QName)1