public interface AssetTree
extends net.openhft.chronicle.core.io.Closeable
Modifier and Type | Interface and Description |
---|---|
static interface |
AssetTree.ClientBuilder |
Modifier and Type | Method and Description |
---|---|
default <K,V> @NotNull MapView<K,V> |
acquireMap(@NotNull String uri,
Class<K> kClass,
Class<V> vClass)
Acquire a map view for a URI.
|
default <E> @NotNull Publisher<E> |
acquirePublisher(@NotNull String uri,
Class<E> eClass)
Acquire a publisher to a single URI.
|
default <T,M> @NotNull QueueView<T,M> |
acquireQueue(@NotNull String uri,
Class<T> typeClass,
Class<M> messageClass) |
default <T,M> @NotNull QueueView<T,M> |
acquireQueue(@NotNull String uri,
Class<T> typeClass,
Class<M> messageClass,
String cluster) |
default <T,M> @NotNull QueueView<T,M> |
acquireQueue(@NotNull String uri,
Class<T> typeClass,
Class<M> messageClass,
String cluster,
String basePath) |
default <E> @NotNull Reference<E> |
acquireReference(@NotNull String uri,
Class<E> eClass)
Acquire a reference to a single URI
|
default <S> S |
acquireService(@NotNull String uri,
Class<S> serviceType)
Acquire a generic service by URI and serviceType.
|
default <E> @NotNull Set<E> |
acquireSet(@NotNull String uri,
Class<E> eClass)
Acquire a set view for a URI.
|
default @NotNull SubscriptionCollection |
acquireSubscription(@NotNull RequestContext requestContext)
Acquire the Subscription view for a URI.
|
default <T,M> @NotNull TopicPublisher<T,M> |
acquireTopicPublisher(@NotNull String uri,
Class<T> topicClass,
Class<M> messageClass)
Acquire a Topic Publisher view for a URI.
|
default <T,M> @NotNull TopicPublisher<T,M> |
acquireTopicPublisher(@NotNull String uri,
String basePath,
Class<T> topicClass,
Class<M> messageClass)
Acquire a Topic Publisher view for a URI.
|
default <V> V |
acquireView(@NotNull RequestContext requestContext)
Acquire a generic view by ResourceContext.
|
static @NotNull AssetTree.ClientBuilder |
clientBuilder()
Creates and returns a new AssetTreeBuilder that can
build a server AssetTree.
|
default @NotNull AssetTree |
disableManagement()
Disable JMX management of this Asset Tree
|
default @NotNull AssetTree |
enableManagement()
Enable JMX management of this Asset Tree
|
default @NotNull AssetTree |
enableManagement(int port)
Enable JMX management of this Asset Tree
|
default @Nullable SubscriptionCollection |
getSubscription(@NotNull RequestContext requestContext)
Get a Subscription view for a URI if ti exists.
|
default <E> void |
registerSubscriber(@NotNull String uri,
Class<E> eClass,
@NotNull Subscriber<? extends E> subscriber)
Register a subscriber to a URI with an expected type of message by class.
|
default <E> void |
registerSubscriber(@NotNull String uri,
String basePath,
Class<E> eClass,
@NotNull Subscriber<? super E> subscriber)
Register a subscriber to a URI with an expected type of message by class.
|
default <T,M> void |
registerTopicSubscriber(@NotNull String uri,
Class<T> topicClass,
Class<M> messageClass,
@NotNull TopicSubscriber<? extends T,? extends M> subscriber)
Register a topic subscriber to a URI with an expected type of message by topic class and
message class
|
default <T,M> void |
registerTopicSubscriber(@NotNull String uri,
@NotNull File baseFile,
Class<T> topicClass,
Class<M> messageClass,
@NotNull TopicSubscriber<? extends T,? extends M> subscriber)
Register a topic subscriber to a URI with an expected type of message by topic class and
message class
|
default <T,M> void |
registerTopicSubscriber(@NotNull String uri,
String basePath,
Class<T> topicClass,
Class<M> messageClass,
@NotNull TopicSubscriber<? extends T,? extends M> subscriber)
Register a topic subscriber to a URI with an expected type of message by topic class and
message class
|
@NotNull Asset |
root()
Returns the root asset.
|
default <E> void |
unregisterSubscriber(@NotNull String uri,
@NotNull Subscriber<? extends E> subscriber)
Remove a subscription.
|
default <T,M> void |
unregisterTopicSubscriber(@NotNull String uri,
@NotNull TopicSubscriber<? extends T,? extends M> subscriber)
Remove a topic subscription.
|
@NotNull AssetTreeStats |
usageStats() |
@NotNull @NotNull Asset root()
This gives an entry point to the entire asset Tress. This is useful for adding global rules for constructing views.
@NotNull default <E> @NotNull Set<E> acquireSet(@NotNull @NotNull String uri, Class<E> eClass)
E
- element typeuri
- to search foreClass
- element class.AssetNotFoundException
- the view could not be constructed.@NotNull default <K,V> @NotNull MapView<K,V> acquireMap(@NotNull @NotNull String uri, Class<K> kClass, Class<V> vClass)
K
- key type of the mapV
- value type of the mapuri
- to search forkClass
- key class of the map.vClass
- value class of the map.AssetNotFoundException
- if the view could not be constructed.@NotNull default <E> @NotNull Publisher<E> acquirePublisher(@NotNull @NotNull String uri, Class<E> eClass)
E
- element typeuri
- to search foreClass
- element class.AssetNotFoundException
- the view could not be constructed.@NotNull default <E> @NotNull Reference<E> acquireReference(@NotNull @NotNull String uri, Class<E> eClass)
E
- type of the state referenceduri
- to search foreClass
- class of the state referencedAssetNotFoundException
- the view could not be constructed.@NotNull default <T,M> @NotNull TopicPublisher<T,M> acquireTopicPublisher(@NotNull @NotNull String uri, Class<T> topicClass, Class<M> messageClass)
T
- topic typeM
- message typeuri
- to search fortopicClass
- class of topic descriptions e.g. String.class.messageClass
- class of messages to send on that topic.AssetNotFoundException
- the view could not be constructed.@NotNull default <T,M> @NotNull TopicPublisher<T,M> acquireTopicPublisher(@NotNull @NotNull String uri, String basePath, Class<T> topicClass, Class<M> messageClass)
T
- topic typeM
- message typeuri
- to search forbasePath
- the location the topic is pushed to on the file systemtopicClass
- class of topic descriptions e.g. String.class.messageClass
- class of messages to send on that topic.AssetNotFoundException
- the view could not be constructed.default <E> void registerSubscriber(@NotNull @NotNull String uri, Class<E> eClass, @NotNull @NotNull Subscriber<? extends E> subscriber)
E.g. if you subscribe to a type of String.class you get the keys which changed, if you subscribe to MapEvent.class you get all the changes to the map.
Any given instance of a subscriber must at most be registered once with a DataGrid instance at any given time.
This method is asynchronous and the provided subscriber will be eligible for receiving events as some later unspecified time.
E
- the type of event/message to subscribe touri
- of the asset to subscribe to.eClass
- the class of event/message to subscribe tosubscriber
- to notify which this type of message is sent.AssetNotFoundException
- the view could not be constructed.default <E> void registerSubscriber(@NotNull @NotNull String uri, String basePath, Class<E> eClass, @NotNull @NotNull Subscriber<? super E> subscriber)
E.g. if you subscribe to a type of String.class you get the keys which changed, if you subscribe to MapEvent.class you get all the changes to the map.
Any given instance of a subscriber must at most be registered once with a DataGrid instance at any given time.
This method is asynchronous and the provided subscriber will be eligible for receiving events as some later unspecified time.
E
- the type of event/message to subscribe touri
- of the asset to subscribe to.basePath
- the location the topic is pushed to on the file systemeClass
- the class of event/message to subscribe tosubscriber
- to notify which this type of message is sent.AssetNotFoundException
- the view could not be constructed.default <T,M> void registerTopicSubscriber(@NotNull @NotNull String uri, Class<T> topicClass, Class<M> messageClass, @NotNull @NotNull TopicSubscriber<? extends T,? extends M> subscriber)
Any given instance of a subscriber must at most be registered once with a DataGrid instance at any given time.
This method is asynchronous and the provided subscriber will be eligible for receiving events as some later unspecified time.
T
- topic typeM
- message typeuri
- of the asset to subscribe to.topicClass
- the type of topic to subscribe tomessageClass
- the type of event/message to subscribe tosubscriber
- to notify which this type of message is sent.AssetNotFoundException
- the view could not be constructed.default <T,M> void registerTopicSubscriber(@NotNull @NotNull String uri, String basePath, Class<T> topicClass, Class<M> messageClass, @NotNull @NotNull TopicSubscriber<? extends T,? extends M> subscriber)
Any given instance of a subscriber must at most be registered once with a DataGrid instance at any given time.
This method is asynchronous and the provided subscriber will be eligible for receiving events as some later unspecified time.
T
- topic typeM
- message typeuri
- of the asset to subscribe to.basePath
- the path the asset is stored totopicClass
- the type of topic to subscribe tomessageClass
- the type of event/message to subscribe tosubscriber
- to notify which this type of message is sent.AssetNotFoundException
- the view could not be constructed.default <T,M> void registerTopicSubscriber(@NotNull @NotNull String uri, @NotNull @NotNull File baseFile, Class<T> topicClass, Class<M> messageClass, @NotNull @NotNull TopicSubscriber<? extends T,? extends M> subscriber)
Any given instance of a subscriber must at most be registered once with a DataGrid instance at any given time.
This method is asynchronous and the provided subscriber will be eligible for receiving events as some later unspecified time.
T
- topic typeM
- message typeuri
- of the asset to subscribe to.baseFile
- the path the asset is stored totopicClass
- the type of topic to subscribe tomessageClass
- the type of event/message to subscribe tosubscriber
- to notify which this type of message is sent.AssetNotFoundException
- the view could not be constructed.@NotNull default @NotNull SubscriptionCollection acquireSubscription(@NotNull @NotNull RequestContext requestContext)
requestContext
- to find the subscriptionAssetNotFoundException
- the view could not be constructed.default <E> void unregisterSubscriber(@NotNull @NotNull String uri, @NotNull @NotNull Subscriber<? extends E> subscriber)
This method is asynchronous and the provided subscriber will be prevented from receiving events as some later unspecified time.
E
- element typeuri
- of the asset subscribed to.subscriber
- to removedefault <T,M> void unregisterTopicSubscriber(@NotNull @NotNull String uri, @NotNull @NotNull TopicSubscriber<? extends T,? extends M> subscriber)
This method is asynchronous and the provided subscriber will be prevented from receiving events as some later unspecified time.
T
- topic typeM
- message typeuri
- of the asset subscribed to.subscriber
- to removeAssetNotFoundException
- the asset could not be found@Nullable default @Nullable SubscriptionCollection getSubscription(@NotNull @NotNull RequestContext requestContext)
requestContext
- to find the subscriptionAssetNotFoundException
- the view could not be constructed.@NotNull default <S> S acquireService(@NotNull @NotNull String uri, Class<S> serviceType)
S
- service typeuri
- to search forserviceType
- type of the serviceAssetNotFoundException
- if not found, and could not be created.@NotNull default <V> V acquireView(@NotNull @NotNull RequestContext requestContext)
V
- view typerequestContext
- to use to search or create the view.AssetNotFoundException
- if the view could not be created.@NotNull default @NotNull AssetTree enableManagement()
@NotNull default @NotNull AssetTree enableManagement(int port)
port
- to enable a simple web service on@NotNull default @NotNull AssetTree disableManagement()
@NotNull @NotNull AssetTreeStats usageStats()
@NotNull default <T,M> @NotNull QueueView<T,M> acquireQueue(@NotNull @NotNull String uri, Class<T> typeClass, Class<M> messageClass)
@NotNull default <T,M> @NotNull QueueView<T,M> acquireQueue(@NotNull @NotNull String uri, Class<T> typeClass, Class<M> messageClass, String cluster)
@NotNull default <T,M> @NotNull QueueView<T,M> acquireQueue(@NotNull @NotNull String uri, Class<T> typeClass, Class<M> messageClass, String cluster, String basePath)
@NotNull static @NotNull AssetTree.ClientBuilder clientBuilder()
Copyright © 2021. All rights reserved.