All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zalando.nakadiproducer.snapshots.impl.SnapshotEventCreationEndpoint Maven / Gradle / Ivy

There is a newer version: 30.0.0-RC1
Show newest version
package org.zalando.nakadiproducer.snapshots.impl;

import java.util.Set;

import org.springframework.boot.actuate.endpoint.AbstractEndpoint;
import org.springframework.boot.context.properties.ConfigurationProperties;

import lombok.AllArgsConstructor;
import lombok.Getter;

@ConfigurationProperties("endpoints.snapshot-event-creation")
public class SnapshotEventCreationEndpoint extends AbstractEndpoint {
    private final SnapshotCreationService snapshotCreationService;

    public SnapshotEventCreationEndpoint(SnapshotCreationService snapshotCreationService) {
        super("snapshot_event_creation", true, true);
        this.snapshotCreationService = snapshotCreationService;
    }

    @Override
    public SnapshotReport invoke() {
        return new SnapshotReport(snapshotCreationService.getSupportedEventTypes());
    }

    public void invoke(String eventType, String filter) {
        snapshotCreationService.createSnapshotEvents(eventType, filter);
    }


    @AllArgsConstructor
    @Getter
    public static class SnapshotReport {
        private final Set supportedEventTypes;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy