Пример #1
0
 /// <summary>
 /// Creates an instance of a TargetMatchBase with the values specified.
 /// </summary>
 /// <param name="matchId">The match id</param>
 /// <param name="attributeValue">The attribute value instance.</param>
 /// <param name="attributeReference">An attribute reference instance.</param>
 /// <param name="schemaVersion">The version of the schema that was used to validate.</param>
 protected TargetMatchBaseReadWrite(string matchId, AttributeValueElementReadWrite attributeValue, AttributeReferenceBase attributeReference, XacmlVersion schemaVersion)
     : base(XacmlSchema.Policy, schemaVersion)
 {
     _id                 = matchId;
     _attributeValue     = attributeValue;
     _attributeReference = attributeReference;
 }
 /// <summary>
 /// Creates an instance of a TargetMatchBase with the values specified.
 /// </summary>
 /// <param name="matchId">The match id</param>
 /// <param name="attributeValue">The attribute value instance.</param>
 /// <param name="attributeReference">An attribute reference instance.</param>
 /// <param name="schemaVersion">The version of the schema that was used to validate.</param>
 protected TargetMatchBaseReadWrite(string matchId, AttributeValueElementReadWrite attributeValue, AttributeReferenceBase attributeReference, XacmlVersion schemaVersion)
     : base(XacmlSchema.Policy, schemaVersion)
 {
     _id = matchId;
     _attributeValue = attributeValue;
     _attributeReference = attributeReference;
 }
Пример #3
0
 /// <summary>
 /// Creates an instance of the TargetMatchBase class using the XmlReader specified, the name of the node that defines
 /// the match (the name of the node changes depending on the target item that defines it) and the attribute
 /// designator node name which also changes depending on the target item that defines the match.
 /// </summary>
 /// <param name="reader">The XmlReader positioned at the "matchNodeName" node.</param>
 /// <param name="matchNodeName">The name of the match node for this target item.</param>
 /// <param name="attributeDesignatorNode">The name of the attribute designator node for this target item.</param>
 /// <param name="schemaVersion">The version of the schema that was used to validate.</param>
 protected TargetMatchBaseReadWrite(XmlReader reader, string matchNodeName, string attributeDesignatorNode, XacmlVersion schemaVersion)
     : base(XacmlSchema.Policy, schemaVersion)
 {
     if (reader == null)
     {
         throw new ArgumentNullException("reader");
     }
     if (reader.LocalName == matchNodeName && ValidateSchema(reader, schemaVersion))
     {
         _id = reader.GetAttribute(Consts.Schema1.MatchElement.MatchId);
         while (reader.Read())
         {
             if (reader.LocalName == Consts.Schema1.AttributeValueElement.AttributeValue &&
                 ValidateSchema(reader, schemaVersion) &&
                 reader.NodeType != XmlNodeType.EndElement)
             {
                 _attributeValue = new AttributeValueElementReadWrite(reader, schemaVersion);
             }
             else if (reader.LocalName == attributeDesignatorNode &&
                      ValidateSchema(reader, schemaVersion) &&
                      reader.NodeType != XmlNodeType.EndElement)
             {
                 _attributeReference = CreateAttributeDesignator(reader);
             }
             else if (reader.LocalName == Consts.Schema1.AttributeSelectorElement.AttributeSelector &&
                      ValidateSchema(reader, schemaVersion) &&
                      reader.NodeType != XmlNodeType.EndElement)
             {
                 _attributeReference = new AttributeSelectorElement(reader, schemaVersion);
             }
             else if (reader.LocalName == matchNodeName &&
                      reader.NodeType == XmlNodeType.EndElement)
             {
                 break;
             }
         }
     }
     else
     {
         throw new Exception(string.Format(Properties.Resource.exc_invalid_node_name, reader.LocalName));
     }
 }
 /// <summary>
 /// Creates an instance of the TargetMatchBase class using the XmlReader specified, the name of the node that defines
 /// the match (the name of the node changes depending on the target item that defines it) and the attribute
 /// designator node name which also changes depending on the target item that defines the match.
 /// </summary>
 /// <param name="reader">The XmlReader positioned at the "matchNodeName" node.</param>
 /// <param name="matchNodeName">The name of the match node for this target item.</param>
 /// <param name="attributeDesignatorNode">The name of the attribute designator node for this target item.</param>
 /// <param name="schemaVersion">The version of the schema that was used to validate.</param>
 protected TargetMatchBaseReadWrite(XmlReader reader, string matchNodeName, string attributeDesignatorNode, XacmlVersion schemaVersion)
     : base(XacmlSchema.Policy, schemaVersion)
 {
     if (reader == null) throw new ArgumentNullException("reader");
     if (reader.LocalName == matchNodeName && ValidateSchema(reader, schemaVersion))
     {
         _id = reader.GetAttribute(Consts.Schema1.MatchElement.MatchId);
         while (reader.Read())
         {
             if (reader.LocalName == Consts.Schema1.AttributeValueElement.AttributeValue &&
                 ValidateSchema(reader, schemaVersion) &&
                 reader.NodeType != XmlNodeType.EndElement)
             {
                 _attributeValue = new AttributeValueElementReadWrite(reader, schemaVersion);
             }
             else if (reader.LocalName == attributeDesignatorNode &&
                 ValidateSchema(reader, schemaVersion) &&
                 reader.NodeType != XmlNodeType.EndElement)
             {
                 _attributeReference = CreateAttributeDesignator(reader);
             }
             else if (reader.LocalName == Consts.Schema1.AttributeSelectorElement.AttributeSelector &&
                 ValidateSchema(reader, schemaVersion) &&
                 reader.NodeType != XmlNodeType.EndElement)
             {
                 _attributeReference = new AttributeSelectorElement(reader, schemaVersion);
             }
             else if (reader.LocalName == matchNodeName &&
                 reader.NodeType == XmlNodeType.EndElement)
             {
                 break;
             }
         }
     }
     else
     {
         throw new Exception(string.Format(Properties.Resource.exc_invalid_node_name, reader.LocalName));
     }
 }
Пример #5
0
 /// <summary>
 /// Creates an instance of the ActionMatch class using the specified arguments.
 /// </summary>
 /// <param name="matchId">The function id for this match.</param>
 /// <param name="attributeValue">The attribute value to use as the first parameter to the function.</param>
 /// <param name="attributeReference">The attribute reference in the context document.</param>
 /// <param name="version">The version of the schema that was used to validate.</param>
 public ActionMatchElement(string matchId, AttributeValueElementReadWrite attributeValue, AttributeReferenceBase attributeReference, XacmlVersion version) :
     base(matchId, attributeValue, attributeReference, version)
 {
 }
		/// <summary>
		/// Creates an instance of a SubjectMatch with the values specified.
		/// </summary>
		/// <param name="matchId">The match id</param>
		/// <param name="attributeValue">The attribute value instance.</param>
		/// <param name="attributeReference">An attribute reference instance.</param>
		/// <param name="version">The version of the schema that was used to validate.</param>
		public SubjectMatchElementReadWrite( string matchId, AttributeValueElementReadWrite attributeValue, AttributeReferenceBase attributeReference, XacmlVersion version )
			: base( matchId, attributeValue, attributeReference, version )
		{
		}
Пример #7
0
		/// <summary>
		/// Creates an instance of a TargetMatchBase with the values specified.
		/// </summary>
		/// <param name="matchId">The match id</param>
		/// <param name="attributeValue">The attribute value instance.</param>
		/// <param name="attributeReference">An attribute reference instance.</param>
		/// <param name="schemaVersion">The version of the schema that was used to validate.</param>
		protected TargetMatchBase( string matchId, AttributeValueElementReadWrite attributeValue, AttributeReferenceBase attributeReference, XacmlVersion schemaVersion )
			: base( matchId, attributeValue, attributeReference, schemaVersion )
		{
		}
Пример #8
0
 /// <summary>
 /// Adds an attribute designator to the missing attributes list.
 /// </summary>
 /// <param name="attrDes"></param>
 public void AddMissingAttribute(AttributeReferenceBase attrDes)
 {
     _missingAttributes.Add(attrDes);
 }
Пример #9
0
 /// <summary>
 /// Creates an instance of a TargetMatchBase with the values specified.
 /// </summary>
 /// <param name="matchId">The match id</param>
 /// <param name="attributeValue">The attribute value instance.</param>
 /// <param name="attributeReference">An attribute reference instance.</param>
 /// <param name="schemaVersion">The version of the schema that was used to validate.</param>
 protected TargetMatchBase(string matchId, AttributeValueElementReadWrite attributeValue, AttributeReferenceBase attributeReference, XacmlVersion schemaVersion)
     : base(matchId, attributeValue, attributeReference, schemaVersion)
 {
 }
Пример #10
0
 /// <summary>
 /// Adds an attribute designator to the missing attributes list.
 /// </summary>
 /// <param name="attrDes"></param>
 public void AddMissingAttribute(AttributeReferenceBase attrDes)
 {
     _missingAttributes.Add(attrDes);
 }