Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.mock
Class MockProvider

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.mock.MockProvider
All Implemented Interfaces:
ProtocolProviderService

public class MockProvider
extends Object
implements ProtocolProviderService

A mock protocol provider implementation that comes with a single operation set (OperationSetPersistentPresence) for use by the MetaContactListSlcik.

Author:
Emil Ivov

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.protocol.ProtocolProviderService
BIND_RETRIES_DEFAULT_VALUE, BIND_RETRIES_PROPERTY_NAME
 
Constructor Summary
MockProvider(String userName)
          Creates an instance of this mockprovider with a supportedOperationSet-s map set to contain a single persistent presence operation set.
 
Method Summary
 void addRegistrationStateChangeListener(RegistrationStateChangeListener listener)
          Mock implementation of the corresponding ProtocolProviderService method.
 AccountID getAccountID()
          Returns the AccountID that uniquely identifies the account represented by this instance of the ProtocolProviderService.
<T extends OperationSet>
T
getOperationSet(Class<T> opsetClass)
          Returns the operation set corresponding to the specified class or null if this operation set is not supported by the provider implementation.
 String getProtocolDisplayName()
          Mock implementation of the corresponding ProtocolProviderService method.
 ProtocolIcon getProtocolIcon()
          Mock implementation of the corresponding ProtocolProviderService method.
 String getProtocolName()
          Mock implementation of the corresponding ProtocolProviderService method.
 RegistrationState getRegistrationState()
          Mock implementation of the corresponding ProtocolProviderService method.
 Map<String,OperationSet> getSupportedOperationSets()
          Returns an array containing all operation sets supported by the current implementation.
 boolean isRegistered()
          Mock implementation of the corresponding ProtocolProviderService method.
 boolean isSignalingTransportSecure()
          Indicate if the signaling transport of this protocol instance uses a secure (e.g.
 void register(SecurityAuthority authority)
          Mock implementation of the corresponding ProtocolProviderService method.
 void removeRegistrationStateChangeListener(RegistrationStateChangeListener listener)
          Mock implementation of the corresponding ProtocolProviderService method.
 void shutdown()
          Mock implementation of the corresponding ProtocolProviderService method.
 void unregister()
          Mock implementation of the corresponding ProtocolProviderService method.
 
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.ProtocolProviderService
hashCode
 

Constructor Detail

MockProvider

public MockProvider(String userName)
Creates an instance of this mockprovider with a supportedOperationSet-s map set to contain a single persistent presence operation set.

Parameters:
userName - an almost ignorable string (any value is accepted) that should be used when constructing account id's
Method Detail

addRegistrationStateChangeListener

public void addRegistrationStateChangeListener(RegistrationStateChangeListener listener)
Mock implementation of the corresponding ProtocolProviderService method.

Specified by:
addRegistrationStateChangeListener in interface ProtocolProviderService
Parameters:
listener - a param.

getProtocolName

public String getProtocolName()
Mock implementation of the corresponding ProtocolProviderService method.

Specified by:
getProtocolName in interface ProtocolProviderService
Returns:
a String describing this mock protocol.

getProtocolDisplayName

public String getProtocolDisplayName()
Mock implementation of the corresponding ProtocolProviderService method.

Specified by:
getProtocolDisplayName in interface ProtocolProviderService
Returns:
a String describing this mock protocol.

getRegistrationState

public RegistrationState getRegistrationState()
Mock implementation of the corresponding ProtocolProviderService method.

Specified by:
getRegistrationState in interface ProtocolProviderService
Returns:
a Registered RegistrationState.

getSupportedOperationSets

public Map<String,OperationSet> getSupportedOperationSets()
Returns an array containing all operation sets supported by the current implementation.

Specified by:
getSupportedOperationSets in interface ProtocolProviderService
Returns:
a java.util.Map containing instance of all supported operation sets mapped against their class names (e.g. OperationSetPresence.class.getName()) .

getOperationSet

public <T extends OperationSet> T getOperationSet(Class<T> opsetClass)
Returns the operation set corresponding to the specified class or null if this operation set is not supported by the provider implementation.

Specified by:
getOperationSet in interface ProtocolProviderService
Type Parameters:
T - the type which extends OperationSet and which is to be retrieved
Parameters:
opsetClass - the Class of the operation set that we're looking for.
Returns:
returns an OperationSet of the specified Class if the undelying implementation supports it or null otherwise.

isRegistered

public boolean isRegistered()
Mock implementation of the corresponding ProtocolProviderService method.

Specified by:
isRegistered in interface ProtocolProviderService
Returns:
always true.

register

public void register(SecurityAuthority authority)
Mock implementation of the corresponding ProtocolProviderService method.

Specified by:
register in interface ProtocolProviderService
Parameters:
authority - a dummy param

removeRegistrationStateChangeListener

public void removeRegistrationStateChangeListener(RegistrationStateChangeListener listener)
Mock implementation of the corresponding ProtocolProviderService method.

Specified by:
removeRegistrationStateChangeListener in interface ProtocolProviderService
Parameters:
listener - a dummy param.

shutdown

public void shutdown()
Mock implementation of the corresponding ProtocolProviderService method.

Specified by:
shutdown in interface ProtocolProviderService

unregister

public void unregister()
Mock implementation of the corresponding ProtocolProviderService method.

Specified by:
unregister in interface ProtocolProviderService

isSignalingTransportSecure

public boolean isSignalingTransportSecure()
Description copied from interface: ProtocolProviderService
Indicate if the signaling transport of this protocol instance uses a secure (e.g. via TLS) connection.

Specified by:
isSignalingTransportSecure in interface ProtocolProviderService
Returns:
True when the connection is secured, false otherwise.

getAccountID

public AccountID getAccountID()
Returns the AccountID that uniquely identifies the account represented by this instance of the ProtocolProviderService.

Specified by:
getAccountID in interface ProtocolProviderService
Returns:
the id of the account represented by this provider.

getProtocolIcon

public ProtocolIcon getProtocolIcon()
Mock implementation of the corresponding ProtocolProviderService method. We have no icon corresponding to this protocol provider.

Specified by:
getProtocolIcon in interface ProtocolProviderService
Returns:
the protocol logo icon

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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