org.glassfish.jersey.media.sse
Class InboundEvent

java.lang.Object
  extended by org.glassfish.jersey.media.sse.InboundEvent

public class InboundEvent
extends Object

Incoming event.

Author:
Pavel Bucek (pavel.bucek at oracle.com)

Method Summary
 String getData()
          Get event data as String.
<T> T
getData(Class<T> messageType)
          Get event data.
<T> T
getData(Class<T> messageType, MediaType mediaType)
          Get event data.
 String getName()
          Get the event name.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getName

public String getName()
Get the event name.

Returns:
event name or null if it is not present.

getData

public <T> T getData(Class<T> messageType)
          throws IOException
Get event data.

Parameters:
messageType - type of stored data content. Will be used for MessageBodyReader lookup.
Returns:
object of given type.
Throws:
IOException - when provided type can't be read.

getData

public <T> T getData(Class<T> messageType,
                     MediaType mediaType)
          throws IOException
Get event data.

Parameters:
messageType - type of stored data content. Will be used for MessageBodyReader lookup.
mediaType - MediaType of incoming data. Will be used for MessageBodyReader lookup.
Returns:
object of given type.
Throws:
IOException - when provided type can't be read.

getData

public String getData()
               throws IOException
Get event data as String.

Returns:
event data de-serialized as string.
Throws:
IOException - when provided type can't be read.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.