[jboss-cvs] JBossAS SVN: r70759 - projects/docs/trunk/AS_4/Server_Configuration_Guide/zh-CN.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Mar 12 05:07:48 EDT 2008


Author: xhuang at jboss.com
Date: 2008-03-12 05:07:48 -0400 (Wed, 12 Mar 2008)
New Revision: 70759

Modified:
   projects/docs/trunk/AS_4/Server_Configuration_Guide/zh-CN/J2EE_Security_On_JBOSS.po
Log:
update

Modified: projects/docs/trunk/AS_4/Server_Configuration_Guide/zh-CN/J2EE_Security_On_JBOSS.po
===================================================================
--- projects/docs/trunk/AS_4/Server_Configuration_Guide/zh-CN/J2EE_Security_On_JBOSS.po	2008-03-12 07:54:34 UTC (rev 70758)
+++ projects/docs/trunk/AS_4/Server_Configuration_Guide/zh-CN/J2EE_Security_On_JBOSS.po	2008-03-12 09:07:48 UTC (rev 70759)
@@ -1,4 +1,3 @@
-# translation of J2EE_Security_On_JBOSS.po to Simplified Chinese
 # translation of J2EE_Security_On_JBOSS.po to
 # Language /tmp/mike/JBEAP420/JBAS translations for JBEAP package.
 # Copyright (C) 2007, 2008 Free Software Foundation, Inc.
@@ -10,9 +9,9 @@
 "Project-Id-Version: J2EE_Security_On_JBOSS\n"
 "Report-Msgid-Bugs-To: http://bugs.kde.org\n"
 "POT-Creation-Date: 2007-11-05 06:04+0000\n"
-"PO-Revision-Date: 2008-03-10 14:02+1000\n"
+"PO-Revision-Date: 2008-03-12 17:50+1000\n"
 "Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
-"Language-Team: Simplified Chinese <en at li.org>\n"
+"Language-Team:  <zh at li.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -1342,6 +1341,8 @@
 "<literal>LoginModule</literal>s associate relevant principals and "
 "credentials with the subject."
 msgstr ""
+"login 方法调用所有加载的 <literal>LoginModule</literal>。当每个 <literal>LoginModule</literal> 试图验证 Subject 时,它调用 <literal>CallbackHandler</"
+"literal> 关联的 handle 方法来获取验证过程所需的信息。这些信息以 <literal>Callback</literal> 对象数组的形式被传递给 handle 方法。如果验证成功,<literal>LoginModule</literal> 将把相关的 principal 和 credential 和该 Subject 进行关联。"
 
 #. Tag: para
 #: J2EE_Security_On_JBOSS.xml:318
@@ -1351,7 +1352,7 @@
 "application. Success is represented by a return from the login method. "
 "Failure is represented through a LoginException being thrown by the login "
 "method."
-msgstr ""
+msgstr "<literal>LoginContext</literal> 把验证状态返回给应用程序。login 方法正常返回则代表成功,而抛出 LoginException 则表示验证失败。"
 
 #. Tag: para
 #: J2EE_Security_On_JBOSS.xml:323
@@ -1359,7 +1360,7 @@
 msgid ""
 "If authentication succeeds, the application retrieves the authenticated "
 "subject using the <literal>LoginContext.getSubject</literal> method."
-msgstr ""
+msgstr "如果验证成功,应用程序通过 <literal>LoginContext.getSubject</literal> 方法获取验证过的 Subject。"
 
 #. Tag: para
 #: J2EE_Security_On_JBOSS.xml:328
@@ -1368,7 +1369,7 @@
 "After the scope of the subject authentication is complete, all principals "
 "and related information associated with the subject by the login method can "
 "be removed by invoking the <literal>LoginContext.logout</literal> method."
-msgstr ""
+msgstr "在验证完成后,所有的 Principal 和相关的信息都可以调用 <literal>LoginContext.logout</literal> 方法来清除。"
 
 #. Tag: para
 #: J2EE_Security_On_JBOSS.xml:333
@@ -1383,7 +1384,7 @@
 "authentication services. Therefore, you can plug different login modules "
 "into an application without changing the application itself. The following "
 "code shows the steps required by an application to authenticate a subject."
-msgstr ""
+msgstr "<literal>LoginContext</literal> 类为 subject 验证提供基本的方法,它也提供一种独立于底层验证技术的程序开发途径。<literal>LoginContext</literal> 通过 <literal>Configuration</literal> 来决定特定应用程序所配置的验证服务。<literal>LoginModule</literal> 类代表验证服务。因此,你可以把不同的登录模块插入到应用程序而不需要修改应用程序本身。下面的代码展示了应用程序验证一个 Subject 所需的步骤。"
 
 #. Tag: programlisting
 #: J2EE_Security_On_JBOSS.xml:336
@@ -1434,6 +1435,50 @@
 "    }\n"
 "}"
 msgstr ""
+"CallbackHandler handler = new MyHandler();\n"
+"LoginContext lc = new LoginContext(\"some-config\", handler);\n"
+"\n"
+"try {\n"
+"    lc.login();\n"
+"    Subject subject = lc.getSubject();\n"
+"} catch(LoginException e) {\n"
+"    System.out.println(\"authentication failed\");\n"
+"    e.printStackTrace();\n"
+"}\n"
+"                        \n"
+"// Perform work as authenticated Subject\n"
+"// ...\n"
+"\n"
+"// Scope of work complete, logout to remove authentication info\n"
+"try {\n"
+"    lc.logout();\n"
+"} catch(LoginException e) {\n"
+"    System.out.println(\"logout failed\");\n"
+"    e.printStackTrace();\n"
+"}\n"
+"                        \n"
+"// A sample MyHandler class\n"
+"class MyHandler \n"
+"    implements CallbackHandler\n"
+"{\n"
+"    public void handle(Callback[] callbacks) throws\n"
+"        IOException, UnsupportedCallbackException\n"
+"    {\n"
+"        for (int i = 0; i &lt; callbacks.length; i++) {\n"
+"            if (callbacks[i] instanceof NameCallback) {\n"
+"                NameCallback nc = (NameCallback)callbacks[i];\n"
+"                nc.setName(username);\n"
+"            } else if (callbacks[i] instanceof PasswordCallback) {\n"
+"                PasswordCallback pc = (PasswordCallback)callbacks[i];\n"
+"                pc.setPassword(password);\n"
+"            } else {\n"
+"                throw new UnsupportedCallbackException(callbacks[i],\n"
+"                                                       \"Unrecognized "
+"Callback\");\n"
+"            }\n"
+"        }\n"
+"    }\n"
+"}"
 
 #. Tag: para
 #: J2EE_Security_On_JBOSS.xml:337
@@ -1447,7 +1492,7 @@
 "authentication process. For example, one <literal>LoginModule</literal> may "
 "perform username/password-based authentication, while another may interface "
 "to hardware devices such as smart card readers or biometric authenticators."
-msgstr ""
+msgstr "开发人员通过创建 <literal>LoginModule</literal> 接口的实现来集成验证技术。这允许管理员把不同的验证技术插入到应用程序里。你可以把多个 <literal>LoginModule</literal> 链接在一起来,这样就允许多种验证技术应用在验证过程中。例如,某个 <literal>LoginModule</literal> 可以执行基于用户名/密码的验证,而另外一个则可以和硬件设备进行交互,人智能卡阅读器或进行生物统计学验证。"
 
 #. Tag: para
 #: J2EE_Security_On_JBOSS.xml:340
@@ -1457,7 +1502,7 @@
 "<literal>LoginContext</literal> object against which the client creates and "
 "issues the login method. The process consists of two phases. The steps of "
 "the process are as follows:"
-msgstr ""
+msgstr "<literal>LoginModule</literal> 的生命周期由客户用来创建和执行 login 方法的 <literal>LoginContext</literal> 对象驱动。这个过程包括两个阶段。其步骤如下:"
 
 #. Tag: para
 #: J2EE_Security_On_JBOSS.xml:345
@@ -1465,7 +1510,7 @@
 msgid ""
 "The <literal>LoginContext</literal> creates each configured "
 "<literal>LoginModule</literal> using its public no-arg constructor."
-msgstr ""
+msgstr "<literal>LoginContext</literal> 使用其公有的无参构造函数来创建每个 <literal>LoginModule</literal>。"
 
 #. Tag: para
 #: J2EE_Security_On_JBOSS.xml:350
@@ -1477,6 +1522,9 @@
 "initialize(Subject subject, CallbackHandler callbackHandler, Map "
 "sharedState, Map options)</literal>."
 msgstr ""
+"每个 <literal>LoginModule</literal> 都通过 initialize 方法进行初始化。<literal>Subject</literal> 参数必须为非空值。initialize 方法的 signature 为:<literal>public void "
+"initialize(Subject subject, CallbackHandler callbackHandler, Map "
+"sharedState, Map options)</literal>。"
 
 #. Tag: para
 #: J2EE_Security_On_JBOSS.xml:355
@@ -1494,7 +1542,7 @@
 "<literal>LoginException</literal> indicates failure. A return value of true "
 "indicates that the method succeeded, whereas a return valueof false "
 "indicates that the login module should be ignored."
-msgstr ""
+msgstr "调用 <literal>login</literal> 方法可以启动验证过程。例如,它可以提示允许输入用户名和密码并根据命名服务(如 NIS 或 LDAP)里存储的数据进行验证。其他实现方法可以和智能卡和生物设备进行交互,或者简单地从底层操作系统抽取用户信息。每个 <literal>LoginModule</literal> 验证的用户标识都被认为是 JAAS 验证的第一阶段。<literal>login</literal> 方法的 signature 是 <literal>boolean login() throws LoginException</literal>。<literal>LoginException</literal> 表示验证失败。返回值为 true 表示方法调用成功,而 false 则表示应该忽略登录模块。"
 
 #. Tag: para
 #: J2EE_Security_On_JBOSS.xml:360
@@ -1514,6 +1562,10 @@
 "method succeeded, whereas a return of false indicates that the login module "
 "should be ignored."
 msgstr ""
+"如果 <literal>LoginContext</literal> 验证通过了,每个 <literal>LoginModule</"
+"literal> 的 <literal>commit</literal> 方法都会被调用。如果 <literal>LoginModule</"
+"literal> 的第一阶段成功了,则 commit 方法将继续第二阶段并把相关的 principal、public credential、和/或 private credential 和该 subject 进行关联。如果 <literal>LoginModule</"
+"literal> 的第一阶段失败了,则 <literal>commit</literal> 把任何之前存储的验证状态清除,如用户名或密码。<literal>commit</literal> 方法的 signature 是:<literal>boolean commit() throws LoginException</literal>。如果 commit 阶段没有完成,<literal>LoginException</literal> 将被抛出。返回值为 true 表示方法调用成功,而 false 则表示应该忽略该登录模块。"
 
 #. Tag: para
 #: J2EE_Security_On_JBOSS.xml:365
@@ -1529,7 +1581,7 @@
 "<literal>LoginException</literal>. A return of true indicates that the "
 "method succeeded, whereas a return of false indicates that the login module "
 "should be ignored."
-msgstr ""
+msgstr "如果 <literal>LoginContext</literal> 的总体验证失败了,每个 <literal>LoginModule</literal> 里的 <literal>abort</literal> 将被调用。<literal>abort</literal> 方法清除或销毁 login 或 initalize 方法创建的任何验证状态。<literal>abort</literal> 方法的 signature 是 <literal>boolean abort() throws LoginException</literal>。<literal>abort</literal> 阶段如果没有完成,则会抛出 <literal>LoginException</literal>。返回值为 true 表示方法调用成功,而 false 则表示应该忽略该登录模块。"
 
 #. Tag: para
 #: J2EE_Security_On_JBOSS.xml:370
@@ -1547,7 +1599,7 @@
 "<literal>LoginException</literal>. A return of true indicates that the "
 "method succeeded, whereas a return of false indicates that the login module "
 "should be ignored."
-msgstr ""
+msgstr "在成功登录后,如果要删除验证状态,应用程序可以调用 <literal>LoginContext</literal> 上的 <literal>logout</literal> 方法。这会导致对每个 <literal>LoginModule</literal> 上的 <literal>logout</literal> 方法的调用。<literal>logout</literal> 方法删除原来在 <literal>commit</literal> 阶段和 subject 相关联的 principal 和 credential。删除后 Credential 应该被销毁。<literal>logout</literal> 方法的 signature 是 <literal>boolean logout() throws LoginException</literal>。返回值为 true 表示方法调用成功,而 false 则表示应该忽略该登录模块。"
 
 #. Tag: para
 #: J2EE_Security_On_JBOSS.xml:375
@@ -1571,6 +1623,9 @@
 "API. The <literal>callbackhandler</literal> interface has one method to "
 "implement:"
 msgstr ""
+"当 <literal>LoginModule</literal> 必须和用户进行通信来获取验证信息时,它使用一个 <literal>CallbackHandler</literal> 对象。应用程序实现 <literal>CallbackHandler</"
+"literal> 接口并把它传入 LoginContext,然后在直接转给底层的登录模块。登录模块使用 <literal>CallbackHandler</literal> 来获取用户的输入,如密码或智能卡 PIN,也用它来为用户提供信息,如状态信息。通过允许应用程序指定 <literal>CallbackHandler</literal>,底层的 <literal>LoginModule</"
+"literal> 就可以独立于应用程序和用户交互的方法。例如,用于 GUI 程序的<literal>CallbackHandler</literal> 实现可能显示一个窗口来获取用户输入。而另外一方面,非 GUID  程序的 <literal>callbackhandler</literal> 实现(如应用服务器)可能只是简单地用应用服务器的 API 来获取验证信息。<literal>callbackhandler</literal> 接口有一个方法需要实现:"
 
 #. Tag: programlisting
 #: J2EE_Security_On_JBOSS.xml:378
@@ -1580,6 +1635,9 @@
 "    throws java.io.IOException, \n"
 "           UnsupportedCallbackException;"
 msgstr ""
+"void handle(Callback[] callbacks)\n"
+"    throws java.io.IOException, \n"
+"           UnsupportedCallbackException;"
 
 #. Tag: para
 #: J2EE_Security_On_JBOSS.xml:379
@@ -1598,12 +1656,15 @@
 "into the handle method, it throws an <literal>UnsupportedCallbackException</"
 "literal> to abort the login call."
 msgstr ""
+"<literal>Callback</literal> 接口是我们最后讨论的验证类。这是一个 tagging 接口,它提供了几个缺省的实现,包括早前例子里使用的 <literal>NameCallback</literal> 和 <literal>PasswordCallback</literal>。<literal>LoginModule</literal> 使用 <literal>Callback</literal> 来请求验证机制要求的信息。在验证的 login 阶段,<literal>LoginModule</"
+"literal> 把一个 <literal>Callback</literal> 数组直接传入 <literal>CallbackHandler.handle</literal> 方法。如果 <literal>callbackhandler</literal> 不知道如何使用传入到 handle 方法的 <literal>Callback</literal> 对象,<literal>UnsupportedCallbackException</"
+"literal> 将被抛出并终止对 login 的调用。"
 
 #. Tag: title
 #: J2EE_Security_On_JBOSS.xml:391
-#, fuzzy, no-c-format
+#, no-c-format
 msgid "The JBoss Security Model"
-msgstr "JBossNS 架构"
+msgstr "JBoss 的安全模型"
 
 #. Tag: para
 #: J2EE_Security_On_JBOSS.xml:392




More information about the jboss-cvs-commits mailing list