记录属性架构

记录可以具有应用程序特定的属性,这些属性是一系列名称或值对,这些属性表示为PEER_RECORD结构的 pszAttributes 成员中的 XML 字符串。 这些属性用于筛选通过对 PeerGroupSearchRecords 调用启动的记录搜索,该搜索筛选器采用 记录搜索查询格式 中指定的 XML 搜索筛选器作为参数。

记录属性可以是以下三种类型之一:

以下列表标识对等基础结构保留的特定属性名称:

  • peerlastmodifiedby
  • peercreatorid
  • peerlastmodificationtime
  • peerrecordid
  • peerrecordtype
  • peercreationtime
  • peerlastmodificationtime

定义记录属性的示例

以下架构示例演示如何定义记录属性:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs="https://www.w3.org/2001/XMLSchema">
   <xs:simpleType name="alphanum">
       <xs:restriction base="xs:string">
          <xs:pattern value="\c+" />
       </xs:restriction>
   </xs:simpleType>
   <xs:complexType name="attributeType">
       <xs:simpleContent>
          <xs:extension base="xs:string">
                <xs:attribute name="name" type="alphanum" />
                <xs:attribute name="type">
                    <xs:simpleType>
                        <xs:restriction base="alphanum">
                           <xs:enumeration value="string"/>
                           <xs:enumeration value="date"/>
                           <xs:enumeration value="int"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:attribute>
           </xs:extension>
       </xs:simpleContent>
    </xs:complexType>
    <xs:element name="attributes">
       <xs:complexType>
           <xs:sequence>
                <xs:element name="attribute" type="attributeType" minOccurs="0" maxOccurs="unbounded" />
           </xs:sequence>
       </xs:complexType>
    </xs:element>
</xs:schema>  

注意

属性名称必须是字母数字字符的序列。 属性名称中不允许使用连字符 (“-”) 和下划线 (“_”) 等特殊字符。

 

XML 属性序列的以下示例包含PEER_RECORDpszAttributes 成员中显示的自定义 AuthenticationTypeAuthExpires 属性。

<attributes>
  <attribute name="AuthenticationType" type="string">Kerberos</attribute><attribute name="AuthExpires" type="date">2002-01-31</attribute>
<attributes>