Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.gibberish
Class OperationSetBasicTelephonyGibberishImpl

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.media.AbstractOperationSetBasicTelephony<ProtocolProviderServiceGibberishImpl>
      extended by net.java.sip.communicator.impl.protocol.gibberish.OperationSetBasicTelephonyGibberishImpl
All Implemented Interfaces:
EventListener, CallChangeListener, OperationSet, OperationSetBasicTelephony<ProtocolProviderServiceGibberishImpl>

public class OperationSetBasicTelephonyGibberishImpl
extends AbstractOperationSetBasicTelephony<ProtocolProviderServiceGibberishImpl>
implements CallChangeListener

A Gibberish implementation of a basic telephony operation set.

Author:
Yana Stamcheva

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.protocol.OperationSetBasicTelephony
MAX_MEDIA_PORT_NUMBER_PROPERTY_NAME, MIN_MEDIA_PORT_NUMBER_PROPERTY_NAME
 
Constructor Summary
OperationSetBasicTelephonyGibberishImpl(ProtocolProviderServiceGibberishImpl protocolProvider)
          Creates an instance of OperationSetBasicTelephonyGibberishImpl by specifying the corresponding protocolProvider
 
Method Summary
 void answerCallPeer(CallPeer peer)
          Indicates a user request to answer an incoming call from the specified CallPeer.
 void callPeerAdded(CallPeerEvent evt)
          Indicates that a new call peer has joined the source call.
 void callPeerRemoved(CallPeerEvent evt)
          Indicates that a call peer has left the source call.
 void callStateChanged(CallChangeEvent evt)
          Indicates that a change has occurred in the state of the source call.
 Call createCall(Contact callee)
          Creates a new Call and invites a specific CallPeer to it given by her Contact.
 Call createCall(Contact callee, CallGroup group)
          Creates a new Call and invites a specific CallPeer to it given by her Contact.
 Call createCall(String uri)
          Creates a new Call and invites a specific CallPeer to it given by her String URI.
 Call createCall(String callee, CallGroup group)
          Creates a new Call and invites a specific CallPeer to it given by her String URI.
 Iterator<Call> getActiveCalls()
          Returns an iterator over all currently active calls.
 ProtocolProviderServiceGibberishImpl getProtocolProvider()
          Returns the protocol provider that this operation set belongs to.
 void hangupCallPeer(CallPeer peer)
          Indicates a user request to end a call with the specified call particiapnt.
 void putOffHold(CallPeer peer)
          Resumes communication with a call peer previously put on hold.
 void putOnHold(CallPeer peer)
          Puts the specified CallPeer "on hold".
 void setMute(CallPeer peer, boolean mute)
          Sets the mute state of the audio stream being sent to a specific CallPeer.
 
Methods inherited from class net.java.sip.communicator.service.protocol.media.AbstractOperationSetBasicTelephony
addCallListener, createRecorder, fireCallEvent, fireCallEvent, removeCallListener, setMute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationSetBasicTelephonyGibberishImpl

public OperationSetBasicTelephonyGibberishImpl(ProtocolProviderServiceGibberishImpl protocolProvider)
Creates an instance of OperationSetBasicTelephonyGibberishImpl by specifying the corresponding protocolProvider

Parameters:
protocolProvider - the protocol provider, where this operation set is registered
Method Detail

answerCallPeer

public void answerCallPeer(CallPeer peer)
                    throws OperationFailedException
Indicates a user request to answer an incoming call from the specified CallPeer.

Specified by:
answerCallPeer in interface OperationSetBasicTelephony<ProtocolProviderServiceGibberishImpl>
Parameters:
peer - the call peer that we'd like to answer.
Throws:
OperationFailedException - with the corresponding code if we encounter an error while performing this operation.

createCall

public Call createCall(String uri)
                throws OperationFailedException
Creates a new Call and invites a specific CallPeer to it given by her String URI.

Specified by:
createCall in interface OperationSetBasicTelephony<ProtocolProviderServiceGibberishImpl>
Parameters:
uri - the address of the callee who we should invite to a new Call
Returns:
a newly created Call. The specified callee is available in the Call as a CallPeer
Throws:
OperationFailedException - with the corresponding code if we fail to create the call
See Also:
OperationSetBasicTelephony.createCall(String)

createCall

public Call createCall(Contact callee)
                throws OperationFailedException
Creates a new Call and invites a specific CallPeer to it given by her Contact.

Specified by:
createCall in interface OperationSetBasicTelephony<ProtocolProviderServiceGibberishImpl>
Parameters:
callee - the address of the callee who we should invite to a new call
Returns:
a newly created Call. The specified callee is available in the Call as a CallPeer
Throws:
OperationFailedException - with the corresponding code if we fail to create the call
See Also:
OperationSetBasicTelephony.createCall(Contact)

createCall

public Call createCall(String callee,
                       CallGroup group)
                throws OperationFailedException
Creates a new Call and invites a specific CallPeer to it given by her String URI.

Specified by:
createCall in interface OperationSetBasicTelephony<ProtocolProviderServiceGibberishImpl>
Parameters:
callee - the address of the callee who we should invite to a new Call
group - CallGroup from which the Call will belong
Returns:
a newly created Call. The specified callee is available in the Call as a CallPeer
Throws:
OperationFailedException - with the corresponding code if we fail to create the call

createCall

public Call createCall(Contact callee,
                       CallGroup group)
                throws OperationFailedException
Creates a new Call and invites a specific CallPeer to it given by her Contact.

Specified by:
createCall in interface OperationSetBasicTelephony<ProtocolProviderServiceGibberishImpl>
Parameters:
callee - the address of the callee who we should invite to a new call
group - CallGroup from which the Call will belong
Returns:
a newly created Call. The specified callee is available in the Call as a CallPeer
Throws:
OperationFailedException - with the corresponding code if we fail to create the call

getActiveCalls

public Iterator<Call> getActiveCalls()
Returns an iterator over all currently active calls.

Specified by:
getActiveCalls in interface OperationSetBasicTelephony<ProtocolProviderServiceGibberishImpl>
Returns:
Iterator

hangupCallPeer

public void hangupCallPeer(CallPeer peer)
                    throws OperationFailedException
Indicates a user request to end a call with the specified call particiapnt.

Specified by:
hangupCallPeer in interface OperationSetBasicTelephony<ProtocolProviderServiceGibberishImpl>
Parameters:
peer - the peer that we'd like to hang up on.
Throws:
OperationFailedException - with the corresponding code if we encounter an error while performing this operation.

putOffHold

public void putOffHold(CallPeer peer)
                throws OperationFailedException
Resumes communication with a call peer previously put on hold.

Specified by:
putOffHold in interface OperationSetBasicTelephony<ProtocolProviderServiceGibberishImpl>
Parameters:
peer - the call peer to put on hold.
Throws:
OperationFailedException - if we encounter an error while performing this operation

putOnHold

public void putOnHold(CallPeer peer)
               throws OperationFailedException
Puts the specified CallPeer "on hold".

Specified by:
putOnHold in interface OperationSetBasicTelephony<ProtocolProviderServiceGibberishImpl>
Parameters:
peer - the peer that we'd like to put on hold.
Throws:
OperationFailedException - with the corresponding code if we encounter an error while performing this operation.

callPeerAdded

public void callPeerAdded(CallPeerEvent evt)
Description copied from interface: CallChangeListener
Indicates that a new call peer has joined the source call.

Specified by:
callPeerAdded in interface CallChangeListener
Parameters:
evt - the CallPeerEvent containing the source call and call peer.

callPeerRemoved

public void callPeerRemoved(CallPeerEvent evt)
Description copied from interface: CallChangeListener
Indicates that a call peer has left the source call.

Specified by:
callPeerRemoved in interface CallChangeListener
Parameters:
evt - the CallPeerEvent containing the source call and call peer.

callStateChanged

public void callStateChanged(CallChangeEvent evt)
Description copied from interface: CallChangeListener
Indicates that a change has occurred in the state of the source call.

Specified by:
callStateChanged in interface CallChangeListener
Parameters:
evt - the CallChangeEvent instance containing the source calls and its old and new state.

setMute

public void setMute(CallPeer peer,
                    boolean mute)
Sets the mute state of the audio stream being sent to a specific CallPeer.

The implementation sends silence through the audio stream.

Parameters:
peer - the CallPeer who receives the audio stream to have its mute state set
mute - true to mute the audio stream being sent to peer; otherwise, false

getProtocolProvider

public ProtocolProviderServiceGibberishImpl getProtocolProvider()
Returns the protocol provider that this operation set belongs to.

Specified by:
getProtocolProvider in interface OperationSetBasicTelephony<ProtocolProviderServiceGibberishImpl>
Returns:
a reference to the ProtocolProviderService that created this operation set.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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