Search in sources :

Example 1 with AMClientCapData

use of com.iplanet.services.cdm.clientschema.AMClientCapData in project OpenAM by OpenRock.

the class MAPCreateDeviceModelImpl method getReqAttributeSchemas.

private Set getReqAttributeSchemas() {
    Set required = null;
    AMClientCapData ccd = getClientCapDataExtInstance();
    if (ccd != null) {
        Set names = AMClientCapData.getSchemaElements();
        if ((names != null) && !names.isEmpty()) {
            required = getAttributeSchemas(names);
            for (Iterator iter = required.iterator(); iter.hasNext(); ) {
                AttributeSchema as = (AttributeSchema) iter.next();
                String any = as.getAny();
                if ((any == null) || (any.indexOf(AMAdminConstants.REQUIRED_ATTRIBUTE) == -1)) {
                    iter.remove();
                }
            }
        }
    }
    return (required == null) ? Collections.EMPTY_SET : required;
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) AMClientCapData(com.iplanet.services.cdm.clientschema.AMClientCapData) Iterator(java.util.Iterator) AttributeSchema(com.sun.identity.sm.AttributeSchema)

Example 2 with AMClientCapData

use of com.iplanet.services.cdm.clientschema.AMClientCapData in project OpenAM by OpenRock.

the class MAPCreateDeviceModelImpl method getCloningProperties.

private Map getCloningProperties(String clientType) {
    AMClientCapData ccd = getClientCapDataIntInstance();
    Map iMap = ccd.getProperties(clientType);
    AMClientCapData eCD = getClientCapDataExtInstance();
    Map eMap = eCD.getProperties(clientType);
    Map merged = null;
    if (iMap != null) {
        merged = iMap;
        if (eMap != null) {
            merged.putAll(eMap);
        }
    } else if (eMap != null) {
        merged = eMap;
    }
    return merged;
}
Also used : AMClientCapData(com.iplanet.services.cdm.clientschema.AMClientCapData) HashMap(java.util.HashMap) Map(java.util.Map)

Example 3 with AMClientCapData

use of com.iplanet.services.cdm.clientschema.AMClientCapData in project OpenAM by OpenRock.

the class MAPDeviceProfileModelImpl method getAttributeNames.

private Set getAttributeNames(String clientType, String classification) {
    Set names = null;
    AMClientCapData ccd = getClientCapDataInstance(clientType);
    if (ccd != null) {
        names = ccd.getPropertyNames(classification);
    }
    return (names == null) ? Collections.EMPTY_SET : names;
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) AMClientCapData(com.iplanet.services.cdm.clientschema.AMClientCapData)

Example 4 with AMClientCapData

use of com.iplanet.services.cdm.clientschema.AMClientCapData in project OpenAM by OpenRock.

the class MAPModelBase method getDeviceUserAgent.

/**
     * Returns device user agent of a client.
     *
     * @param clientType Client Type.
     * @return device user agent of a client.
     */
public String getDeviceUserAgent(String clientType) {
    String value = null;
    AMClientCapData ccd = getClientCapDataInstance(clientType);
    Map map = ccd.getProperties(clientType);
    if (map != null) {
        value = (String) AMAdminUtils.getValue((Set) map.get(ATTRIBUTE_NAME_USER_AGENT));
    }
    return value;
}
Also used : AMClientCapData(com.iplanet.services.cdm.clientschema.AMClientCapData) Map(java.util.Map)

Example 5 with AMClientCapData

use of com.iplanet.services.cdm.clientschema.AMClientCapData in project OpenAM by OpenRock.

the class MAPCreateDeviceModelImpl method getAttributeSchema.

private AttributeSchema getAttributeSchema(String name) {
    AttributeSchema as = null;
    AMClientCapData internalInstance = getClientCapDataIntInstance();
    AMClientCapData externalInstance = getClientCapDataExtInstance();
    if ((internalInstance != null) && (externalInstance != null)) {
        as = internalInstance.getAttributeSchema(name);
        if (as == null) {
            as = externalInstance.getAttributeSchema(name);
        }
        if (as != null) {
            String i18nKey = as.getI18NKey();
            if ((i18nKey == null) || (i18nKey.length() == 0)) {
                as = null;
            }
        }
    }
    return as;
}
Also used : AMClientCapData(com.iplanet.services.cdm.clientschema.AMClientCapData) AttributeSchema(com.sun.identity.sm.AttributeSchema)

Aggregations

AMClientCapData (com.iplanet.services.cdm.clientschema.AMClientCapData)6 Map (java.util.Map)3 AttributeSchema (com.sun.identity.sm.AttributeSchema)2 HashSet (java.util.HashSet)2 Set (java.util.Set)2 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1