Search in sources :

Example 1 with UserAccount

use of com.emc.nas.vnxfile.xmlapi.UserAccount in project coprhd-controller by CoprHD.

the class VNXUserAccountsProcessor method processUserAccountList.

private void processUserAccountList(List<Object> userList, Map<String, Object> keyMap) throws VNXFilePluginException {
    Iterator<Object> iterator = userList.iterator();
    Map<String, String> userInfo = new HashMap<String, String>();
    if (iterator.hasNext()) {
        Status status = (Status) iterator.next();
        if (status.getMaxSeverity() == Severity.OK) {
            while (iterator.hasNext()) {
                UserAccount user = (UserAccount) iterator.next();
                userInfo.put(user.getUser(), user.getUid());
                _logger.debug("user name: {} ", user.getUser());
            }
            keyMap.put(VNXFileConstants.USER_INFO, userInfo);
        } else {
            throw new VNXFilePluginException("Fault response received from XMLAPI Server.", VNXFilePluginException.ERRORCODE_INVALID_RESPONSE);
        }
    }
}
Also used : Status(com.emc.nas.vnxfile.xmlapi.Status) HashMap(java.util.HashMap) VNXFilePluginException(com.emc.storageos.plugins.metering.vnxfile.VNXFilePluginException) UserAccount(com.emc.nas.vnxfile.xmlapi.UserAccount)

Aggregations

Status (com.emc.nas.vnxfile.xmlapi.Status)1 UserAccount (com.emc.nas.vnxfile.xmlapi.UserAccount)1 VNXFilePluginException (com.emc.storageos.plugins.metering.vnxfile.VNXFilePluginException)1 HashMap (java.util.HashMap)1