Interface MultiStreamDataSource
-
- All Superinterfaces:
DataSource
public interface MultiStreamDataSource extends DataSource
A data source with multiple input/output stream data sources (streams), each identified by a unique name. It may be useful if we want to read/write data from different places independently. For instance I want to store metadata in one place and the real stuff in the other place. Or I can store my special meta-data nodes in-memory, while the main data on disk. FolderDataSource may serve as a good example of a concrete implementation.- See Also:
StreamDataSource
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default boolean
delete()
deletes all the containing stream ds and maybe something elsedefault boolean
delete(String name)
Deprecated.default Iterable<String>
getAvailableStreams()
Deprecated, for removal: This API element is subject to removal in a future version.usegetSubStreams()
default StreamDataSource
getStreamByName(String name)
StreamDataSource
getStreamByNameOrCreate(String name)
counterpart forgetStreamByNameOrFail(String)
, which allows to add new streams btw it'd be great ifStreamDataSource.delete()
invoked on substreams make them disappear from the return value of this method.default StreamDataSource
getStreamByNameOrFail(String name)
overridegetStreamByName(String)
please instead of this methodStream<StreamDataSource>
getSubStreams()
return a sequence of possible streams; each stream we identify uniquely byStreamDataSource.getStreamName()
default InputStream
openInputStream(String name)
Deprecated.default OutputStream
openOutputStream(String name)
Deprecated.-
Methods inherited from interface org.jetbrains.mps.openapi.persistence.DataSource
addListener, getLocation, getTimestamp, getType, isAlive, isReadOnly, refresh, removeListener
-
-
-
-
Method Detail
-
getAvailableStreams
@Deprecated(forRemoval=true) @NotNull default Iterable<String> getAvailableStreams()
Deprecated, for removal: This API element is subject to removal in a future version.usegetSubStreams()
-
getSubStreams
@NotNull Stream<StreamDataSource> getSubStreams()
return a sequence of possible streams; each stream we identify uniquely byStreamDataSource.getStreamName()
-
getStreamByName
@Nullable default StreamDataSource getStreamByName(@NotNull String name)
-
getStreamByNameOrFail
@NotNull default StreamDataSource getStreamByNameOrFail(@NotNull String name)
overridegetStreamByName(String)
please instead of this method
-
getStreamByNameOrCreate
@NotNull StreamDataSource getStreamByNameOrCreate(@NotNull String name)
counterpart forgetStreamByNameOrFail(String)
, which allows to add new streams btw it'd be great ifStreamDataSource.delete()
invoked on substreams make them disappear from the return value of this method. currently this is so
-
openInputStream
@NotNull @Deprecated default InputStream openInputStream(@NotNull String name) throws IOException
Deprecated.Access named stream for reading. Caller is responsible to close the stream once done.- Parameters:
name
- name of the stream to read- Returns:
- stream to read from, never
null
- Throws:
IOException
- if failed to open given named stream
-
openOutputStream
@NotNull @Deprecated default OutputStream openOutputStream(@NotNull String name) throws IOException
Deprecated.Access named stream for writing. Caller is responsible to close the stream once done.- Parameters:
name
- name of the stream to write- Returns:
- stream to write to, never
null
- Throws:
IOException
- if failed to open given named stream
-
delete
default boolean delete()
deletes all the containing stream ds and maybe something else
-
delete
@Deprecated default boolean delete(@NotNull String name)
Deprecated.- Returns:
- if successfully deleted
-
-