Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.sip.MethodProcessorAdapter
      extended by net.java.sip.communicator.impl.protocol.sip.SipRegistrarConnection
          extended by net.java.sip.communicator.impl.protocol.sip.SipRegistrarlessConnection
All Implemented Interfaces:
MethodProcessor

public class SipRegistrarlessConnection
extends SipRegistrarConnection

Allows SIP communicator to create SIP accounts without a registrar. We use this class as a replacement of the SipRegistrarConnection for accounts that do not have a configured registrar.

Author:
Emil Ivov

Field Summary
 
Fields inherited from class net.java.sip.communicator.impl.protocol.sip.SipRegistrarConnection
regTrans
 
Constructor Summary
SipRegistrarlessConnection(ProtocolProviderServiceSipImpl sipProviderCallback, String defaultTransport)
          Creates a new instance of this class.
 
Method Summary
 javax.sip.SipProvider getJainSipProvider()
          Returns the default jain-sip provider for our parent provider.
 RegistrationState getRegistrationState()
          Returns the state of this connection.
 String getTransport()
          Returns the default transport for our parent provider.
 boolean isRegistrarless()
          Returns true if this is a fake connection that is not actually using a registrar.
(package private)  void register()
          Simply sets the state of the connection to REGISTERED without doing anything else.
 void setRegistrationState(RegistrationState newState, int reasonCode, String reason)
          Sets our registration state to newState and dispatches an event through the protocol provider service impl.
 String toString()
          Returns a string representation of this connection instance instance including information that would permit to distinguish it among other sip listeners when reading a log file.
 void unregister()
          Simply sets the state of the connection to UNREGISTERED without doing anything else.
 
Methods inherited from class net.java.sip.communicator.impl.protocol.sip.SipRegistrarConnection
getAddressOfRecord, getRegistrarURI, isRequestFromSameConnection, isRouteHeaderEnabled, processIOException, processNotImplemented, processOK, processRequest, processResponse, processTimeout, setTransport
 
Methods inherited from class net.java.sip.communicator.impl.protocol.sip.MethodProcessorAdapter
processDialogTerminated, processTransactionTerminated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SipRegistrarlessConnection

public SipRegistrarlessConnection(ProtocolProviderServiceSipImpl sipProviderCallback,
                                  String defaultTransport)
Creates a new instance of this class.

Parameters:
sipProviderCallback - a reference to the ProtocolProviderServiceSipImpl instance that created us.
defaultTransport - the transport that we should fake to be using in case some of the other components in the sip package wants to use it as a default.
Method Detail

register

void register()
        throws OperationFailedException
Simply sets the state of the connection to REGISTERED without doing anything else.

Overrides:
register in class SipRegistrarConnection
Throws:
OperationFailedException - never thrown

unregister

public void unregister()
                throws OperationFailedException
Simply sets the state of the connection to UNREGISTERED without doing anything else.

Overrides:
unregister in class SipRegistrarConnection
Throws:
OperationFailedException - never thrown.

getRegistrationState

public RegistrationState getRegistrationState()
Returns the state of this connection.

Overrides:
getRegistrationState in class SipRegistrarConnection
Returns:
a RegistrationState instance indicating the state of our registration with the corresponding registrar.

setRegistrationState

public void setRegistrationState(RegistrationState newState,
                                 int reasonCode,
                                 String reason)
Sets our registration state to newState and dispatches an event through the protocol provider service impl.

Overrides:
setRegistrationState in class SipRegistrarConnection
Parameters:
newState - a reference to the RegistrationState that we're currently detaining.
reasonCode - one of the REASON_XXX error codes specified in RegistrationStateChangeEvent.
reason - a reason String further explaining the reasonCode.

getJainSipProvider

public javax.sip.SipProvider getJainSipProvider()
Returns the default jain-sip provider for our parent provider.

Overrides:
getJainSipProvider in class SipRegistrarConnection
Returns:
the default jain-sip provider for our parent provider.

getTransport

public String getTransport()
Returns the default transport for our parent provider.

Overrides:
getTransport in class SipRegistrarConnection
Returns:
the default transport for our parent provider.

toString

public String toString()
Returns a string representation of this connection instance instance including information that would permit to distinguish it among other sip listeners when reading a log file.

Overrides:
toString in class SipRegistrarConnection
Returns:
a string representation of this operation set.

isRegistrarless

public boolean isRegistrarless()
Returns true if this is a fake connection that is not actually using a registrar. This method should be overridden in SipRegistrarlessConnection and return true in there.

Overrides:
isRegistrarless in class SipRegistrarConnection
Returns:
true if this connection is really using a registrar and false if it is a fake connection that doesn't really use a registrar.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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