Added Session.getStream(int).

This commit is contained in:
Simone Bordet 2012-06-12 00:24:45 +02:00
parent d786bca2e5
commit bb3fa1cd7a
2 changed files with 18 additions and 4 deletions

View File

@ -272,6 +272,12 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
return result; return result;
} }
@Override
public IStream getStream(int streamId)
{
return streams.get(streamId);
}
@Override @Override
public Object getAttribute(String key) public Object getAttribute(String key)
{ {

View File

@ -180,20 +180,28 @@ public interface Session
public void goAway(long timeout, TimeUnit unit, Handler<Void> handler); public void goAway(long timeout, TimeUnit unit, Handler<Void> handler);
/** /**
* @return the streams currently active in this session * @return a snapshot of the streams currently active in this session
* @see #getStream(int)
*/ */
public Set<Stream> getStreams(); public Set<Stream> getStreams();
/**
* @param streamId the id of the stream to retrieve
* @return the stream with the given stream id
* @see #getStreams()
*/
public Stream getStream(int streamId);
/** /**
* @param key the attribute key * @param key the attribute key
* @return an arbitrary object associated with the given key to this stream * @return an arbitrary object associated with the given key to this session
* @see #setAttribute(String, Object) * @see #setAttribute(String, Object)
*/ */
public Object getAttribute(String key); public Object getAttribute(String key);
/** /**
* @param key the attribute key * @param key the attribute key
* @param value an arbitrary object to associate with the given key to this stream * @param value an arbitrary object to associate with the given key to this session
* @see #getAttribute(String) * @see #getAttribute(String)
* @see #removeAttribute(String) * @see #removeAttribute(String)
*/ */
@ -201,7 +209,7 @@ public interface Session
/** /**
* @param key the attribute key * @param key the attribute key
* @return the arbitrary object associated with the given key to this stream * @return the arbitrary object associated with the given key to this session
* @see #setAttribute(String, Object) * @see #setAttribute(String, Object)
*/ */
public Object removeAttribute(String key); public Object removeAttribute(String key);