Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,4 @@ public interface ReadModelCapability<DOMAIN_EVENT_TYPE> {

<T> T read ( Class<? extends ReadModelWithMetaData<? extends DOMAIN_EVENT_TYPE>> readModelClass, Object... params );

// TODO how to hide these from other clients than the Dashboard?

<T> T readUnbounded ( Class<? extends ReadModelWithMetaData<? extends DOMAIN_EVENT_TYPE>> readModelClass, Tracing tracing, Object... params );

<T> T readUnbounded ( Class<? extends ReadModelWithMetaData<? extends DOMAIN_EVENT_TYPE>> readModelClass, Object... params );

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Sliceworkz Event Modeling - an opinionated Event Modeling framework in Java
* Copyright © 2025 Sliceworkz / XTi (info@sliceworkz.org)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.sliceworkz.eventmodeling.readmodels;

import org.sliceworkz.eventmodeling.events.Tracing;

/**
* Capability for reading models across all event streams, regardless of bounded context boundaries.
* <p>
* This is intended for internal dashboard and monitoring use only.
* Application developers should use {@link ReadModelCapability#read} instead,
* which scopes queries to the bounded context's own domain event stream.
* <p>
* To use this capability, define a custom bounded context interface that explicitly
* extends this interface:
* <pre>{@code
* interface DashboardContext extends CQRSCapabilities<MyEvent>, UnboundedReadModelCapability<MyEvent> {}
* }</pre>
*/
public interface UnboundedReadModelCapability<DOMAIN_EVENT_TYPE> {

<T> T readUnbounded ( Class<? extends ReadModelWithMetaData<? extends DOMAIN_EVENT_TYPE>> readModelClass, Tracing tracing, Object... params );

<T> T readUnbounded ( Class<? extends ReadModelWithMetaData<? extends DOMAIN_EVENT_TYPE>> readModelClass, Object... params );

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.sliceworkz.eventmodeling.module.outbound.OutboundModule;
import org.sliceworkz.eventmodeling.module.readmodels.ReadModelModule;
import org.sliceworkz.eventmodeling.readmodels.ReadModelWithMetaData;
import org.sliceworkz.eventmodeling.readmodels.UnboundedReadModelCapability;
import org.sliceworkz.eventmodeling.slices.FeatureSliceConfiguration;
import org.sliceworkz.eventstore.events.EphemeralEvent;
import org.sliceworkz.eventstore.events.Event;
Expand All @@ -52,7 +53,7 @@
import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.MeterRegistry;

public class BoundedContextImpl<DOMAIN_EVENT_TYPE,INBOUND_EVENT_TYPE,OUTBOUND_EVENT_TYPE> implements AllCapabilities<DOMAIN_EVENT_TYPE, INBOUND_EVENT_TYPE, OUTBOUND_EVENT_TYPE>, ConsistentEventProcessor<DOMAIN_EVENT_TYPE> {
public class BoundedContextImpl<DOMAIN_EVENT_TYPE,INBOUND_EVENT_TYPE,OUTBOUND_EVENT_TYPE> implements AllCapabilities<DOMAIN_EVENT_TYPE, INBOUND_EVENT_TYPE, OUTBOUND_EVENT_TYPE>, UnboundedReadModelCapability<DOMAIN_EVENT_TYPE>, ConsistentEventProcessor<DOMAIN_EVENT_TYPE> {

private static final Logger LOGGER = LoggerFactory.getLogger(BoundedContextImpl.class);

Expand Down