⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 x3625.htm

📁 Its a xmpp protocol book
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<TT
CLASS="LITERAL"
>conference.jabber.org</TT
>. The
<TT
CLASS="LITERAL"
>resource</TT
> is the long hex number which represents an individual room participant. It's a hexadecimal SHA1 message digest of their JID, designed to be unique,
and calculated and assigned by the conferencing component as a user enters the room.
<A
NAME="AEN3726"
HREF="#FTN.AEN3726"
>[2]</A
></P
></DD
></DL
></DIV
><TABLE
CLASS="SIDEBAR"
BORDER="1"
CELLPADDING="5"
><TR
><TD
><DIV
CLASS="SIDEBAR"
><A
NAME="JABTDG-CH-5-SB-1"
></A
><P
><B
>Components, Hostnames, and Users</B
></P
><P
>In the <I
CLASS="EMPHASIS"
>Client software identification</I
>
example of a JID being used to carry software version information,
we have a presence packet addressed to a JID using the following form:</P
><P
><PRE
CLASS="SCREEN"
>959967024@update.jabber.org/1.6.0.3</PRE
></P
><P
>But why doesn't the presence packet end up getting sent to a user called
<TT
CLASS="LITERAL"
>959967024</TT
>? The short answer
is because the Jabber Session Manager (JSM) component isn't running at
<TT
CLASS="LITERAL"
>update.jabber.org</TT
>.</P
><P
>Instead, the server is running a special component
that provides a version information service, and has no concept
of user sessions as such. This component
receives the presence packet&mdash;which doesn't go any further (i.e., it isn't punted on to somewhere else)&mdash;and then inspects the username and resource before performing the database lookup to see if their software needs to be updated.</P
><P
>So we see that just because a JID might have something defined for the
<TT
CLASS="LITERAL"
>username@</TT
> part, it doesn't necessarily
mean there's a user at the end of the line. It just serves as a
carrier of unique information embedded in the JID to whichever component
is listening for packets to the <TT
CLASS="LITERAL"
>hostname</TT
>.</P
></DIV
></TD
></TR
></TABLE
><P
>As you can see, JIDs are flexible identifiers used throughout
Jabber to give addressability to various entities. In the context of
the JSM and user management, the address structure
<TT
CLASS="LITERAL"
>username@hostname</TT
> has many parallels
with email addressing, and indeed not without reason. In the context
of individual users, an email address represents a user on a specific
email server. This server is their "home", their mailbox to which everything
addressed to their email address is routed. Different email users have 
different home mailboxes. In the same way, the JIDs of different Jabber
users reflect each user's home Jabber server, to which everything addressed
to their JID is routed. A message addressed by a user based on one Jabber server
to a user based on another Jabber server is automatically routed from the one
server to the other. </P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="JABTDG-CH-5-SECT-5.1.1"
>Rules and Regulations</A
></H2
><P
>A JID <I
CLASS="EMPHASIS"
>must</I
> contain a
<TT
CLASS="LITERAL"
>hostname</TT
> part to be valid. The
<TT
CLASS="LITERAL"
>username</TT
> and
<TT
CLASS="LITERAL"
>resource</TT
> parts are optional; circumstance
and usage dictates where either of these parts are necessary.
A <TT
CLASS="LITERAL"
>username</TT
> is specific to the hostname that
it's paired up with. For example:</P
><P
><PRE
CLASS="SCREEN"
>qmacro@jabber.org</PRE
></P
><P
>is not the same as:</P
><P
><PRE
CLASS="SCREEN"
>qmacro@jabber.com</PRE
></P
><P
>There are some restrictions on how each JID part is composed;
<A
HREF="x3625.htm#JABTDG-CH-5-TAB-1"
>Table 5-1</A
> details these restrictions.
Although you can be particular about the case of letters in a
<TT
CLASS="LITERAL"
>username</TT
>, any operations
(such as comparisons) at the Jabber server are case-insensitive.
For example, if a user has registered <TT
CLASS="LITERAL"
>dj</TT
> as their
username, then another user cannot register
with the username <TT
CLASS="LITERAL"
>DJ</TT
>.
However, the person who registered as <TT
CLASS="LITERAL"
>dj</TT
> can connect and send <TT
CLASS="LITERAL"
>DJ</TT
>
when he authenticates, and for the duration of that session will be
known as <TT
CLASS="LITERAL"
>DJ</TT
> not <TT
CLASS="LITERAL"
>dj</TT
>.</P
><P
>On the other hand, resources <I
CLASS="EMPHASIS"
>are</I
> case-sensitive.</P
><DIV
CLASS="TABLE"
><A
NAME="JABTDG-CH-5-TAB-1"
></A
><P
><B
>Table 5-1. JID restrictions</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><THEAD
><TR
><TH
ALIGN="LEFT"
VALIGN="TOP"
>JID part</TH
><TH
ALIGN="LEFT"
VALIGN="TOP"
>Restrictions</TH
></TR
></THEAD
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>username</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>A <TT
CLASS="LITERAL"
>username</TT
> can be up to 255 characters
in length, and may not contain any ASCII character under 33 (decimal),
<A
NAME="AEN3780"
HREF="#FTN.AEN3780"
>[a]</A
>
nor can it contain any of the characters
<TT
CLASS="LITERAL"
>:</TT
>,
<TT
CLASS="LITERAL"
>@</TT
>,
<TT
CLASS="LITERAL"
>"</TT
> or
<TT
CLASS="LITERAL"
>'</TT
>; also whitespace (tabs,
newlines, and carriage-returns) and control characters are forbidden.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>hostname</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>The same restrictions apply here as for normal DNS hostnames.</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>resource</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>There are no restrictions for the
<TT
CLASS="LITERAL"
>resource</TT
> part of a JID.</TD
></TR
></TBODY
><TR
><TD
COLSPAN="2"
>Notes:<BR><A
NAME="FTN.AEN3780"
>a. </A
>that is, it may not contain spaces or those considered to be control characters<BR></TD
></TR
></TABLE
></DIV
></DIV
></DIV
><H3
CLASS="FOOTNOTES"
>Notes</H3
><TABLE
BORDER="0"
CLASS="FOOTNOTES"
WIDTH="100%"
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN3715"
HREF="x3625.htm#AEN3715"
>[1]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>This administrative information about online users on a Jabber server can be 
retrieved by sending the IQ-get element shown in the example. However, the information
is only forthcoming if the user making the request&mdash;sending the IQ-get
element&mdash;is <I
CLASS="EMPHASIS"
>administrative</I
> user. See the 
<A
HREF="x1740.htm#JABTDG-CH-4-SECT-4.3.1.3.5"
>the section called <I
>Administration</I
> in Chapter 4</A
> for details on administrative users.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN3726"
HREF="x3625.htm#AEN3726"
>[2]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>This is to shield the participant's real identity, which is the default
setting for a conference room.</P
></TD
></TR
></TABLE
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="c3612.htm"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.htm"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x3795.htm"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Jabber Technology Basics</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c3612.htm"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Resources and Priority</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -