

package org.kaaproject.kaa.client.channel;

import org.kaaproject.kaa.client.logging.LogProcessor;
import org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest;
import org.kaaproject.kaa.common.endpoint.gen.LogSyncResponse;

/**
 * {@link KaaTransport} for the Logging service.
 * Used for sending logs to the remote server.
 *
 * @author Yaroslav Zeygerman
 *
 */
public interface LogTransport extends KaaTransport {

    /**
     * Creates the Log request that consists of current log records.
     *
     * @return new Log request
     * @see LogSyncRequest
     *
     */
    LogSyncRequest createLogRequest();

    /**
     * Updates the state of the Log collector according to the given response.
     *
     * @param response the response from the server.
     * @see LogSyncResponse
     *
     */
    void onLogResponse(LogSyncResponse response);

    /**
     * Sets the given Log processor.
     *
     * @param processor the Log processor to be set.
     *
     */
    void setLogProcessor(LogProcessor processor);

}
