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

com.github.rahulsom.grooves.queries.TemporalJoinSupport Maven / Gradle / Ivy

package com.github.rahulsom.grooves.queries;

import com.github.rahulsom.grooves.api.AggregateType;
import com.github.rahulsom.grooves.api.events.BaseEvent;
import com.github.rahulsom.grooves.api.events.DisjoinEvent;
import com.github.rahulsom.grooves.api.events.JoinEvent;
import com.github.rahulsom.grooves.api.snapshots.TemporalJoin;
import com.github.rahulsom.grooves.queries.internal.BaseQuery;
import com.github.rahulsom.grooves.queries.internal.Executor;
import com.github.rahulsom.grooves.queries.internal.JoinExecutor;

/**
 * Default interface that makes temporal joins easier to write.
 *
 * @param        The type of {@link AggregateT}'s id
 * @param          The Aggregate this join represents
 * @param            The type for the {@link EventT}'s id field
 * @param              The base type for events that apply to {@link AggregateT}
 * @param  The type for the other id of aggregate that {@link AggregateT} joins
 *                             to
 * @param    The type for the other aggregate that {@link AggregateT} joins to
 * @param         The type for the join's id field
 * @param           The type of Snapshot that is computed
 * @param          The type of the Join Event
 * @param       The type of the disjoin event
 * @param              A reference to the query type. Typically a self reference.
 *
 * @author Rahul Somasunderam
 */
public interface TemporalJoinSupport<
        AggregateIdT,
        AggregateT extends AggregateType,
        EventIdT,
        EventT extends BaseEvent,
        JoinedAggregateIdT,
        JoinedAggregateT extends AggregateType,
        SnapshotIdT,
        SnapshotT extends TemporalJoin,
        JoinEventT extends JoinEvent,
        DisjoinEventT extends DisjoinEvent,
        QueryT extends BaseQuery
        > extends
        TemporalQuerySupport {

    Class getJoinEventClass();

    Class getDisjoinEventClass();

    @Override
    default Executor getExecutor() {
        return new JoinExecutor(getJoinEventClass(), getDisjoinEventClass());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy