Java Doc for SipManager.java in  » Net » openfire » org » jivesoftware » openfire » sip » tester » stack » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » openfire » org.jivesoftware.openfire.sip.tester.stack 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jivesoftware.openfire.sip.tester.stack.SipManager

SipManager
public class SipManager implements SipListener(Code)
Title: SIP Register Tester
author:
   Thiago Rocha Camargo (thiago@jivesoftware.com)


Field Summary
final protected static  StringDEFAULT_TRANSPORT
    
final protected static  intMAX_FORWARDS
    
final protected static  intRETRY_OBJECT_DELETES
    
final protected static  longRETRY_OBJECT_DELETES_AFTER
    
public  AddressFactoryaddressFactory
    
protected  ContactHeadercontactHeader
    
protected  StringcurrentlyUsedURI
    
protected  StringdisplayName
    
protected  FromHeaderfromHeader
    
public  HeaderFactoryheaderFactory
    
public  booleanisBusy
    
protected  booleanisStarted
    
protected  ArrayList<CommunicationsListener>listeners
    
 ListeningPointlisteningPoint
    
protected  InetAddresslocalAddress
    
protected  intlocalPort
    
protected  MaxForwardsHeadermaxForwardsHeader
    
public  MessageFactorymessageFactory
    
protected  StringregistrarAddress
    
protected  intregistrarPort
    
protected  StringregistrarTransport
    
protected  longregistrationTransaction
    
protected  intregistrationsExpiration
    
public  SipFactorysipFactory
    
public  SipProvidersipProvider
    
public  SipSecurityManagersipSecurityManager
    
 SipStacksipStack
    
protected  StringsipStackPath
    
protected  StringstackAddress
    
protected  StringstackName
    
protected  Stringtransport
    
protected  ArrayList<ViaHeader>viaHeaders
    

Constructor Summary
public  SipManager(InetAddress localAddress)
     Constructor.

Method Summary
public  voidaddCommunicationsListener(CommunicationsListener listener)
     Adds a CommunicationsListener to SipManager.
public  voidattachToTag(Response response, Dialog containingDialog)
     Generates a ToTag (the containingDialog's hashCode())and attaches it to response's ToHeader.
public  voidcacheCredentials(String realm, UserCredentials credentials)
     Adds the specified credentials to the security manager's credentials cache so that they get tried next time they're needed.
protected  voidcheckIfStarted()
    
public  voidfireCommunicationsError(Throwable throwable)
    
 voidfireRegistered(String address)
    
 voidfireRegistering(String address)
    
 voidfireRegistrationFailed(String address, RegistrationEvent.Type type)
    
public  voidfireUnregistered(String address)
    
 voidfireUnregistering(String address)
    
public  ContactHeadergetContactHeader()
    
public  ContactHeadergetContactHeader(boolean useLocalHostAddress)
     Initialises SipManager's contactHeader field in accordance with javax.sip.IP_ADDRESS net.java.mais.sip.DISPLAY_NAME net.java.mais.sip.TRANSPORT net.java.mais.sip.PREFERRED_LOCAL_PORT and returns a reference to it.
Parameters:
  useLocalHostAddress - specifies whether the SipURI in the contact header shouldcontain the value of javax.sip.IP_ADDRESS (true) or that ofnet.java.mais.sip.PUBLIC_ADDRESS (false).
public  FromHeadergetFromHeader()
    
public  FromHeadergetFromHeader(boolean isNew)
    
 StringgetLocalHostAddress()
    
public  StringgetLocalUser()
     Returns the user used to create the From Header URI.
public  ArrayListgetLocalViaHeaders()
     Initializes (if null) and returns an ArrayList with a single ViaHeader containing localhost's address.
public  MaxForwardsHeadergetMaxForwardsHeader()
     Initializes and returns SipManager's maxForwardsHeader field using the value specified by MAX_FORWARDS.
 ContactHeadergetRegistrationContactHeader()
     Same as calling getContactHeader(true).
protected  voidinitProperties()
    
public  booleanisRegistered()
     Queries the RegisterProcessing object whether the application is registered with a registrar.
public  booleanisStarted()
     Determines whether the SipManager was started.
public static  voidmain(String args)
    
public  voidprocessRequest(RequestEvent requestEvent)
    
public  voidprocessResponse(ResponseEvent responseReceivedEvent)
    
public  voidprocessTimeout(TimeoutEvent timeoutEvent)
    
public  voidregister(String publicAddress)
    
 voidsendNotImplemented(ServerTransaction serverTransaction, Request request)
     Sends a NOT_IMPLEMENTED response through the specified transaction.
public  voidsetCurrentlyUsedURI(String uri)
    
protected static  voidsleep(long sleepFor)
     Waits during _no_less_ than sleepFor milliseconds.
public  voidstart()
     Creates and initializes JAIN SIP objects (factories, stack, listening point and provider).
public  voidstartRegisterProcess(String userName, String authUserName, String password)
    
public synchronized  voidstop()
     Unregisters listening points, deletes sip providers, and generally prepares the stack for a re-start().
public  voidunregister()
     Causes the PresenceAgent object to notify all subscribers of our brand new offline status and the RegisterProcessing object to send a registration request with a 0 "expires" interval to the registrar defined in net.java.mais.sip.REGISTRAR_ADDRESS.
throws:
  CommunicationsException - if an exception is thrown by the underlying stack.

Field Detail
DEFAULT_TRANSPORT
final protected static String DEFAULT_TRANSPORT(Code)



MAX_FORWARDS
final protected static int MAX_FORWARDS(Code)



RETRY_OBJECT_DELETES
final protected static int RETRY_OBJECT_DELETES(Code)



RETRY_OBJECT_DELETES_AFTER
final protected static long RETRY_OBJECT_DELETES_AFTER(Code)



addressFactory
public AddressFactory addressFactory(Code)



contactHeader
protected ContactHeader contactHeader(Code)



currentlyUsedURI
protected String currentlyUsedURI(Code)



displayName
protected String displayName(Code)



fromHeader
protected FromHeader fromHeader(Code)



headerFactory
public HeaderFactory headerFactory(Code)



isBusy
public boolean isBusy(Code)



isStarted
protected boolean isStarted(Code)



listeners
protected ArrayList<CommunicationsListener> listeners(Code)



listeningPoint
ListeningPoint listeningPoint(Code)



localAddress
protected InetAddress localAddress(Code)



localPort
protected int localPort(Code)



maxForwardsHeader
protected MaxForwardsHeader maxForwardsHeader(Code)



messageFactory
public MessageFactory messageFactory(Code)



registrarAddress
protected String registrarAddress(Code)



registrarPort
protected int registrarPort(Code)



registrarTransport
protected String registrarTransport(Code)



registrationTransaction
protected long registrationTransaction(Code)



registrationsExpiration
protected int registrationsExpiration(Code)



sipFactory
public SipFactory sipFactory(Code)



sipProvider
public SipProvider sipProvider(Code)



sipSecurityManager
public SipSecurityManager sipSecurityManager(Code)



sipStack
SipStack sipStack(Code)



sipStackPath
protected String sipStackPath(Code)



stackAddress
protected String stackAddress(Code)



stackName
protected String stackName(Code)



transport
protected String transport(Code)



viaHeaders
protected ArrayList<ViaHeader> viaHeaders(Code)




Constructor Detail
SipManager
public SipManager(InetAddress localAddress)(Code)
Constructor. It only creates a SipManager instance without initializing the stack itself.
Parameters:
  localAddress - localAddress




Method Detail
addCommunicationsListener
public void addCommunicationsListener(CommunicationsListener listener)(Code)
Adds a CommunicationsListener to SipManager.
Parameters:
  listener - The CommunicationsListener to be added.



attachToTag
public void attachToTag(Response response, Dialog containingDialog)(Code)
Generates a ToTag (the containingDialog's hashCode())and attaches it to response's ToHeader.
Parameters:
  response - the response that is to get the ToTag.
Parameters:
  containingDialog - the Dialog instance that is to extract a unique Tag value(containingDialog.hashCode())



cacheCredentials
public void cacheCredentials(String realm, UserCredentials credentials)(Code)
Adds the specified credentials to the security manager's credentials cache so that they get tried next time they're needed.
Parameters:
  realm - the realm these credentials should apply for.
Parameters:
  credentials - a set of credentials (username and pass)



checkIfStarted
protected void checkIfStarted() throws CommunicationsException(Code)



fireCommunicationsError
public void fireCommunicationsError(Throwable throwable)(Code)



fireRegistered
void fireRegistered(String address)(Code)



fireRegistering
void fireRegistering(String address)(Code)



fireRegistrationFailed
void fireRegistrationFailed(String address, RegistrationEvent.Type type)(Code)



fireUnregistered
public void fireUnregistered(String address)(Code)



fireUnregistering
void fireUnregistering(String address)(Code)



getContactHeader
public ContactHeader getContactHeader() throws CommunicationsException(Code)
Same as calling getContactHeader(true) the result of getContactHeader(true)
throws:
  CommunicationsException - if an exception is thrown while callinggetContactHeader(false)



getContactHeader
public ContactHeader getContactHeader(boolean useLocalHostAddress) throws CommunicationsException(Code)
Initialises SipManager's contactHeader field in accordance with javax.sip.IP_ADDRESS net.java.mais.sip.DISPLAY_NAME net.java.mais.sip.TRANSPORT net.java.mais.sip.PREFERRED_LOCAL_PORT and returns a reference to it.
Parameters:
  useLocalHostAddress - specifies whether the SipURI in the contact header shouldcontain the value of javax.sip.IP_ADDRESS (true) or that ofnet.java.mais.sip.PUBLIC_ADDRESS (false). a reference to SipManager's contactHeader field.
throws:
  CommunicationsException - if a ParseException occurs while initially composing theFromHeader.



getFromHeader
public FromHeader getFromHeader() throws CommunicationsException(Code)



getFromHeader
public FromHeader getFromHeader(boolean isNew) throws CommunicationsException(Code)



getLocalHostAddress
String getLocalHostAddress()(Code)



getLocalUser
public String getLocalUser()(Code)
Returns the user used to create the From Header URI. the user used to create the From Header URI.



getLocalViaHeaders
public ArrayList getLocalViaHeaders() throws CommunicationsException(Code)
Initializes (if null) and returns an ArrayList with a single ViaHeader containing localhost's address. This ArrayList may be used when sending requests. ViaHeader-s list to be used when sending requests.
throws:
  CommunicationsException - if a ParseException is to occur while initializing the arraylist.



getMaxForwardsHeader
public MaxForwardsHeader getMaxForwardsHeader() throws CommunicationsException(Code)
Initializes and returns SipManager's maxForwardsHeader field using the value specified by MAX_FORWARDS. an instance of a MaxForwardsHeader that can be used when sendingrequests
throws:
  CommunicationsException - if MAX_FORWARDS has an invalid value.



getRegistrationContactHeader
ContactHeader getRegistrationContactHeader() throws CommunicationsException(Code)
Same as calling getContactHeader(true). the result of calling getContactHeader(true).
throws:
  CommunicationsException - if an exception occurs while executinggetContactHeader(true).



initProperties
protected void initProperties()(Code)



isRegistered
public boolean isRegistered()(Code)
Queries the RegisterProcessing object whether the application is registered with a registrar. true if the application is registered with a registrar.



isStarted
public boolean isStarted()(Code)
Determines whether the SipManager was started. true if the SipManager was started.



main
public static void main(String args)(Code)



processRequest
public void processRequest(RequestEvent requestEvent)(Code)



processResponse
public void processResponse(ResponseEvent responseReceivedEvent)(Code)



processTimeout
public void processTimeout(TimeoutEvent timeoutEvent)(Code)



register
public void register(String publicAddress)(Code)



sendNotImplemented
void sendNotImplemented(ServerTransaction serverTransaction, Request request)(Code)
Sends a NOT_IMPLEMENTED response through the specified transaction.
Parameters:
  serverTransaction - the transaction to send the response through.
Parameters:
  request - the request that is being answered.



setCurrentlyUsedURI
public void setCurrentlyUsedURI(String uri)(Code)

Parameters:
  uri - the currentlyUsedURI to set.



sleep
protected static void sleep(long sleepFor)(Code)
Waits during _no_less_ than sleepFor milliseconds. Had to implement it on top of Thread.sleep() to guarantee minimum sleep time.
Parameters:
  sleepFor - the number of miliseconds to wait



start
public void start() throws CommunicationsException(Code)
Creates and initializes JAIN SIP objects (factories, stack, listening point and provider). Once this method is called the application is ready to handle (incoming and outgoing) sip messages.
throws:
  CommunicationsException - if an axception should occur during the initializationprocess



startRegisterProcess
public void startRegisterProcess(String userName, String authUserName, String password) throws CommunicationsException(Code)



stop
public synchronized void stop() throws CommunicationsException(Code)
Unregisters listening points, deletes sip providers, and generally prepares the stack for a re-start(). This method is meant to be used when properties are changed and should be reread by the stack.
throws:
  CommunicationsException - CommunicationsException



unregister
public void unregister() throws CommunicationsException(Code)
Causes the PresenceAgent object to notify all subscribers of our brand new offline status and the RegisterProcessing object to send a registration request with a 0 "expires" interval to the registrar defined in net.java.mais.sip.REGISTRAR_ADDRESS.
throws:
  CommunicationsException - if an exception is thrown by the underlying stack. Theexception that caused this CommunicationsException may beextracted with CommunicationsException.getCause()



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.