Search in sources :

Example 11 with IdentityUser

use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.

the class BlueprintController method getPrivates.

@Override
public Set<BlueprintResponse> getPrivates() {
    IdentityUser user = authenticatedUserService.getCbUser();
    Set<Blueprint> blueprints = blueprintService.retrievePrivateBlueprints(user);
    return getBlueprintResponses(user, blueprints);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) Blueprint(com.sequenceiq.cloudbreak.domain.Blueprint)

Example 12 with IdentityUser

use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.

the class BlueprintController method getPublic.

@Override
public BlueprintResponse getPublic(String name) {
    IdentityUser user = authenticatedUserService.getCbUser();
    Blueprint blueprint = blueprintService.getPublicBlueprint(name, user);
    return conversionService.convert(blueprint, BlueprintResponse.class);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) Blueprint(com.sequenceiq.cloudbreak.domain.Blueprint)

Example 13 with IdentityUser

use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.

the class BlueprintController method getPrivate.

@Override
public BlueprintResponse getPrivate(String name) {
    IdentityUser user = authenticatedUserService.getCbUser();
    Blueprint blueprint = blueprintService.getPrivateBlueprint(name, user);
    return conversionService.convert(blueprint, BlueprintResponse.class);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) Blueprint(com.sequenceiq.cloudbreak.domain.Blueprint)

Example 14 with IdentityUser

use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.

the class CloudbreakEventController method getStructuredEventsForStack.

private List<StructuredEvent> getStructuredEventsForStack(Long stackId) {
    IdentityUser identityUser = authenticatedUserService.getCbUser();
    Map<String, Long> resourceIds = Maps.newHashMap();
    resourceIds.put("STACK", stackId);
    resourceIds.put("stacks", stackId);
    return structuredEventService.getEventsForUser(identityUser.getUserId(), Arrays.asList("REST", "FLOW", "NOTIFICATION"), resourceIds);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser)

Example 15 with IdentityUser

use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.

the class CloudbreakUsageController method getAccount.

@Override
public List<CloudbreakUsageJson> getAccount(Long since, Long filterEndDate, String userId, String cloud, String zone) {
    IdentityUser user = authenticatedUserService.getCbUser();
    CbUsageFilterParameters params = new Builder().setAccount(user.getAccount()).setOwner(userId).setSince(since).setCloud(cloud).setRegion(zone).setFilterEndDate(filterEndDate).build();
    return cloudbreakUsagesFacade.getUsagesFor(params);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) CbUsageFilterParameters(com.sequenceiq.cloudbreak.domain.CbUsageFilterParameters) Builder(com.sequenceiq.cloudbreak.domain.CbUsageFilterParameters.Builder)

Aggregations

IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)133 Test (org.junit.Test)14 Stack (com.sequenceiq.cloudbreak.domain.Stack)13 UserFilterField (com.sequenceiq.cloudbreak.common.service.user.UserFilterField)9 Async (org.springframework.scheduling.annotation.Async)9 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)8 Credential (com.sequenceiq.cloudbreak.domain.Credential)8 FlexSubscription (com.sequenceiq.cloudbreak.domain.FlexSubscription)8 Cluster (com.sequenceiq.cloudbreak.domain.Cluster)7 LdapConfig (com.sequenceiq.cloudbreak.domain.LdapConfig)7 ProxyConfig (com.sequenceiq.cloudbreak.domain.ProxyConfig)7 ImageCatalog (com.sequenceiq.cloudbreak.domain.ImageCatalog)6 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)6 Before (org.junit.Before)6 TestingAuthenticationToken (org.springframework.security.authentication.TestingAuthenticationToken)6 UpdateStackJson (com.sequenceiq.cloudbreak.api.model.UpdateStackJson)5 Template (com.sequenceiq.cloudbreak.domain.Template)5 ConstraintTemplate (com.sequenceiq.cloudbreak.domain.ConstraintTemplate)4 Network (com.sequenceiq.cloudbreak.domain.Network)4 Recipe (com.sequenceiq.cloudbreak.domain.Recipe)4