use of com.sequenceiq.cloudbreak.domain.Network in project cloudbreak by hortonworks.
the class NetworkService method delete.
public void delete(String name, IdentityUser user) {
LOGGER.info("Deleting network with name: {}", name);
Network network = networkRepository.findByNameInAccount(name, user.getAccount());
if (network == null) {
throw new NotFoundException(String.format("Network '%s' not found.", name));
}
delete(network);
}
use of com.sequenceiq.cloudbreak.domain.Network in project cloudbreak by hortonworks.
the class NetworkController method getPrivate.
@Override
public NetworkResponse getPrivate(String name) {
IdentityUser user = authenticatedUserService.getCbUser();
Network network = networkService.getPrivateNetwork(name, user);
return convert(network);
}
use of com.sequenceiq.cloudbreak.domain.Network in project cloudbreak by hortonworks.
the class NetworkController method getPrivates.
@Override
public Set<NetworkResponse> getPrivates() {
IdentityUser user = authenticatedUserService.getCbUser();
Set<Network> networks = networkService.retrievePrivateNetworks(user);
return convert(networks);
}
use of com.sequenceiq.cloudbreak.domain.Network in project cloudbreak by hortonworks.
the class NetworkController method getPublics.
@Override
public Set<NetworkResponse> getPublics() {
IdentityUser user = authenticatedUserService.getCbUser();
Set<Network> networks = networkService.retrieveAccountNetworks(user);
return convert(networks);
}
use of com.sequenceiq.cloudbreak.domain.Network in project cloudbreak by hortonworks.
the class NetworkService method get.
public Network get(Long id) {
Network network = getById(id);
authorizationService.hasReadPermission(network);
return network;
}
Aggregations