Class EAbstractHistoricFeed.Builder<T extends EObject,​F extends EAbstractHistoricFeed<T>,​B extends EAbstractHistoricFeed.Builder<T,​F,​?>>

    • Field Detail

      • sFeedIndex

        protected static final AtomicInteger sFeedIndex
        Incremented when a new historic feed is created.
      • mOwner

        protected final T extends EObject mOwner
        This historic notification hybrid object feed works for this owner.
      • mFeedClass

        protected final Class<F extends EAbstractHistoricFeed<T>> mFeedClass
        Historic feed class being built. Used only when throwing a validation exception.
      • mKey

        protected final EMessageKey mKey
        Notification message key.
      • mStatusKey

        protected final EMessageKey mStatusKey
        PublishStatusEvent message key.
      • mRequestKey

        protected final EMessageKey mRequestKey
        Historic notification request key.
      • mName

        protected String mName
        eBus object name. If not defined, then set to a default value based on owner name and message key.
      • mScope

        protected EFeed.FeedScope mScope
        Notification and reply feed scope.
    • Constructor Detail

      • Builder

        protected Builder​(T owner,
                          Class<F> feedClass,
                          EMessageKey key)
        Initializes historic feed abstract elements with the given parameters. Sets message store based on the message key.
        Parameters:
        owner - eBus object owning this historic notification feed.
        feedClass -
        key - stores and retrieves messages for this class.
    • Method Detail

      • self

        protected abstract B self()
        Returns subclass builder this reference.
        Returns:
        subclass builder this reference.
      • generateName

        protected abstract String generateName()
        Returns default historic feed name. Used when feed name is not explicitly set.
        Returns:
        default historic feed name.
      • buildImpl

        protected abstract F buildImpl()
        Returns a new historic feed instance based on builder settings.
        Returns:
        new historic feed instance.
      • name

        public final B name​(@Nullable
                            String name)
        Sets historic feed name. May be null or an empty string. If so, then name will be set to default value.
        Parameters:
        name - historic feed name.
        Returns:
        this Builder instance.
      • scope

        public final B scope​(EFeed.FeedScope scope)
        Sets historic feed scope. The same scope is used for both notification and request feeds. This means notifications are sent to or received from underlying feeds within this scope.
        Parameters:
        scope - historic feed scope.
        Returns:
        this Builder instance.
        Throws:
        NullPointerException - if scope is null.
      • build

        public final F build()
        Returns a new historic feed instance created from builder settings. Validates builder settings prior to building target historic feed instance.

        If historic feed name is not set, then generates a default feed name.

        Returns:
        new historic feed instance.
        Throws:
        net.sf.eBus.util.ValidationException - if this builder's settings are not valid.
      • validate

        protected net.sf.eBus.util.Validator validate​(net.sf.eBus.util.Validator problems)
        Validates that historic feed owner and scope are set. Returns problems parameter to allow for validate method chaining.
        Parameters:
        problems - place validation failures into this list.
        Returns: