Atom 条目的 Atom 标识
每个 Atom 条目都有唯一的 Atom 标识,在 Atom 条目的生存期内,其 Atom 标识必须保持不变。
The Atom ID for an Atom entry is specified in the <atom:id> element. 它必须采用有效的“国际化资源标识” (IRI) 的形式,但不需要与实际的资源位置关联。
标记 URI
CICS can generate a unique Atom ID for each Atom entry in the tag URI format when it serves the Atom feed, using information that you specify in the <cics:authority> element in the Atom configuration file. RFC 4151中描述了标记 URI 方案, "标记" URI 方案。
- “标记”的方案
- An authority name and date that you specify in the <cics:authority> element in the Atom configuration file
- A specific consisting of the resource type and resource name that you specify in the <cics:resource> element in the Atom configuration file, and the selector value for the individual Atom entry
tag:example.com,2009-01-08:tsqueue:WB20TSQ:23标记 URI 中的权限名称是针对您或贵公司注册的域名或电子邮件地址,日期是您或贵公司拥有该权限名称的日期。 cics: authority element 包含权限名称和日期需求的详细信息。
对于 CICS 直接从文件或临时存储器队列获取数据的 Atom 订阅源,资源类型和资源名称是文件或临时存储器队列的资源类型和资源名称。 对于由用户编写的服务例程提供数据的 Atom 订阅源,资源类型和资源名称是该服务例程的资源类型和资源名称。
- 只要您未更改文件、临时存储器队列或服务例程的名称,未更改 Atom 配置文件中的相关信息,也未将 Atom 条目移到其他资源中,那么在每个 Atom 条目的生存期内,Atom 标识都保持不变。
- 如果从不同的 CICS 区域以相同的方式提供相同的资源,那么 Atom 标识也保持不变。
- 如果对文件、临时存储器队列或服务例程重命名,Atom 标识会发生变化。 为了与 Atom 格式保持一致,当您重命名某个资源后,就不能再将其作为具有相同 URL 的 Atom 订阅源,因为该资源的 Atom 标识已发生变化。
- Atom 标识在一个 CICS 区域中是唯一的,但并不保证它在多个不同的 CICS 区域中也是唯一的。 In the situation where you want to set up Atom feeds from resources that have the same name and type but are in different CICS regions, you can specify a different authority name or a different date in the <cics:authority> element of the Atom configuration file for each of the feeds. 即使所有其他信息都是相同的,具有不同日期的标记 URI 也互不相同。
- 如果用户编写的服务例程只处理一个 Atom 订阅源,那么 Atom 标识对于该例程提供的 Atom 条目是唯一的,但如果用户编写的服务例程提供多个订阅源,Atom 标识就不是唯一的。 If your user-written service routine provides multiple feeds, either choose an alternative format for your Atom IDs, or use a different authority name or date in the <cics:authority> element of the Atom configuration file for each of the feeds.
Atom 标识的备用格式
Instead of using the tag URI format that is generated by CICS, you may specify an alternative format for your Atom IDs using the <atom:id> element for the prototype Atom entry in the Atom configuration file. CICS 会将选择器值附加到备用格式,从而为每个 Atom 条目生成唯一的 Atom 标识。
如果您使用备用 Atom 标识格式,请确保生成的 Atom 标识是唯一的,并且符合 RFC 4287 中有关 Atom 格式规范的要求。
为确保格式化正确无误,CICS 会忽略由 Web 客户机提供的任何 Atom 标识,而使用在 Atom 配置文件中为该订阅源指定的格式。
存储 Atom 标识
由于 CICS 每次为 Atom 条目提供服务时,都会为该 Atom 条目生成相同的 Atom 标识,因此不需要将 Atom 条目和 Atom 标识一起存储。 该功能支持您从不包含用于存储元数据的字段的资源提供 Atom 条目数据,前提是使 Atom 标识保持不变,不更改配置文件中的 Atom 标识,不将 Atom 标识移到其他资源,(对标记 URI)也不更改资源或服务例程的名称。
但 RFC 4287 建议将 Atom 标识与 Atom 条目一起存储。 如果您可以将 Atom 标识存储在保存了 Atom 条目数据的资源中,那么可以采用该建议。 如果您将 Atom 条目存储在文件中,那么该字段可成为记录的唯一键。 CICS 或服务例程将 Atom 条目的完整 Atom 标识存储在字段中,与 Atom 条目一起保存的 Atom 标识可以不同于 CICS 为该 Atom 条目生成的 Atom 标识,并可以覆盖后者。
For a service routine, CICS uses the ATMP_ATOMID parameter to send a prototype Atom ID for the Atom entry, using the information that you specified in either the <cics:authority> element or the <atom:id> element in the Atom configuration file. 要生成完整的 Atom 标识,服务例程可以通过附加选择器值来完成原型 Atom 标识,也可忽略该标识并用自己的有效 Atom 标识替代。 例如,可以使用十六进制通用唯一标识 (UUID) 生成具有 urn: uuid 方案的 URI ,如 RFC 4122 通用唯一标识 (UUID) URN 名称空间中所述。 服务例程可以使用在 ATMP_ID_FLD 参数中指定的字段,将 Atom 标识存储在资源记录中,然后使用 ATMP_ATOMID 参数返回该标识。
为确保准确性,CICS 忽略由 Web 客户机提供的 Atom 标识,并且不将它们存储在文件或临时存储器队列中的记录内,也不会将它们传递给服务例程。
RFC 4287 要求:当 Atom 条目在其他位置复用或移到其他位置时,Atom 标识必须与 Atom 条目存储在一起。 如果将 Atom 标识与 Atom 条目存储在一起,那么可以将 Atom 条目移到其他位置,并仍然符合该要求。 如果未将 Atom 标识与 Atom 条目存储在一起,请勿将 Atom 条目移到其他位置。
Atom 订阅源的 Atom 标识
tag:example.com,2009-01-08:tsqueue:WB20TSQIf you prefer an alternative Atom ID format, you can use the <atom:id> element for the Atom feed to specify a complete Atom ID for the Atom feed. 请确保该 Atom 标识是唯一的且符合 RFC 4287 中 Atom 格式规范的要求。