Package org.jboss.set.aphrodite.spi
Interface StreamService
-
- All Known Implementing Classes:
JsonStreamService
public interface StreamService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.jboss.set.aphrodite.domain.StreamComponentgetComponentBy(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.StreamgetStream(String streamName)Get a specificStreamobject 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 codebasebooleaninit(Aphrodite aphrodite, AphroditeConfig config)Initialize the stream service.voidserializeStreams(URL url, OutputStream out)Serialize streams for certain URL.org.jboss.set.aphrodite.domain.StreamComponentupdateStreamComponent(org.jboss.set.aphrodite.domain.StreamComponent streamComponent)Updates stream component version in memory and in back end storage if possible.booleanupdateStreams()Trigger for updating streams information.
-
-
-
Method Detail
-
init
boolean init(Aphrodite aphrodite, AphroditeConfig config) throws NotFoundException
Initialize the stream service.
-
updateStreams
boolean updateStreams() throws NotFoundExceptionTrigger 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 specificStreamobject based upon its String name.- Parameters:
streamName- the name of theStreamto be returned.- Returns:
- Stream the
Streamobject 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 theStreamcontaining 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- theRepositoryto search against.codebase- theCodebaseto search against.- Returns:
- a list of named
Streamobjects.
-
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.StreamComponentUpdateExceptionUpdates 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- - urlout- - sink for bytes- Throws:
NotFoundException- - if url does not match any set of streams
-
-