public class StreamScopeRegistry
extends java.lang.Object
StreamScope
instances.
The registry contains a collection of StreamScope instances that are registered by one or more names.
The names are: by a TStream alias
or
by a stream's (output port's) unique identifier.
Static methods are provided for composing these names and extracting
the alias/identifier from generated names.
DevelopmentProvider
Constructor and Description |
---|
StreamScopeRegistry() |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getNames()
Get the registered names.
|
java.util.Map<StreamScope<?>,java.util.List<java.lang.String>> |
getStreamScopes()
Get registered StreamScopes and the name(s) each is registered with.
|
StreamScope<?> |
lookup(java.lang.String name)
Lookup a StreamScope
|
static java.lang.String |
mkStreamId(java.lang.String jobId,
java.lang.String opletId,
int oport)
Make a streamId for the specified stream.
|
static java.lang.String |
nameForStreamAlias(java.lang.String alias)
create a registration name for a stream alias
|
static java.lang.String |
nameForStreamId(java.lang.String streamId)
Create a registration name for a stream id.
|
void |
register(java.lang.String name,
StreamScope<?> streamScope)
Register a StreamScope by
name |
static java.lang.String |
streamAliasFromName(java.lang.String name)
Extract the stream alias from a name
|
static java.lang.String |
streamIdFromName(java.lang.String name)
Extract the streamId from the name.
|
void |
unregister(StreamScope<?> streamScope)
remove all name registrations of the StreamScope.
|
void |
unregister(java.lang.String name)
remove the specific name registration.
|
public static java.lang.String mkStreamId(java.lang.String jobId, java.lang.String opletId, int oport)
jobId
- the job id (e.g., "JOB_0")opletId
- the oplet id (e.g., "OP_2")oport
- the oplet output port index (0-based)public static java.lang.String nameForStreamAlias(java.lang.String alias)
alias
- the aliaspublic static java.lang.String nameForStreamId(java.lang.String streamId)
streamId
- the stream idmkStreamId(String, String, int)
public static java.lang.String streamAliasFromName(java.lang.String name)
name
- the namename
is not from nameByStreamAlias()public static java.lang.String streamIdFromName(java.lang.String name)
name
- the namename
is not from nameByStreamId()public void register(java.lang.String name, StreamScope<?> streamScope)
name
A single StreamScope can be registered with multiple names.
name
- name to register withstreamScope
- the StreamScopejava.lang.IllegalStateException
- if a registration already exists for name
nameForStreamId(String)
,
nameForStreamAlias(String)
public StreamScope<?> lookup(java.lang.String name)
name
- a StreamScope is registration namenameForStreamId(String)
,
nameForStreamAlias(String)
public java.util.Set<java.lang.String> getNames()
public java.util.Map<StreamScope<?>,java.util.List<java.lang.String>> getStreamScopes()
public void unregister(java.lang.String name)
name
- the name to unregisterunregister(StreamScope)
public void unregister(StreamScope<?> streamScope)
streamScope
- the StreamScope to unregisterCopyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641