Package com.sequenceiq.cloudbreak.service.cluster.event

Examples of com.sequenceiq.cloudbreak.service.cluster.event.ClusterCreationFailure


    @Autowired
    private AmbariClusterInstallerMailSenderService ambariClusterInstallerMailSenderService;

    @Override
    public void accept(Event<ClusterCreationFailure> event) {
        ClusterCreationFailure clusterCreationFailure = event.getData();
        Long clusterId = clusterCreationFailure.getClusterId();
        Cluster cluster = clusterRepository.findById(clusterId);
        MDCBuilder.buildMdcContext(cluster);
        LOGGER.info("Accepted {} event.", ReactorConfig.CLUSTER_CREATE_FAILED_EVENT, clusterId);
        String detailedMessage = clusterCreationFailure.getDetailedMessage();
        cluster.setStatus(Status.CREATE_FAILED);
        cluster.setStatusReason(detailedMessage);
        clusterRepository.save(cluster);
        if (cluster.getEmailNeeded()) {
            ambariClusterInstallerMailSenderService.sendFailEmail(cluster.getOwner());
View Full Code Here


    @Before
    public void setUp() {
        underTest = new ClusterCreationFailureHandler();
        MockitoAnnotations.initMocks(this);
        clusterCreationFailure = new ClusterCreationFailure(1L, "dummyMessage");
        event = new Event<>(clusterCreationFailure);
        cluster = new Cluster();
        cluster.setEmailNeeded(false);
        cluster.setOwner("dummy@myemail.com");
        cluster.setAccount("myaccount");
View Full Code Here

    }

    private void clusterCreateFailed(Cluster cluster, String message) {
        MDCBuilder.buildMdcContext(cluster);
        LOGGER.info("Publishing {} event", ReactorConfig.CLUSTER_CREATE_FAILED_EVENT);
        reactor.notify(ReactorConfig.CLUSTER_CREATE_FAILED_EVENT, Event.wrap(new ClusterCreationFailure(cluster.getId(), message)));
    }
View Full Code Here

TOP

Related Classes of com.sequenceiq.cloudbreak.service.cluster.event.ClusterCreationFailure

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.