use of com.sequenceiq.cloudbreak.domain.ProxyConfig in project cloudbreak by hortonworks.
the class ProxyConfigMapperImpl method mapRequestToEntity.
@Override
public ProxyConfig mapRequestToEntity(ProxyConfigRequest proxyConfigRequest, boolean publicInAccount) {
if (proxyConfigRequest == null) {
return null;
}
ProxyConfig proxyConfig = new ProxyConfig();
if (proxyConfigRequest != null) {
proxyConfig.setName(proxyConfigRequest.getName());
proxyConfig.setServerHost(proxyConfigRequest.getServerHost());
proxyConfig.setServerPort(proxyConfigRequest.getServerPort());
proxyConfig.setProtocol(proxyConfigRequest.getProtocol());
proxyConfig.setUserName(proxyConfigRequest.getUserName());
proxyConfig.setPassword(proxyConfigRequest.getPassword());
proxyConfig.setDescription(proxyConfigRequest.getDescription());
}
proxyConfig.setPublicInAccount(publicInAccount);
return proxyConfig;
}
use of com.sequenceiq.cloudbreak.domain.ProxyConfig in project cloudbreak by hortonworks.
the class ClusterToClusterResponseConverterTest method createSource.
@Override
public Cluster createSource() {
Stack stack = TestUtil.stack();
Blueprint blueprint = TestUtil.blueprint();
Cluster cluster = TestUtil.cluster(blueprint, stack, 1L);
ProxyConfig proxyConfig = new ProxyConfig();
proxyConfig.setName("test");
cluster.setProxyConfig(proxyConfig);
stack.setCluster(cluster);
return cluster;
}
use of com.sequenceiq.cloudbreak.domain.ProxyConfig in project cloudbreak by hortonworks.
the class ProxyConfigController method getPrivate.
@Override
public ProxyConfigResponse getPrivate(String name) {
IdentityUser user = authenticatedUserService.getCbUser();
ProxyConfig proxyConfig = proxyConfigService.getPrivateProxyConfig(name, user);
return proxyConfigMapper.mapEntityToResponse(proxyConfig);
}
use of com.sequenceiq.cloudbreak.domain.ProxyConfig in project cloudbreak by hortonworks.
the class ProxyConfigController method createProxyConfig.
private ProxyConfigResponse createProxyConfig(IdentityUser user, ProxyConfigRequest request, boolean publicInAccount) {
ProxyConfig proxyConfig = proxyConfigMapper.mapRequestToEntity(request, publicInAccount);
proxyConfig = proxyConfigService.create(user, proxyConfig);
notify(user, ResourceEvent.PROXY_CONFIG_CREATED);
return proxyConfigMapper.mapEntityToResponse(proxyConfig);
}
use of com.sequenceiq.cloudbreak.domain.ProxyConfig in project cloudbreak by hortonworks.
the class ClusterProxyDecorator method prepareProxyConfig.
public Cluster prepareProxyConfig(Cluster subject, IdentityUser user, String proxyName, Stack stack) {
if (StringUtils.isNotBlank(proxyName)) {
ProxyConfig proxyConfig = proxyConfigService.getPublicProxyConfig(proxyName, user);
subject.setProxyConfig(proxyConfig);
}
return subject;
}
Aggregations