Search in sources :

Example 11 with NFSShareACL

use of com.emc.storageos.db.client.model.NFSShareACL in project coprhd-controller by CoprHD.

the class NfsACLUtility method verifyNfsACLs.

/**
 * This function verify the NfsACLUpdateParams data provided by user to set ACL is valid or not
 * it throw exception for invalid NfsACLUpdateParams data
 *
 * @param param : input ACLs to be updated.
 */
public void verifyNfsACLs(NfsACLUpdateParams param) {
    List<NfsACE> addList = param.getAcesToAdd();
    List<NfsACE> modifyList = param.getAcesToModify();
    List<NfsACE> deleteList = param.getAcesToDelete();
    List<NFSShareACL> dbACLList = queryDBSFileNfsACLs(false);
    Set<String> userSetDB = new HashSet<String>();
    for (NFSShareACL dbAcl : dbACLList) {
        userSetDB.add(dbAcl.getUser());
    }
    if (addList != null && !addList.isEmpty()) {
        verifyNfsACLsAddList(addList, userSetDB);
    }
    if (modifyList != null && !modifyList.isEmpty()) {
        verifyNfsACLsModifyOrDeleteList(modifyList, userSetDB);
    }
    if (deleteList != null && !deleteList.isEmpty()) {
        verifyNfsACLsModifyOrDeleteList(deleteList, userSetDB);
    }
}
Also used : NfsACE(com.emc.storageos.model.file.NfsACE) NFSShareACL(com.emc.storageos.db.client.model.NFSShareACL) HashSet(java.util.HashSet)

Aggregations

NFSShareACL (com.emc.storageos.db.client.model.NFSShareACL)11 NfsACE (com.emc.storageos.model.file.NfsACE)6 ArrayList (java.util.ArrayList)6 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)5 ContainmentConstraint (com.emc.storageos.db.client.constraint.ContainmentConstraint)4 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)4 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)4 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)3 ControllerException (com.emc.storageos.volumecontroller.ControllerException)3 WorkflowException (com.emc.storageos.workflow.WorkflowException)3 URISyntaxException (java.net.URISyntaxException)3 HashMap (java.util.HashMap)3 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)2 FileShare (com.emc.storageos.db.client.model.FileShare)2 StoragePool (com.emc.storageos.db.client.model.StoragePool)2 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)2 UnManagedNFSShareACL (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedNFSShareACL)2 URI (java.net.URI)2 List (java.util.List)2 AlternateIdConstraint (com.emc.storageos.db.client.constraint.AlternateIdConstraint)1