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

com.github.jcustenborder.netty.syslog.SyslogRequest Maven / Gradle / Ivy

/**
 * Copyright © 2018 Jeremy Custenborder ([email protected])
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.jcustenborder.netty.syslog;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.immutables.value.Value;

import java.net.InetAddress;
import java.time.LocalDateTime;

/**
 * Interface represents an incoming syslog request. This interface acts as an intermediary between
 * the TCPSyslogMessageDecoder and UDPSyslogMessageDecoder
 *
 * @see TCPSyslogMessageDecoder
 * @see UDPSyslogMessageDecoder
 */
@Value.Immutable
@Value.Style(visibility = Value.Style.ImplementationVisibility.PACKAGE)
@JsonSerialize(as = ImmutableSyslogRequest.class)
@JsonDeserialize(as = ImmutableSyslogRequest.class)
public interface SyslogRequest {
  /**
   * The time the message was received by Netty.
   *
   * @return The time the message was received by Netty.
   */
  @JsonProperty(required = true)
  LocalDateTime receivedDate();

  /**
   * IP Address for the sender of the message.
   *
   * @return Sender IP Address
   */
  @JsonProperty(required = true)
  InetAddress remoteAddress();

  /**
   * The raw message that was delivered
   *
   * @return Raw message.
   */
  @JsonProperty(required = true)
  String rawMessage();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy