Interface StreamService

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      org.jboss.set.aphrodite.domain.StreamComponent getComponentBy​(URI repository, org.jboss.set.aphrodite.domain.Codebase codebase)
      Get the StreamComponent which specifies the given repository and codebase.
      List<URI> getDistinctURLRepositories()
      Retrieve all Repositories across all Streams.
      List<URI> getDistinctURLRepositoriesByStream​(String streamName)
      Retrieve the URLs of all Repositories associated with a given Stream.
      org.jboss.set.aphrodite.domain.Stream getStream​(String streamName)
      Get a specific Stream object based upon its String name.
      List<org.jboss.set.aphrodite.domain.Stream> getStreams()
      Returns all streams discovered by this service.
      List<org.jboss.set.aphrodite.domain.Stream> getStreamsBy​(URI repository, org.jboss.set.aphrodite.domain.Codebase codebase)
      Find all the streams associated to the given repository and codebase
      boolean init​(Aphrodite aphrodite, AphroditeConfig config)
      Initialize the stream service.
      void serializeStreams​(URL url, OutputStream out)
      Serialize streams for certain URL.
      org.jboss.set.aphrodite.domain.StreamComponent updateStreamComponent​(org.jboss.set.aphrodite.domain.StreamComponent streamComponent)
      Updates stream component version in memory and in back end storage if possible.
      boolean updateStreams()
      Trigger for updating streams information.
    • Method Detail

      • updateStreams

        boolean updateStreams()
                       throws NotFoundException
        Trigger for updating streams information. Generally implementation if free to decide if updtes only on change on method being triggered or via other means(timed). Note, that internally, service is free to keep information up2date by any means is sees fit.
        Returns:
        • true - if streams information has been updated
        • false - if streams information remain unchanged
        Throws:
        NotFoundException
      • getStreams

        List<org.jboss.set.aphrodite.domain.Stream> getStreams()
        Returns all streams discovered by this service.
        Returns:
        a list of all streams discovered by this StreamService, or an empty list if no streams exist.
      • getStream

        org.jboss.set.aphrodite.domain.Stream getStream​(String streamName)
        Get a specific Stream object based upon its String name.
        Parameters:
        streamName - the name of the Stream to be returned.
        Returns:
        Stream the Stream object which corresponds to the specified streamName if it exists, otherwise null.
      • getDistinctURLRepositories

        List<URI> getDistinctURLRepositories()
        Retrieve all Repositories across all Streams. Note, that only Repository objects with distinct URLs are returned. This method should never return the same repository twice.
        Returns:
        a list of unique Repositories.
      • getDistinctURLRepositoriesByStream

        List<URI> getDistinctURLRepositoriesByStream​(String streamName)
        Retrieve the URLs of all Repositories associated with a given Stream. Note, that only Repository objects with distinct URLs are returned. This method should never return the same repository twice.
        Parameters:
        streamName - the name of the Stream containing the returned repositories.
        Returns:
        a list of unique Repositories.
      • getStreamsBy

        List<org.jboss.set.aphrodite.domain.Stream> getStreamsBy​(URI repository,
                                                                 org.jboss.set.aphrodite.domain.Codebase codebase)
        Find all the streams associated to the given repository and codebase
        Parameters:
        repository - the Repository to search against.
        codebase - the Codebase to search against.
        Returns:
        a list of named Stream objects.
      • getComponentBy

        org.jboss.set.aphrodite.domain.StreamComponent getComponentBy​(URI repository,
                                                                      org.jboss.set.aphrodite.domain.Codebase codebase)
        Get the StreamComponent which specifies the given repository and codebase. Note, this returns the first matching component in the Stream data.
        Parameters:
        repository - the Repository to be searched against.
        codebase - the codebase to be searched against.
        Returns:
        the StreamComponent associated with the given repository and codebase, or null if a StreamComponent does not exist
      • updateStreamComponent

        org.jboss.set.aphrodite.domain.StreamComponent updateStreamComponent​(org.jboss.set.aphrodite.domain.StreamComponent streamComponent)
                                                                      throws org.jboss.set.aphrodite.domain.StreamComponentUpdateException
        Updates stream component version in memory and in back end storage if possible.
        Parameters:
        streamComponent - - component which should be updated
        Returns:
        mutated object with new component version, after update.
        Throws:
        org.jboss.set.aphrodite.domain.StreamComponentUpdateException - - in case there is some error on update.
      • serializeStreams

        void serializeStreams​(URL url,
                              OutputStream out)
                       throws NotFoundException
        Serialize streams for certain URL.
        Parameters:
        url - - url
        out - - sink for bytes
        Throws:
        NotFoundException - - if url does not match any set of streams