|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.service.protocol.AbstractProtocolProviderService
net.java.sip.communicator.impl.protocol.sip.ProtocolProviderServiceSipImpl
public class ProtocolProviderServiceSipImpl
A SIP implementation of the Protocol Provider Service.
| Nested Class Summary | |
|---|---|
protected class |
ProtocolProviderServiceSipImpl.ShutdownThread
The thread that we use in order to send our unREGISTER request upon system shut down. |
| Field Summary |
|---|
| Fields inherited from interface net.java.sip.communicator.service.protocol.ProtocolProviderService |
|---|
BIND_RETRIES_DEFAULT_VALUE, BIND_RETRIES_PROPERTY_NAME |
| Constructor Summary | |
|---|---|
ProtocolProviderServiceSipImpl()
|
|
| Method Summary | ||
|---|---|---|
(package private) void |
addEarlyMessageProcessor(SipMessageProcessor processor)
Registers early message processor. |
|
protected
|
addSupportedOperationSet(Class<T> opsetClass,
T opset)
Adds a specific OperationSet implementation to the set of supported OperationSets of this instance. |
|
(package private) void |
earlyProcessMessage(EventObject message)
Early process an incoming message from interested listeners. |
|
AccountID |
getAccountID()
Returns the AccountID that uniquely identifies the account represented by this instance of the ProtocolProviderService. |
|
gov.nist.javax.sip.address.AddressFactoryEx |
getAddressFactory()
Returns the AddressFactory used to create URLs ans Address objects. |
|
static Set<ProtocolProviderServiceSipImpl> |
getAllInstances()
Returns all running instances of ProtocolProviderServiceSipImpl |
|
ProxyConnection |
getConnection()
Returns the ProxyConnection. |
|
String |
getContactAddressCustomParamValue()
Returns null for a registraless account, a value for the contact address custom parameter otherwise. |
|
javax.sip.header.ContactHeader |
getContactHeader(javax.sip.address.Address intendedDestination)
Returns a Contact header containing a sip URI based on a localhost address. |
|
javax.sip.header.ContactHeader |
getContactHeader(javax.sip.address.SipURI intendedDestination)
Returns a Contact header containing a sip URI based on a localhost address and therefore usable in REGISTER requests only. |
|
javax.sip.SipProvider |
getDefaultJainSipProvider()
Returns the provider that corresponds to the transport returned by getDefaultTransport(). |
|
String |
getDefaultTransport()
Returns the transport that we should use if we have no clear idea of our destination's preferred transport. |
|
javax.sip.header.HeaderFactory |
getHeaderFactory()
Returns the HeaderFactory used to create SIP message headers. |
|
InetSocketAddress |
getIntendedDestination(javax.sip.address.Address destination)
Returns the InetAddress that is most likely to be to be used as a next hop when contacting the specified destination. |
|
InetSocketAddress |
getIntendedDestination(javax.sip.address.SipURI destination)
Returns the InetAddress that is most likely to be to be used as a next hop when contacting the specified destination. |
|
InetSocketAddress |
getIntendedDestination(String host)
Returns the InetAddress that is most likely to be to be used as a next hop when contacting the specified destination. |
|
javax.sip.SipProvider |
getJainSipProvider(String transport)
Returns the default jain sip provider that we use for communication over transport. |
|
List<String> |
getKnownEventsList()
Returns the list of all the registered events for this provider. |
|
javax.sip.ListeningPoint |
getListeningPoint(javax.sip.address.SipURI intendedDestination)
Returns the default listening point that we should use to contact the intended destination. |
|
javax.sip.ListeningPoint |
getListeningPoint(String transport)
Returns the default listening point that we use for communication over transport. |
|
ArrayList<javax.sip.header.ViaHeader> |
getLocalViaHeaders(javax.sip.address.Address intendedDestination)
Initializes and returns an ArrayList with a single ViaHeader containing a localhost address usable with the specified sdestination. |
|
ArrayList<javax.sip.header.ViaHeader> |
getLocalViaHeaders(javax.sip.address.SipURI intendedDestination)
Initializes and returns an ArrayList with a single ViaHeader containing a localhost address usable with the specified sdestination. |
|
javax.sip.header.MaxForwardsHeader |
getMaxForwardsHeader()
Initializes and returns this provider's default maxForwardsHeader field using the value specified by MAX_FORWARDS. |
|
SipMessageFactory |
getMessageFactory()
Returns the Message Factory used to create SIP messages. |
|
String |
getOurDisplayName()
Returns the display name string that the user has set as a display name for this account. |
|
javax.sip.address.Address |
getOurSipAddress(javax.sip.address.Address intendedDestination)
Returns the SIP address of record (Display Name |
|
javax.sip.address.Address |
getOurSipAddress(javax.sip.address.SipURI intendedDestination)
Returns the SIP address of record (Display Name |
|
ProtocolIcon |
getProtocolIcon()
Returns the sip protocol icon. |
|
String |
getProtocolName()
Returns the short name of the protocol that the implementation of this provider is based upon (like SIP, Jabber, ICQ/AIM, or others for example). |
|
(package private) SipRegistrarConnection |
getRegistrarConnection()
Returns the current instance of SipRegistrarConnection. |
|
RegistrationState |
getRegistrationState()
Returns the state of the registration of this protocol provider with the corresponding registration service. |
|
javax.sip.header.UserAgentHeader |
getSipCommUserAgentHeader()
Returns a User Agent header that could be used for signing our requests. |
|
SipSecurityManager |
getSipSecurityManager()
Reurns the currently valid sip security manager that everyone should use to authenticate SIP Requests. |
|
(package private) SipStatusEnum |
getSipStatusEnum()
Returns the current instance of SipStatusEnum. |
|
List<String> |
getSupportedMethods()
Returns a List of Strings corresponding to all methods that we have a processor for. |
|
TransportProtocol |
getTransportProtocol()
Returns the "transport" protocol of this instance used to carry the control channel for the current protocol service. |
|
protected void |
initialize(String sipAddress,
SipAccountID accountID)
Initializes the service implementation, and puts it in a state where it could interoperate with other services. |
|
boolean |
isSignalingTransportSecure()
Indicates if the SIP transport channel is using a TLS secured socket. |
|
static boolean |
isValidTransport(String transport)
Determines whether the supplied transport is a known SIP transport method |
|
protected void |
notifyConnectionFailed()
If somewhere we got for example timeout of receiving answer to our requests we consider problem with network and notify the provider. |
|
javax.sip.address.Address |
parseAddressString(String uriStr)
Parses the the uriStr string and returns a JAIN SIP URI. |
|
void |
processDialogTerminated(javax.sip.DialogTerminatedEvent dialogTerminatedEvent)
Process an asynchronously reported DialogTerminatedEvent. |
|
void |
processIOException(javax.sip.IOExceptionEvent exceptionEvent)
Never called. |
|
void |
processRequest(javax.sip.RequestEvent requestEvent)
Processes a Request received on a SipProvider upon which this SipListener is registered. |
|
void |
processResponse(javax.sip.ResponseEvent responseEvent)
Processes a Response received on a SipProvider upon which this SipListener is registered. |
|
void |
processTimeout(javax.sip.TimeoutEvent timeoutEvent)
Processes a retransmit or expiration Timeout of an underlying Transaction handled by this SipListener. |
|
void |
processTransactionTerminated(javax.sip.TransactionTerminatedEvent transactionTerminatedEvent)
Process an asynchronously reported TransactionTerminatedEvent. |
|
void |
register(SecurityAuthority authority)
Starts the registration process. |
|
void |
registerEvent(String event)
Register a new event taken in account by this provider. |
|
void |
registerMethodProcessor(String method,
MethodProcessor methodProcessor)
Registers methodProcessor in the methorProcessors table so that it would receives all messages in a transaction initiated by a method request. |
|
(package private) boolean |
registerUsingNextAddress()
Finds the next address to retry registering. |
|
void |
registrationStateChanged(RegistrationStateChangeEvent event)
Stops dispatching SIP messages to a SIP protocol provider service once it's been unregistered. |
|
(package private) void |
removeEarlyMessageProcessor(SipMessageProcessor processor)
Removes the early message processor. |
|
protected
|
removeSupportedOperationSet(Class<T> opsetClass)
Removes an OperationSet implementation from the set of supported OperationSets for this instance. |
|
void |
sayError(javax.sip.ServerTransaction serverTransaction,
int errorCode)
Send an error response with the errorCode code using serverTransaction. |
|
void |
sayError(javax.sip.ServerTransaction serverTransaction,
int errorCode,
javax.sip.header.Header header)
Send an error response with the errorCode code using serverTransaction. |
|
void |
sayErrorSilently(javax.sip.ServerTransaction serverTransaction,
int errorCode)
Send an error response with the errorCode code using serverTransaction and do not surface exceptions. |
|
void |
sendAck(javax.sip.ClientTransaction clientTransaction)
Sends an ACK request in the specified dialog. |
|
void |
sendInDialogRequest(javax.sip.SipProvider sipProvider,
javax.sip.message.Request request,
javax.sip.Dialog dialog)
Sends a specific Request through a given SipProvider as part of the conversation associated with a specific Dialog. |
|
(package private) boolean |
setOurDisplayName(String newDisplayName)
Changes the display name string. |
|
void |
shutdown()
Makes the service implementation close all open sockets and release any resources that it might have taken and prepare for shutdown/garbage collection. |
|
static void |
throwOperationFailedException(String message,
int errorCode,
Throwable cause,
Logger logger)
Logs a specific message and associated Throwable cause as an error using the current Logger and then throws a new OperationFailedException with the message, a specific error code and the cause. |
|
void |
unregister()
Ends the registration of this protocol provider with the current registration service. |
|
void |
unregisterMethodProcessor(String method,
MethodProcessor methodProcessor)
Unregisters methodProcessor from the methorProcessors table so that it won't receive further messages in a transaction initiated by a method request. |
|
| Methods inherited from class net.java.sip.communicator.service.protocol.AbstractProtocolProviderService |
|---|
addRegistrationStateChangeListener, clearRegistrationStateChangeListener, fireRegistrationStateChanged, getOperationSet, getProtocolDisplayName, getSupportedOperationSets, isRegistered, removeRegistrationStateChangeListener, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.java.sip.communicator.service.protocol.ProtocolProviderService |
|---|
hashCode |
| Constructor Detail |
|---|
public ProtocolProviderServiceSipImpl()
| Method Detail |
|---|
public AccountID getAccountID()
getAccountID in interface ProtocolProviderServicepublic RegistrationState getRegistrationState()
getRegistrationState in interface ProtocolProviderServicepublic String getProtocolName()
getProtocolName in interface ProtocolProviderServicepublic void registerEvent(String event)
event - The event to registerpublic List<String> getKnownEventsList()
public void register(SecurityAuthority authority)
throws OperationFailedException
register in interface ProtocolProviderServiceauthority - the security authority that will be used for resolving
any security challenges that may be returned during the
registration or at any moment while wer're registered.
OperationFailedException - with the corresponding code it the
registration fails for some reason (e.g. a networking error or an
implementation problem).
public void unregister()
throws OperationFailedException
unregister in interface ProtocolProviderServiceOperationFailedException - with the corresponding code it the
registration fails for some reason (e.g. a networking error or an
implementation problem).
protected void initialize(String sipAddress,
SipAccountID accountID)
throws OperationFailedException,
IllegalArgumentException
sipAddress - the account id/uin/screenname of the account that we're
about to createaccountID - the identifier of the account that this protocol
provider represents.
OperationFailedException - with code INTERNAL_ERROR if we fail
initializing the SIP Stack.
IllegalArgumentException - if one or more of the account
properties have invalid values.AccountID
protected <T extends OperationSet> void addSupportedOperationSet(Class<T> opsetClass,
T opset)
AbstractProtocolProviderService.supportedOperationSets which works with class
names instead of Class and also shortens the code which performs
such additions.
addSupportedOperationSet in class AbstractProtocolProviderServiceT - the exact type of the OperationSet implementation to
be addedopsetClass - the Class of OperationSet under the
name of which the specified implementation is to be addedopset - the OperationSet implementation to be addedprotected <T extends OperationSet> void removeSupportedOperationSet(Class<T> opsetClass)
removeSupportedOperationSet in class AbstractProtocolProviderServiceT - the exact type of the OperationSet implementation to
be addedopsetClass - the Class of OperationSet under the
name of which the specified implementation is to be addedpublic void processIOException(javax.sip.IOExceptionEvent exceptionEvent)
processIOException in interface javax.sip.SipListenerexceptionEvent - the IOExceptionEvent containing the cause.public void processResponse(javax.sip.ResponseEvent responseEvent)
processResponse in interface javax.sip.SipListenerresponseEvent - the responseEvent fired from the SipProvider to the
SipListener representing a Response received from the network.public void processTimeout(javax.sip.TimeoutEvent timeoutEvent)
Transaction handled by this SipListener. This Event notifies the
application that a retransmission or transaction Timer expired in the
SipProvider's transaction state machine. The TimeoutEvent encapsulates
the specific timeout type and the transaction identifier either client or
server upon which the timeout occurred. The type of Timeout can by
determined by:
timeoutType = timeoutEvent.getTimeout().getValue();
processTimeout in interface javax.sip.SipListenertimeoutEvent - -
the timeoutEvent received indicating either the message
retransmit or transaction timed out.public void processTransactionTerminated(javax.sip.TransactionTerminatedEvent transactionTerminatedEvent)
processTransactionTerminated in interface javax.sip.SipListenertransactionTerminatedEvent - -- an event that indicates that the
transaction has transitioned into the terminated state.public void processDialogTerminated(javax.sip.DialogTerminatedEvent dialogTerminatedEvent)
processDialogTerminated in interface javax.sip.SipListenerdialogTerminatedEvent - -- an event that indicates that the
dialog has transitioned into the terminated state.public void processRequest(javax.sip.RequestEvent requestEvent)
processRequest in interface javax.sip.SipListenerrequestEvent - requestEvent fired from the SipProvider to the
SipListener representing a Request received from the network.public void shutdown()
shutdown in interface ProtocolProviderService
public ArrayList<javax.sip.header.ViaHeader> getLocalViaHeaders(javax.sip.address.Address intendedDestination)
throws OperationFailedException
intendedDestination - The address of the destination that the
request using the via headers will be sent to.
OperationFailedException - code INTERNAL_ERROR if a ParseException
occurs while initializing the array list.
public ArrayList<javax.sip.header.ViaHeader> getLocalViaHeaders(javax.sip.address.SipURI intendedDestination)
throws OperationFailedException
intendedDestination - The address of the destination that the
request using the via headers will be sent to.
OperationFailedException - code INTERNAL_ERROR if a ParseException
occurs while initializing the array list.
public javax.sip.header.MaxForwardsHeader getMaxForwardsHeader()
throws OperationFailedException
OperationFailedException - with code INTERNAL_ERROR if MAX_FORWARDS
has an invalid value.public javax.sip.header.ContactHeader getContactHeader(javax.sip.address.Address intendedDestination)
intendedDestination - the destination that we plan to be sending
this contact header to.
public javax.sip.header.ContactHeader getContactHeader(javax.sip.address.SipURI intendedDestination)
intendedDestination - the destination that we plan to be sending
this contact header to.
public String getContactAddressCustomParamValue()
public gov.nist.javax.sip.address.AddressFactoryEx getAddressFactory()
public javax.sip.header.HeaderFactory getHeaderFactory()
public SipMessageFactory getMessageFactory()
public static Set<ProtocolProviderServiceSipImpl> getAllInstances()
public javax.sip.ListeningPoint getListeningPoint(String transport)
transport - the transport that the returned listening point needs
to support.
public javax.sip.ListeningPoint getListeningPoint(javax.sip.address.SipURI intendedDestination)
intendedDestination - the address that we will be trying to contact
through the listening point we are trying to obtain.
public javax.sip.SipProvider getJainSipProvider(String transport)
transport - the transport that the returned provider needs
to support.
public SipSecurityManager getSipSecurityManager()
public javax.sip.address.Address getOurSipAddress(javax.sip.address.Address intendedDestination)
intendedDestination - the destination that we would be using the
local address to communicate with.
public javax.sip.address.Address getOurSipAddress(javax.sip.address.SipURI intendedDestination)
intendedDestination - the destination that we would be using the
local address to communicate with.
.
public ProxyConnection getConnection()
public boolean isSignalingTransportSecure()
isSignalingTransportSecure in interface ProtocolProviderServicepublic TransportProtocol getTransportProtocol()
getTransportProtocol in interface ProtocolProviderService
public void registerMethodProcessor(String method,
MethodProcessor methodProcessor)
method - a String representing the SIP method that we're registering
the processor for (e.g. INVITE, REGISTER, or SUBSCRIBE).methodProcessor - a MethodProcessor implementation that
would handle all messages received within a method
transaction.
public void unregisterMethodProcessor(String method,
MethodProcessor methodProcessor)
method - the name of the method whose processor we'd like to
unregister.methodProcessor - the MethodProcessor that we'd like to
unregister.public String getDefaultTransport()
public javax.sip.SipProvider getDefaultJainSipProvider()
public String getOurDisplayName()
boolean setOurDisplayName(String newDisplayName)
public javax.sip.header.UserAgentHeader getSipCommUserAgentHeader()
public void sayErrorSilently(javax.sip.ServerTransaction serverTransaction,
int errorCode)
serverTransaction - the transaction that we'd like to send an error
response in.errorCode - the code that the response should have.
public void sendAck(javax.sip.ClientTransaction clientTransaction)
throws javax.sip.SipException,
javax.sip.InvalidArgumentException
clientTransaction - the transaction that resulted in the ACK we are
about to send (MUST be an INVITE transaction).
javax.sip.InvalidArgumentException - if there is a problem with the supplied
CSeq ( for example <= 0 ).
javax.sip.SipException - if the CSeq does not relate to a previously sent
INVITE or if the Method that created the Dialog is not an INVITE ( for
example SUBSCRIBE) or if we fail to send the INVITE for whatever reason.
public void sayError(javax.sip.ServerTransaction serverTransaction,
int errorCode)
throws OperationFailedException
serverTransaction - the transaction that we'd like to send an error
response in.errorCode - the code that the response should have.
OperationFailedException - if we failed constructing or sending a
SIP Message.
public void sayError(javax.sip.ServerTransaction serverTransaction,
int errorCode,
javax.sip.header.Header header)
throws OperationFailedException
serverTransaction - the transaction that we'd like to send an error
response in.errorCode - the code that the response should have.header - SIP header
OperationFailedException - if we failed constructing or sending a
SIP Message.
public void sendInDialogRequest(javax.sip.SipProvider sipProvider,
javax.sip.message.Request request,
javax.sip.Dialog dialog)
throws OperationFailedException
sipProvider - the SipProvider to send the specified
request throughrequest - the Request to send through
sipProviderdialog - the Dialog as part of which the specified
request is to be sent
OperationFailedException - if creating a transaction or sending
the request fails.public List<String> getSupportedMethods()
public ProtocolIcon getProtocolIcon()
getProtocolIcon in interface ProtocolProviderServiceSipStatusEnum getSipStatusEnum()
SipRegistrarConnection getRegistrarConnection()
public javax.sip.address.Address parseAddressString(String uriStr)
throws ParseException
uriStr - a String containing the uri to parse.
ParseException - if uriStr is not properly formatted.
public InetSocketAddress getIntendedDestination(javax.sip.address.Address destination)
throws IllegalArgumentException
destination - the destination that we would contact.
IllegalArgumentException - if destination is not a valid
host/ip/fqdn
public InetSocketAddress getIntendedDestination(javax.sip.address.SipURI destination)
throws IllegalArgumentException
destination - the destination that we would contact.
IllegalArgumentException - if destination is not a valid
host/ip/fqdn
public InetSocketAddress getIntendedDestination(String host)
throws IllegalArgumentException
host - the destination that we would contact.
IllegalArgumentException - if destination is not a valid
host/ip/fqdn.public void registrationStateChanged(RegistrationStateChangeEvent event)
registrationStateChanged in interface RegistrationStateChangeListenerevent - the change event in the registration state of a provider.
public static void throwOperationFailedException(String message,
int errorCode,
Throwable cause,
Logger logger)
throws OperationFailedException
message - the message to be logged and then wrapped in a new
OperationFailedExceptionerrorCode - the error code to be assigned to the new
OperationFailedExceptioncause - the Throwable that has caused the necessity to log
an error and have a new OperationFailedException thrownlogger - the logger that we'd like to log the error message
and cause.
OperationFailedException - the exception that we wanted this method
to throw.void addEarlyMessageProcessor(SipMessageProcessor processor)
processor - early message processor.void removeEarlyMessageProcessor(SipMessageProcessor processor)
processor - early message processor.void earlyProcessMessage(EventObject message)
message - the message to process.boolean registerUsingNextAddress()
protected void notifyConnectionFailed()
public static boolean isValidTransport(String transport)
transport - the SIP transport to check
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||