use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.
the class FlexSubscriptionController method createFlexSubscription.
private FlexSubscriptionResponse createFlexSubscription(FlexSubscriptionRequest json, boolean publicInAccount) {
IdentityUser identityUser = authenticatedUserService.getCbUser();
FlexSubscription subscription = toFlexSubscriptionConverter.convert(json);
subscription.setAccount(identityUser.getAccount());
subscription.setOwner(identityUser.getUserId());
subscription.setPublicInAccount(publicInAccount);
subscription = flexService.create(subscription);
return toJsonConverter.convert(subscription);
}
use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.
the class FlexSubscriptionController method setDefaultInAccount.
@Override
public void setDefaultInAccount(String name) {
IdentityUser identityUser = authenticatedUserService.getCbUser();
flexService.setDefaultFlexSubscription(name, identityUser);
}
use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.
the class FlexSubscriptionController method getPrivates.
@Override
public List<FlexSubscriptionResponse> getPrivates() {
IdentityUser identityUser = authenticatedUserService.getCbUser();
List<FlexSubscription> subscriptions = flexService.findByOwner(identityUser.getUserId());
return toJsonConverter.convert(subscriptions);
}
use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.
the class FlexSubscriptionController method setDefaultInAccount.
@Override
public void setDefaultInAccount(Long id) {
IdentityUser identityUser = authenticatedUserService.getCbUser();
FlexSubscription flexSubscription = flexService.findOneById(id);
flexService.setDefaultFlexSubscription(flexSubscription.getName(), identityUser);
}
use of com.sequenceiq.cloudbreak.common.model.user.IdentityUser in project cloudbreak by hortonworks.
the class FlexSubscriptionController method getPublics.
@Override
public List<FlexSubscriptionResponse> getPublics() {
IdentityUser identityUser = authenticatedUserService.getCbUser();
List<FlexSubscription> subscriptions = flexService.findPublicInAccountForUser(identityUser);
return toJsonConverter.convert(subscriptions);
}
Aggregations