use of io.hops.hopsworks.persistence.entity.remote.group.RemoteGroupProjectMapping in project hopsworks by logicalclocks.
the class ConfigureLdap method submit.
public void submit() {
Project project1;
try {
project1 = projectController.findProjectByName(this.project);
} catch (ProjectException e) {
String msg = e.getUsrMsg() != null ? e.getUsrMsg() : e.getErrorCode().getMessage();
MessagesController.addErrorMessage("Project not found: ", msg);
return;
}
for (String group : this.ldapGroups.getTarget()) {
RemoteGroupProjectMapping lgpm = remoteGroupProjectMappingFacade.findByGroupAndProject(group, project1);
if (lgpm != null) {
MessagesController.addErrorMessage("Mapping: ", group + " to " + this.project + " already exists.");
continue;
}
ldapConfigHelper.getLdapHelper().addNewGroupProjectMapping(new RemoteGroupProjectMapping(group, project1, this.project_role));
}
this.remoteGroupProjectMappings = remoteGroupProjectMappingFacade.findAll();
MessagesController.addInfoMessage("Mappings added: ", this.ldapGroups.getTarget().toString() + " to " + this.project);
}
use of io.hops.hopsworks.persistence.entity.remote.group.RemoteGroupProjectMapping in project hopsworks by logicalclocks.
the class ConfigureLdap method onRowEdit.
public void onRowEdit(RowEditEvent event) {
try {
RemoteGroupProjectMapping mapping = (RemoteGroupProjectMapping) event.getObject();
remoteGroupProjectMappingFacade.update(mapping);
this.remoteGroupProjectMappings = remoteGroupProjectMappingFacade.findAll();
MessagesController.addInfoMessage("Mapping edited.");
} catch (Exception e) {
MessagesController.addErrorMessage(e.getMessage());
}
}
Aggregations