Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.sip
Class DesktopSharingProtocolSipImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.sip.DesktopSharingProtocolSipImpl

public class DesktopSharingProtocolSipImpl
extends Object

Utility class to provide XML definition for the desktop sharing SIP event package.

Author:
Sebastien Vincent

Field Summary
static String CONTENT_SUB_TYPE
          The content sub-type of the content supported in NOTIFY requests handled by OperationSetDesktopSharingSipImpl.
static String EVENT_PACKAGE
          The name of the event package supported by OperationSetDesktopSharingServerSipImpl in SUBSCRIBE and NOTIFY requests.
static int REFRESH_MARGIN
          The time in seconds before the expiration of a Subscription at which the OperationSetDesktopSharingServerSipImpl instance managing it should refresh it.
static int SUBSCRIPTION_DURATION
          The time in seconds after which a Subscription should be expired by the OperationSetDesktopSharingServerSipImpl instance which manages it.
 
Constructor Summary
DesktopSharingProtocolSipImpl()
           
 
Method Summary
static String getKeyPressedXML(int keycode)
          Build a remote-info key-press SIP NOTIFY message.
static String getKeyReleasedXML(int keycode)
          Build a remote-info key-release SIP NOTIFY message.
static String getKeyTypedXML(int keycode)
          Build a remote-info key-typed SIP NOTIFY message.
static String getMouseMovedXML(double x, double y)
          Build a remote-info mouse-move SIP NOTIFY message.
static String getMousePressedXML(int btns)
          Build a remote-info mouse-press SIP NOTIFY message.
static String getMouseReleasedXML(int btns)
          Build a remote-info mouse-release SIP NOTIFY message.
static String getMouseWheelXML(int notch)
          Build a remote-info mouse-wheel SIP NOTIFY message.
static List<ComponentEvent> parse(Element root, Dimension size, Point origin)
          Parses an XML element and returns a list of all MouseEvent and KeyEvent found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_PACKAGE

public static final String EVENT_PACKAGE
The name of the event package supported by OperationSetDesktopSharingServerSipImpl in SUBSCRIBE and NOTIFY requests.

See Also:
Constant Field Values

REFRESH_MARGIN

public static final int REFRESH_MARGIN
The time in seconds before the expiration of a Subscription at which the OperationSetDesktopSharingServerSipImpl instance managing it should refresh it.

See Also:
Constant Field Values

SUBSCRIPTION_DURATION

public static final int SUBSCRIPTION_DURATION
The time in seconds after which a Subscription should be expired by the OperationSetDesktopSharingServerSipImpl instance which manages it.

See Also:
Constant Field Values

CONTENT_SUB_TYPE

public static final String CONTENT_SUB_TYPE
The content sub-type of the content supported in NOTIFY requests handled by OperationSetDesktopSharingSipImpl.

See Also:
Constant Field Values
Constructor Detail

DesktopSharingProtocolSipImpl

public DesktopSharingProtocolSipImpl()
Method Detail

getKeyPressedXML

public static String getKeyPressedXML(int keycode)
Build a remote-info key-press SIP NOTIFY message.

Parameters:
keycode - keyboard's code
Returns:
raw XML bytes

getKeyReleasedXML

public static String getKeyReleasedXML(int keycode)
Build a remote-info key-release SIP NOTIFY message.

Parameters:
keycode - keyboard's code
Returns:
raw XML bytes

getKeyTypedXML

public static String getKeyTypedXML(int keycode)
Build a remote-info key-typed SIP NOTIFY message.

Parameters:
keycode - keyboard's code
Returns:
raw XML bytes

getMousePressedXML

public static String getMousePressedXML(int btns)
Build a remote-info mouse-press SIP NOTIFY message.

Parameters:
btns - button mask
Returns:
raw XML bytes

getMouseReleasedXML

public static String getMouseReleasedXML(int btns)
Build a remote-info mouse-release SIP NOTIFY message.

Parameters:
btns - button mask
Returns:
raw XML bytes

getMouseMovedXML

public static String getMouseMovedXML(double x,
                                      double y)
Build a remote-info mouse-move SIP NOTIFY message.

Parameters:
x - x position of the mouse
y - y position of the mouse
Returns:
raw XML bytes

getMouseWheelXML

public static String getMouseWheelXML(int notch)
Build a remote-info mouse-wheel SIP NOTIFY message.

Parameters:
notch - wheel notch
Returns:
raw XML bytes

parse

public static List<ComponentEvent> parse(Element root,
                                         Dimension size,
                                         Point origin)
Parses an XML element and returns a list of all MouseEvent and KeyEvent found.

Parameters:
root - XML root element
size - size of the video (used to have right (x,y) for MouseMoved and MouseDragged
origin - origin coordinate (upper left corner)
Returns:
list of java.awt.Event

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.