use of cz.metacentrum.perun.core.api.exceptions.ServicesPackageExistsException in project perun by CESNET.
the class ServicesManagerBlImpl method createServicesPackage.
public ServicesPackage createServicesPackage(PerunSession sess, ServicesPackage servicesPackage) throws InternalErrorException, ServicesPackageExistsException {
Utils.notNull(servicesPackage.getDescription(), "servicesPackage.getDescription()");
Utils.notNull(servicesPackage.getName(), "servicesPackage.getName()");
//check if servicesPackage with same name exists in perun
try {
ServicesPackage s = getServicesManagerImpl().getServicesPackageByName(sess, servicesPackage.getName());
throw new ServicesPackageExistsException(s);
} catch (ServicesPackageNotExistsException ex) {
/* OK */
}
getPerunBl().getAuditer().log(sess, "{} created.", servicesPackage);
return getServicesManagerImpl().createServicesPackage(sess, servicesPackage);
}
Aggregations