Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber
Class OperationSetDesktopSharingServerJabberImpl

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.media.AbstractOperationSetVideoTelephony<OperationSetBasicTelephonyJabberImpl,ProtocolProviderServiceJabberImpl,CallJabberImpl,CallPeerJabberImpl>
      extended by net.java.sip.communicator.impl.protocol.jabber.OperationSetVideoTelephonyJabberImpl
          extended by net.java.sip.communicator.impl.protocol.jabber.OperationSetDesktopStreamingJabberImpl
              extended by net.java.sip.communicator.impl.protocol.jabber.OperationSetDesktopSharingServerJabberImpl
All Implemented Interfaces:
EventListener, RegistrationStateChangeListener, OperationSet, OperationSetDesktopSharingServer, OperationSetDesktopStreaming, OperationSetVideoTelephony, org.jivesoftware.smack.filter.PacketFilter, org.jivesoftware.smack.PacketListener

public class OperationSetDesktopSharingServerJabberImpl
extends OperationSetDesktopStreamingJabberImpl
implements OperationSetDesktopSharingServer, RegistrationStateChangeListener, org.jivesoftware.smack.PacketListener, org.jivesoftware.smack.filter.PacketFilter

Implements all desktop sharing server-side related functions for Jabber protocol.

Author:
Sebastien Vincent

Field Summary
 
Fields inherited from class net.java.sip.communicator.impl.protocol.jabber.OperationSetDesktopStreamingJabberImpl
origin, size
 
Fields inherited from class net.java.sip.communicator.service.protocol.media.AbstractOperationSetVideoTelephony
basicTelephony, parentProvider
 
Fields inherited from interface net.java.sip.communicator.service.protocol.OperationSetVideoTelephony
LOCAL_VIDEO_STREAMING
 
Constructor Summary
OperationSetDesktopSharingServerJabberImpl(OperationSetBasicTelephonyJabberImpl basicTelephony)
          Initializes a new OperationSetDesktopSharingJabberImpl instance which builds upon the telephony-related functionality of a specific OperationSetBasicTelephonyJabberImpl.
 
Method Summary
 boolean accept(org.jivesoftware.smack.packet.Packet packet)
          Tests whether or not the specified packet should be handled by this operation set.
protected  Call createOutgoingVideoCall(String calleeAddress)
          Check if the remote part supports Jingle video.
protected  Call createOutgoingVideoCall(String calleeAddress, MediaDevice videoDevice)
          Check if the remote part supports Jingle video.
 Call createVideoCall(Contact callee, MediaDevice device)
          Create a new video call and invite the specified CallPeer to it.
 Call createVideoCall(String uri, MediaDevice device)
          Create a new video call and invite the specified CallPeer to it.
 void disableRemoteControl(CallPeer callPeer)
          Disable desktop remote control.
 void enableRemoteControl(CallPeer callPeer)
          Enable desktop remote control.
 void processComponentEvent(ComponentEvent event)
          Process an ComponentEvent received from remote peer.
 void processKeyboardEvent(KeyEvent event)
          Process keyboard notification received from remote peer.
 void processMouseEvent(MouseEvent event)
          Process mouse notification received from remote peer.
 void processPacket(org.jivesoftware.smack.packet.Packet packet)
          Handles incoming inputevt packets and passes them to the corresponding method based on their action.
 void registrationStateChanged(RegistrationStateChangeEvent evt)
          Implementation of method registrationStateChange from interface RegistrationStateChangeListener for setting up (or down) our InputEvtManager when an XMPPConnection is available
 void setLocalVideoAllowed(Call call, boolean allowed)
          Implements OperationSetVideoTelephony#setLocalVideoAllowed(Call, boolean).
 void setLocalVideoAllowed(Call call, MediaDevice mediaDevice, boolean allowed)
          Sets the indicator which determines whether the streaming of local video in a specific Call is allowed.
 
Methods inherited from class net.java.sip.communicator.impl.protocol.jabber.OperationSetDesktopStreamingJabberImpl
createVideoCall, createVideoCall, getMediaUseCase, getOriginForMediaDevice, isLocalVideoAllowed, isPartialStreaming, movePartialDesktopStreaming
 
Methods inherited from class net.java.sip.communicator.impl.protocol.jabber.OperationSetVideoTelephonyJabberImpl
answerVideoCallPeer, getQualityControl
 
Methods inherited from class net.java.sip.communicator.service.protocol.media.AbstractOperationSetVideoTelephony
addPropertyChangeListener, addVideoListener, createLocalVisualComponent, createVideoCall, createVideoCall, disposeLocalVisualComponent, getVisualComponent, getVisualComponents, isLocalVideoStreaming, removePropertyChangeListener, removeVideoListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.java.sip.communicator.service.protocol.OperationSetDesktopStreaming
isPartialStreaming, movePartialDesktopStreaming
 
Methods inherited from interface net.java.sip.communicator.service.protocol.OperationSetVideoTelephony
addPropertyChangeListener, addVideoListener, answerVideoCallPeer, createLocalVisualComponent, createVideoCall, createVideoCall, createVideoCall, createVideoCall, disposeLocalVisualComponent, getQualityControl, getVisualComponent, getVisualComponents, isLocalVideoAllowed, isLocalVideoStreaming, removePropertyChangeListener, removeVideoListener
 

Constructor Detail

OperationSetDesktopSharingServerJabberImpl

public OperationSetDesktopSharingServerJabberImpl(OperationSetBasicTelephonyJabberImpl basicTelephony)
Initializes a new OperationSetDesktopSharingJabberImpl instance which builds upon the telephony-related functionality of a specific OperationSetBasicTelephonyJabberImpl.

Parameters:
basicTelephony - the OperationSetBasicTelephonyJabberImpl the new extension should build upon
Method Detail

createVideoCall

public Call createVideoCall(String uri,
                            MediaDevice device)
                     throws OperationFailedException,
                            ParseException
Create a new video call and invite the specified CallPeer to it.

Specified by:
createVideoCall in interface OperationSetDesktopStreaming
Overrides:
createVideoCall in class OperationSetDesktopStreamingJabberImpl
Parameters:
uri - the address of the callee that we should invite to a new call.
device - video device that will be used to stream desktop.
Returns:
CallPeer the CallPeer that will represented by the specified uri. All following state change events will be delivered through that call peer. The Call that this peer is a member of could be retrieved from the CallParticipatn instance with the use of the corresponding method.
Throws:
OperationFailedException - with the corresponding code if we fail to create the video call.
ParseException - if callee is not a valid Jabber address string.

createVideoCall

public Call createVideoCall(Contact callee,
                            MediaDevice device)
                     throws OperationFailedException
Create a new video call and invite the specified CallPeer to it.

Specified by:
createVideoCall in interface OperationSetDesktopStreaming
Overrides:
createVideoCall in class OperationSetDesktopStreamingJabberImpl
Parameters:
callee - the address of the callee that we should invite to a new call.
device - video device that will be used to stream desktop.
Returns:
CallPeer the CallPeer that will represented by the specified uri. All following state change events will be delivered through that call peer. The Call that this peer is a member of could be retrieved from the CallParticipatn instance with the use of the corresponding method.
Throws:
OperationFailedException - with the corresponding code if we fail to create the video call.

createOutgoingVideoCall

protected Call createOutgoingVideoCall(String calleeAddress)
                                throws OperationFailedException
Check if the remote part supports Jingle video.

Overrides:
createOutgoingVideoCall in class OperationSetVideoTelephonyJabberImpl
Parameters:
calleeAddress - Contact address
Returns:
true if contact support Jingle video, false otherwise
Throws:
OperationFailedException - with the corresponding code if we fail to create the video call.

createOutgoingVideoCall

protected Call createOutgoingVideoCall(String calleeAddress,
                                       MediaDevice videoDevice)
                                throws OperationFailedException
Check if the remote part supports Jingle video.

Overrides:
createOutgoingVideoCall in class OperationSetDesktopStreamingJabberImpl
Parameters:
calleeAddress - Contact address
videoDevice - specific video device to use (null to use default device)
Returns:
true if contact support Jingle video, false otherwise
Throws:
OperationFailedException - with the corresponding code if we fail to create the video call.

setLocalVideoAllowed

public void setLocalVideoAllowed(Call call,
                                 boolean allowed)
                          throws OperationFailedException
Implements OperationSetVideoTelephony#setLocalVideoAllowed(Call, boolean). Modifies the local media setup to reflect the requested setting for the streaming of the local video and then re-invites all CallPeers to re-negotiate the modified media setup.

Specified by:
setLocalVideoAllowed in interface OperationSetVideoTelephony
Overrides:
setLocalVideoAllowed in class OperationSetDesktopStreamingJabberImpl
Parameters:
call - the call where we'd like to allow sending local video.
allowed - true if local video transmission is allowed and false otherwise.
Throws:
OperationFailedException - if video initialization fails.

setLocalVideoAllowed

public void setLocalVideoAllowed(Call call,
                                 MediaDevice mediaDevice,
                                 boolean allowed)
                          throws OperationFailedException
Sets the indicator which determines whether the streaming of local video in a specific Call is allowed. The setting does not reflect the availability of actual video capture devices, it just expresses the desire of the user to have the local video streamed in the case the system is actually able to do so.

Specified by:
setLocalVideoAllowed in interface OperationSetDesktopStreaming
Overrides:
setLocalVideoAllowed in class OperationSetDesktopStreamingJabberImpl
Parameters:
call - the Call to allow/disallow the streaming of local video for
mediaDevice - the media device to use for the desktop streaming
allowed - true to allow the streaming of local video for the specified Call; false to disallow it
Throws:
OperationFailedException - if initializing local video fails.

enableRemoteControl

public void enableRemoteControl(CallPeer callPeer)
Enable desktop remote control. Local desktop can now regenerates keyboard and mouse events received from peer.

Specified by:
enableRemoteControl in interface OperationSetDesktopSharingServer
Parameters:
callPeer - call peer that will take control on local computer

disableRemoteControl

public void disableRemoteControl(CallPeer callPeer)
Disable desktop remote control. Local desktop stops regenerate keyboard and mouse events received from peer.

Specified by:
disableRemoteControl in interface OperationSetDesktopSharingServer
Parameters:
callPeer - call peer that will stop controlling on local computer

registrationStateChanged

public void registrationStateChanged(RegistrationStateChangeEvent evt)
Implementation of method registrationStateChange from interface RegistrationStateChangeListener for setting up (or down) our InputEvtManager when an XMPPConnection is available

Specified by:
registrationStateChanged in interface RegistrationStateChangeListener
Parameters:
evt - the event received

processPacket

public void processPacket(org.jivesoftware.smack.packet.Packet packet)
Handles incoming inputevt packets and passes them to the corresponding method based on their action.

Specified by:
processPacket in interface org.jivesoftware.smack.PacketListener
Parameters:
packet - the packet to process.

accept

public boolean accept(org.jivesoftware.smack.packet.Packet packet)
Tests whether or not the specified packet should be handled by this operation set. This method is called by smack prior to packet delivery and it would only accept InputEvtIQs.

Specified by:
accept in interface org.jivesoftware.smack.filter.PacketFilter
Parameters:
packet - the packet to test.
Returns:
true if and only if packet passes the filter.

processComponentEvent

public void processComponentEvent(ComponentEvent event)
Process an ComponentEvent received from remote peer.

Parameters:
event - ComponentEvent that will be regenerated on local computer

processKeyboardEvent

public void processKeyboardEvent(KeyEvent event)
Process keyboard notification received from remote peer.

Specified by:
processKeyboardEvent in interface OperationSetDesktopSharingServer
Parameters:
event - KeyboardEvent that will be regenerated on local computer

processMouseEvent

public void processMouseEvent(MouseEvent event)
Process mouse notification received from remote peer.

Specified by:
processMouseEvent in interface OperationSetDesktopSharingServer
Parameters:
event - MouseEvent that will be regenerated on local computer

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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