use of com.iwave.ext.netapp.model.CifsAcl in project coprhd-controller by CoprHD.
the class NetAppApi method deleteCIFSShareAcl.
public Boolean deleteCIFSShareAcl(String shareName, List<CifsAcl> acls) throws NetAppException {
try {
if (netAppFacade == null) {
_logger.warn("Invalid Facade found {} creating now...", netAppFacade);
netAppFacade = new NetAppFacade(_ipAddress, _portNumber, _userName, _password, _https);
_logger.warn("Facade created : {} ", netAppFacade);
}
for (CifsAcl acl : acls) {
acl.setShareName(shareName);
netAppFacade.deleteCIFSAcl(acl);
}
} catch (Exception e) {
_logger.error("Error Occured {} ", e.getMessage(), e);
throw NetAppException.exceptions.deleteCIFSShareAclFailed(shareName, e.getMessage());
}
return true;
}
use of com.iwave.ext.netapp.model.CifsAcl in project coprhd-controller by CoprHD.
the class NetAppApi method listCIFSShareAcl.
public List<CifsAcl> listCIFSShareAcl(String ShareName) throws NetAppException {
try {
if (netAppFacade == null) {
_logger.warn("Invalid Facade found {} creating now...", netAppFacade);
netAppFacade = new NetAppFacade(_ipAddress, _portNumber, _userName, _password, _https);
_logger.warn("Facade created : {} ", netAppFacade);
}
List<CifsAcl> oldacls = netAppFacade.listCIFSAcls(ShareName);
return oldacls;
} catch (Exception e) {
_logger.error("Error Occured {} ", e.getMessage(), e);
throw NetAppException.exceptions.listCIFSShareAclFailed(ShareName, e.getMessage());
}
}
use of com.iwave.ext.netapp.model.CifsAcl in project coprhd-controller by CoprHD.
the class NetAppApi method modifyShare.
public Boolean modifyShare(String mntpath, String shareName, String comment, int maxusers, String permission, String forcegroup) throws NetAppException {
try {
netAppFacade = new NetAppFacade(_ipAddress, _portNumber, _userName, _password, _https, _vFilerName);
CifsAcl acl = new CifsAcl();
acl.setShareName(shareName);
acl.setAccess(CifsAccess.valueOfAccess(cifsPermissionMap.get(permission)));
acl.setUserName(CIFS_DEFAULT_GROUP);
netAppFacade.setCIFSAcl(acl);
return true;
} catch (Exception e) {
throw NetAppException.exceptions.modifyShareFailed(_ipAddress, e.getMessage());
}
}
use of com.iwave.ext.netapp.model.CifsAcl in project coprhd-controller by CoprHD.
the class NetAppApi method modifyCIFSShareAcl.
public Boolean modifyCIFSShareAcl(String shareName, List<CifsAcl> acls) throws NetAppException {
try {
if (netAppFacade == null) {
_logger.warn("Invalid Facade found {} creating now...", netAppFacade);
netAppFacade = new NetAppFacade(_ipAddress, _portNumber, _userName, _password, _https);
_logger.warn("Facade created : {} ", netAppFacade);
}
for (CifsAcl acl : acls) {
acl.setShareName(shareName);
netAppFacade.setCIFSAcl(acl);
}
} catch (Exception e) {
_logger.error("Error Occured {} ", e.getMessage(), e);
throw NetAppException.exceptions.modifyCifsShareAclFailed(shareName, e.getMessage());
}
return true;
}
use of com.iwave.ext.netapp.model.CifsAcl in project coprhd-controller by CoprHD.
the class NetAppFileStorageDevice method forceAddShareAcl.
private void forceAddShareAcl(NetAppApi nApi, String shareName, List<ShareACL> aclsToAdd) {
if (aclsToAdd == null || aclsToAdd.isEmpty()) {
return;
}
List<CifsAcl> acls = new ArrayList<CifsAcl>();
for (ShareACL newAcl : aclsToAdd) {
CifsAcl cif_new = new CifsAcl();
String domain = newAcl.getDomain();
String userOrGroup = newAcl.getGroup() == null ? newAcl.getUser() : newAcl.getGroup();
if (domain != null && !domain.isEmpty()) {
userOrGroup = domain + "\\" + userOrGroup;
}
// for netapp api user and group are same.and need to set only user
cif_new.setUserName(userOrGroup);
cif_new.setShareName(shareName);
cif_new.setAccess(getAccessEnum(newAcl.getPermission()));
acls.add(cif_new);
}
for (CifsAcl cifsAcl : acls) {
try {
List<CifsAcl> singleACL = new ArrayList<CifsAcl>();
singleACL.add(cifsAcl);
nApi.modifyCIFSShareAcl(shareName, singleACL);
} catch (Exception e) {
_log.error("NetAppFileStorageDevice:: Force add of ACL for user [" + cifsAcl.getUserName() + "] failed with an Exception", e);
}
}
}
Aggregations