org.red5.server.stream
Class AbstractStream

java.lang.Object
  extended by org.red5.server.stream.AbstractStream
All Implemented Interfaces:
IStream
Direct Known Subclasses:
AbstractClientStream, ServerStream

public abstract class AbstractStream
extends Object
implements IStream

Abstract base implementation of IStream. Contains codec information, stream name, scope, event handling meand, provides stream start and stop operations.

See Also:
IStream

Field Summary
protected  long creationTime
          Timestamp the stream was created.
protected  Semaphore lock
          Lock for protecting critical sections
protected  Notify metaData
          Stores the streams metadata
protected  StreamState state
          Current state
 
Constructor Summary
AbstractStream()
           
 
Method Summary
 IStreamCodecInfo getCodecInfo()
          Return codec information
 long getCreationTime()
          Returns timestamp at which the stream was created.
 Notify getMetaData()
          Returns the metadata for the associated stream, if it exists.
 String getName()
          Return stream name
 IScope getScope()
          Return scope
 StreamState getState()
          Return stream state
protected  IStreamAwareScopeHandler getStreamAwareHandler()
          Return stream aware scope handler or null if scope is null
 void setCodecInfo(IStreamCodecInfo codecInfo)
          Setter for codec info
 void setName(String name)
          Setter for name
 void setScope(IScope scope)
          Setter for scope
 void setState(StreamState state)
          Sets the stream state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.red5.server.api.stream.IStream
close, start, stop
 

Field Detail

state

protected StreamState state
Current state


metaData

protected Notify metaData
Stores the streams metadata


creationTime

protected long creationTime
Timestamp the stream was created.


lock

protected final Semaphore lock
Lock for protecting critical sections

Constructor Detail

AbstractStream

public AbstractStream()
Method Detail

getName

public String getName()
Return stream name

Specified by:
getName in interface IStream
Returns:
Stream name

getCodecInfo

public IStreamCodecInfo getCodecInfo()
Return codec information

Specified by:
getCodecInfo in interface IStream
Returns:
Stream codec information

getMetaData

public Notify getMetaData()
Returns the metadata for the associated stream, if it exists.

Returns:
stream meta data

getScope

public IScope getScope()
Return scope

Specified by:
getScope in interface IStream
Returns:
Scope

getCreationTime

public long getCreationTime()
Returns timestamp at which the stream was created.

Specified by:
getCreationTime in interface IStream
Returns:
creation timestamp

setName

public void setName(String name)
Setter for name

Parameters:
name - Stream name

setCodecInfo

public void setCodecInfo(IStreamCodecInfo codecInfo)
Setter for codec info

Parameters:
codecInfo - Codec info

setScope

public void setScope(IScope scope)
Setter for scope

Parameters:
scope - Scope

getState

public StreamState getState()
Return stream state

Returns:
StreamState

setState

public void setState(StreamState state)
Sets the stream state

Parameters:
state -

getStreamAwareHandler

protected IStreamAwareScopeHandler getStreamAwareHandler()
Return stream aware scope handler or null if scope is null

Returns:
IStreamAwareScopeHandler implementation


Copyright © 2006-2012 The Red5 Project