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

net.smartcosmos.events.SmartCosmosEventRequest Maven / Gradle / Ivy

Go to download

Provides Spring Configuration and Annotations making it easier to develop SMART COSMOS Extensions

The newest version!
package net.smartcosmos.events;

import java.net.URI;

import lombok.Builder;
import lombok.Data;

import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.RequestEntity;

/**
 * @author voor
 */
@Data
@Builder
public class SmartCosmosEventRequest {
    private String serviceName;
    private String url;
    private SmartCosmosEvent event;
    private HttpMethod httpMethod;

    public RequestEntity> buildRequest() {
        HttpHeaders headers = new HttpHeaders();
        headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
        URI uri = URI.create("http://" + serviceName + "/" + url);
        return new RequestEntity<>(event, headers, httpMethod, uri);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy