mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-04 15:45:58 +01:00
Documentation work.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7330 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
9189d74d0a
commit
f418341e2b
6 changed files with 108 additions and 25 deletions
69
documentation/connections.html
Normal file
69
documentation/connections.html
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Smack: Connection Management - Jive Software</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="style.css"/>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
Smack: Connection Management
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="nav">
|
||||||
|
« <a href="index.html">Table of Contents</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="subheader">
|
||||||
|
Creating a Connection
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The <tt>org.jivesoftware.smack.XMPPConnection</tt> class manages your connection to an XMPP
|
||||||
|
server. Two constructors are available. The first, <tt>XMPPConnection(String)</tt> takes
|
||||||
|
the server name you'd like to connect to as an argument. All default connection settings will
|
||||||
|
be used:
|
||||||
|
<ul>
|
||||||
|
<li>A DNS SRV lookup will be performed to find the exact address and port (typically 5222)
|
||||||
|
that the server resides at.</li>
|
||||||
|
<li>The maximum security possible will be negotiated with the server, including TLS encryption,
|
||||||
|
but the connection will fall back to lower security settings if necessary.
|
||||||
|
</li>
|
||||||
|
<li>The XMPP resource name "Smack" will be used for the connection.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
Alternatively, you can use the <tt>XMPPServer(ConnectionConfiguration)</tt> constructor to
|
||||||
|
specify advanced connection settings. Some of these settings include:
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Manually specify the server address and port of the server rather than using a DNS SRV
|
||||||
|
lookup.</li>
|
||||||
|
<li>Enable connection compression.</li>
|
||||||
|
<li>Customize security settings, such as flagging the connection to require TLS encryption
|
||||||
|
in order to connect.</li>
|
||||||
|
<li>Specify a custom connection resource name such as "Work" or "Home". Every connection
|
||||||
|
by a user to a server must have a unique resource name. For the user "jsmith@example.com", the
|
||||||
|
full address with resource might be "jsmith@example.com/Smack". With unique resource names, a user
|
||||||
|
can be logged into the server from multiple locations at once, or using multiple devices. The
|
||||||
|
presence priority value used with each resource will determine which particular connection
|
||||||
|
receives messages to the bare address ("jsmith@example.com" in our example).</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p class="subheader">
|
||||||
|
Connect and Disconnect
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<br clear="all"/><br><br>
|
||||||
|
|
||||||
|
<div class="footer">
|
||||||
|
Copyright © Jive Software 2002-2007
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -7,7 +7,7 @@
|
||||||
<body>
|
<body>
|
||||||
<div class="header">Smack Extensions Manual</div>
|
<div class="header">Smack Extensions Manual</div>
|
||||||
<p>The XMPP protocol includes a base protocol and many optional extensions
|
<p>The XMPP protocol includes a base protocol and many optional extensions
|
||||||
typically documented as "JEP's". Smack provides the org.jivesoftware.smack
|
typically documented as "XEP's". Smack provides the org.jivesoftware.smack
|
||||||
package for the core XMPP protocol, and the org.jivesoftware.smackx package for
|
package for the core XMPP protocol, and the org.jivesoftware.smackx package for
|
||||||
many of the protocol extensions.</p>
|
many of the protocol extensions.</p>
|
||||||
|
|
||||||
|
@ -18,41 +18,41 @@
|
||||||
|
|
||||||
<table border="0" width="85%" cellspacing="0" cellpadding="3" style="border:1px #bbb solid;">
|
<table border="0" width="85%" cellspacing="0" cellpadding="3" style="border:1px #bbb solid;">
|
||||||
<tr bgcolor="#ddeeff">
|
<tr bgcolor="#ddeeff">
|
||||||
<td><b>Name</b></td><td><b>JEP #</b></td><td><b>Description</b></td>
|
<td><b>Name</b></td><td><b>XEP #</b></td><td><b>Description</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="privatedata.html">Private Data</a></td>
|
<td><a href="privatedata.html">Private Data</a></td>
|
||||||
<td><a href="http://www.jabber.org/jeps/jep-0049.html">JEP-49</a></td>
|
<td><a href="http://www.xmpp.org/extensions/xep-0049.html">XEP-0049</a></td>
|
||||||
<td>Manages private data.</td>
|
<td>Manages private data.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="xhtml.html">XHTML Messages</a></td>
|
<td><a href="xhtml.html">XHTML Messages</a></td>
|
||||||
<td><a href="http://www.jabber.org/jeps/jep-0071.html">JEP-71</a></td>
|
<td><a href="http://www.xmpp.org/extensions/xep-0071.html">XEP-0071</a></td>
|
||||||
<td>Allows send and receiving formatted messages using XHTML.</td>
|
<td>Allows send and receiving formatted messages using XHTML.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="messageevents.html">Message Events</a></td>
|
<td><a href="messageevents.html">Message Events</a></td>
|
||||||
<td><a href="http://www.jabber.org/jeps/jep-0022.html">JEP-22</a></td>
|
<td><a href="http://www.xmpp.org/extensions/xep-0022.html">JEP-0022</a></td>
|
||||||
<td>Requests and responds to message events.</td>
|
<td>Requests and responds to message events.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="dataforms.html">Data Forms</a></td>
|
<td><a href="dataforms.html">Data Forms</a></td>
|
||||||
<td><a href="http://www.jabber.org/jeps/jep-0004.html">JEP-4</a></td>
|
<td><a href="http://www.xmpp.org/extensions/xep-0004.html">JEP-0004</a></td>
|
||||||
<td>Allows to gather data using Forms.</td>
|
<td>Allows to gather data using Forms.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="muc.html">Multi User Chat</a></td>
|
<td><a href="muc.html">Multi User Chat</a></td>
|
||||||
<td><a href="http://www.jabber.org/jeps/jep-0045.html">JEP-45</a></td>
|
<td><a href="http://www.xmpp.org/extensions/xep-0045.html">JEP-0045</a></td>
|
||||||
<td>Allows configuration of, participation in, and administration of individual text-based conference rooms.</td>
|
<td>Allows configuration of, participation in, and administration of individual text-based conference rooms.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="rosterexchange.html">Roster Item Exchange</a></td>
|
<td><a href="rosterexchange.html">Roster Item Exchange</a></td>
|
||||||
<td><a href="http://www.jabber.org/jeps/jep-0093.html">JEP-93</a></td>
|
<td><a href="http://www.xmpp.org/extensions/xep-0093.html">XEP-0093</a></td>
|
||||||
<td>Allows roster data to be shared between users.</td>
|
<td>Allows roster data to be shared between users.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="time.html">Time Exchange</a></td>
|
<td><a href="time.html">Time Exchange</a></td>
|
||||||
<td><a href="http://www.jabber.org/jeps/jep-0090.html">JEP-90</a></td>
|
<td><a href="http://www.xmpp.org/extensions/xep-0090.html">XEP-0090</a></td>
|
||||||
<td>Allows local time information to be shared between users.</td>
|
<td>Allows local time information to be shared between users.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -62,12 +62,12 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="disco.html">Service Discovery</a></td>
|
<td><a href="disco.html">Service Discovery</a></td>
|
||||||
<td><a href="http://www.jabber.org/jeps/jep-0030.html">JEP-30</a></td>
|
<td><a href="http://www.xmpp.org/extensions/xep-0030.html">XEP-0030</a></td>
|
||||||
<td>Allows to discover services in XMPP entities.</td>
|
<td>Allows to discover services in XMPP entities.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="disco.html">File Transfer</a></td>
|
<td><a href="disco.html">File Transfer</a></td>
|
||||||
<td><a href="http://www.jabber.org/jeps/jep-0096.html">JEP-96</a></td>
|
<td><a href="http://www.xmpp.org/extensions/xep-0096.html">XEP-0096</a></td>
|
||||||
<td>Transfer files between two users over XMPP.</td>
|
<td>Transfer files between two users over XMPP.</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Smack: Getting Started - Jive Software</title>
|
<title>Smack: Getting Started - Jive Software</title>
|
||||||
<link rel="stylesheet" type="text/css" href="style.css" /
|
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="header">
|
<div class="header">
|
||||||
Getting Started With Smack
|
Smack: Getting Started
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
|
@ -20,11 +20,24 @@ important classes and concepts.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p class="subheader">
|
<p class="subheader">
|
||||||
Requirements
|
JAR Files and Requirements
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
The only requirement for Smack is JDK 1.5 or later. An XML parser is embedded in the
|
Smack is meant to be easily embedded into any existing JDK 1.5 or later Java application.
|
||||||
smack.jar file and no other third party libraries are required.<p>
|
It has no external dependencies (except for the Jingle voice chat functionality) and is optimized
|
||||||
|
to be as small as possible. The library ships as several JAR files to provide more flexibility
|
||||||
|
over which features applications require:
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><tt>smack.jar</tt> -- provides core XMPP functionality and is the only <b>required</b>
|
||||||
|
library. All XMPP features that are part of the XMPP RFCs are included.</li>
|
||||||
|
<li><tt>smackx.jar</tt> -- support for many of the the extensions (XEPs) defined
|
||||||
|
by the XMPP Standards Foundation, including multi-user chat, file transfer, user search, etc.
|
||||||
|
The extensions are documented in the <a href="extensions/index.html">extensions manual</a>.</li>
|
||||||
|
<li><tt>smackx-debug.jar</tt> -- an enhanced GUI debugger for protocol traffic. It will
|
||||||
|
automatically be used when found in the classpath and when <a href="debugging.html">debugging</a>
|
||||||
|
is enabled.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<p class="subheader">
|
<p class="subheader">
|
||||||
|
@ -48,7 +61,8 @@ conn2.connect();
|
||||||
|
|
||||||
<p>Note that maximum security will be used when connecting to the server by default (and when possible),
|
<p>Note that maximum security will be used when connecting to the server by default (and when possible),
|
||||||
including use of TLS encryption. The ConnectionConfiguration class provides advanced control
|
including use of TLS encryption. The ConnectionConfiguration class provides advanced control
|
||||||
over the connection created, such as the ability to disable or require encryption.</p>
|
over the connection created, such as the ability to disable or require encryption. See
|
||||||
|
<a href="connections.html">Connection Management</a> for full details.</p>
|
||||||
|
|
||||||
<p>Once you've created a connection, you should login using a username and password
|
<p>Once you've created a connection, you should login using a username and password
|
||||||
with the <tt>XMPPConnection.login(String username, String password)</tt> method.
|
with the <tt>XMPPConnection.login(String username, String password)</tt> method.
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="overview.html">Overview</a>
|
<li><a href="overview.html">Overview</a>
|
||||||
<li><a href="gettingstarted.html">Getting Started Guide</a>
|
<li><a href="gettingstarted.html">Getting Started Guide</a>
|
||||||
|
<li><a href="connections.html">Managing Connections</a></li>
|
||||||
<li><a href="messaging.html">Messaging Basics</a>
|
<li><a href="messaging.html">Messaging Basics</a>
|
||||||
<li><a href="roster.html">Roster and Presence</a>
|
<li><a href="roster.html">Roster and Presence</a>
|
||||||
<li><a href="processing.html">Processing Incoming Packets</a>
|
<li><a href="processing.html">Processing Incoming Packets</a>
|
||||||
|
|
|
@ -29,8 +29,7 @@ A chat creates a new thread of messages (using a thread ID) between two users. T
|
||||||
following code snippet demonstrates how to create a new Chat with a user and then send
|
following code snippet demonstrates how to create a new Chat with a user and then send
|
||||||
them a text message:<p>
|
them a text message:<p>
|
||||||
|
|
||||||
<div class="code"><pre><font color="gray"><i>// Assume we've created an XMPPConnection name
|
<div class="code"><pre><font color="gray"><i>// Assume we've created an XMPPConnection name "connection".</i></font>
|
||||||
"connection".</i></font>
|
|
||||||
ChatManager chatmanager = connection.getChatManager();<br>Chat newChat = chatmanager.createChat(<font
|
ChatManager chatmanager = connection.getChatManager();<br>Chat newChat = chatmanager.createChat(<font
|
||||||
color="green">"jsmith@jivesoftware.com"</font>, new MessageListener() {
|
color="green">"jsmith@jivesoftware.com"</font>, new MessageListener() {
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@ Smack Overview
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
Smack is a library for communicating with XMPP servers to perform
|
Smack is a library for communicating with XMPP servers to perform real-time communications, including
|
||||||
instant messaging and chat.<p>
|
instant messaging and group chat.<p>
|
||||||
|
|
||||||
<p class="subheader">
|
<p class="subheader">
|
||||||
Smack Key Advantages
|
Smack Key Advantages
|
||||||
|
@ -58,9 +58,9 @@ chat.sendMessage(<font color="green">"Howdy!"</font>);
|
||||||
About XMPP
|
About XMPP
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
XMPP (eXtensible Messaging and Presence Protocol) is an open, XML based protocol
|
XMPP (eXtensible Messaging and Presence Protocol) is an open protocol standardized by the IETF
|
||||||
making it's way through the IETF approval process under the guidance of the
|
and supported and extended by the XMPP Standards Foundation
|
||||||
Jabber Software Foundation (<a href="http://www.jabber.org">http://www.jabber.org</a>).
|
((<a href="http://www.jabber.org">http://www.xmpp.org</a>).
|
||||||
|
|
||||||
<p class="subheader">
|
<p class="subheader">
|
||||||
How To Use This Documentation
|
How To Use This Documentation
|
||||||
|
|
Loading…
Reference in a new issue