Search in sources :

Example 1 with ProxyConfig

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;
}
Also used : ProxyConfig(com.sequenceiq.cloudbreak.domain.ProxyConfig)

Example 2 with 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;
}
Also used : Blueprint(com.sequenceiq.cloudbreak.domain.Blueprint) Cluster(com.sequenceiq.cloudbreak.domain.Cluster) ProxyConfig(com.sequenceiq.cloudbreak.domain.ProxyConfig) Stack(com.sequenceiq.cloudbreak.domain.Stack)

Example 3 with ProxyConfig

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);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) ProxyConfig(com.sequenceiq.cloudbreak.domain.ProxyConfig)

Example 4 with 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);
}
Also used : ProxyConfig(com.sequenceiq.cloudbreak.domain.ProxyConfig)

Example 5 with 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;
}
Also used : ProxyConfig(com.sequenceiq.cloudbreak.domain.ProxyConfig)

Aggregations

ProxyConfig (com.sequenceiq.cloudbreak.domain.ProxyConfig)19 IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)5 NotFoundException (com.sequenceiq.cloudbreak.controller.NotFoundException)5 Test (org.junit.Test)4 Cluster (com.sequenceiq.cloudbreak.domain.Cluster)2 ProxyConfigRequest (com.sequenceiq.cloudbreak.api.model.proxy.ProxyConfigRequest)1 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)1 Stack (com.sequenceiq.cloudbreak.domain.Stack)1 SaltPillarProperties (com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties)1 HashMap (java.util.HashMap)1 Transactional (javax.transaction.Transactional)1 Before (org.junit.Before)1