Exemplo n.º 1
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);
            var buf   = new StringBuilder();

            buf.Append(indenter.ToString());
            buf.Append("<AttributeAssignment AttributeId=\"");
            buf.Append(this._attributeId);
            buf.Append("\" ");
            if (this._category != null)
            {
                buf.Append("Category=\"");
                buf.Append(this._category);
                buf.Append("\" ");
            }
            if (this._issuer != null)
            {
                buf.Append("Issuer=\"");
                buf.Append(this._issuer);
                buf.Append("\" ");
            }
            buf.Append(">");
            psout.PrintLine(buf);
            indenter.Down();
            this._value.Encode(output, indenter);
            indenter.Up();
            psout.PrintLine(indenter + "</AttributeAssignment>");
        }
Exemplo n.º 2
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(
                indenter + "<Rule RuleId=\"" + this._ruleId.Encode() + "\" Effect=\"" + this._effect + "\">");
            if (this._isRuleReference == false)
            {
                indenter.Down();
                if (this._description != null)
                {
                    this._description.Encode(output, indenter);
                }
                if (this._target != null)
                {
                    this._target.Encode(output, indenter);
                }
                if (this._condition != null)
                {
                    this._condition.Encode(output, indenter);
                }
                if (this._obligationExpressions != null)
                {
                    this._obligationExpressions.Encode(output, indenter);
                }
                if (this._adviceExpressions != null)
                {
                    this._adviceExpressions.Encode(output, indenter);
                }
                indenter.Up();
            }
            psout.PrintLine(indenter + "</Rule>");
        }
Exemplo n.º 3
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var @out = new PrintStream(output);

            @out.PrintLine(indenter + "<Request");
            indenter.Down();
            IEnumerator itr = this._otherattributes.Keys.GetEnumerator();

            while (itr.MoveNext())
            {
                var name = (string)itr.Current;
                @out.PrintLine(indenter + name + "=\"" + this._otherattributes[name] + "\"");
            }
            @out.PrintLine(indenter + "ReturnPolicyIdList=" + "\"" + this._returnPolicyIdList.Encode() + "\"");
            @out.PrintLine(indenter + "CombinedDecision=" + "\"" + this._combinedDecision.Encode() + "\">");
            foreach (RequestDefaults r in this._requestDefaults)
            {
                r.Encode(output, indenter);
            }

            foreach (MultiRequests m in this._multiRequests)
            {
                m.Encode(output, indenter);
            }

            foreach (Attributes a in this._attributes)
            {
                a.Encode(output, indenter);
            }
            indenter.Up();

            @out.PrintLine(indenter + "</Request>");
        }
Exemplo n.º 4
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<Result>");
            indenter.Down();
            this._decision.Encode(output, indenter);
            if (this._status != null)
            {
                this._status.Encode(output, indenter);
            }
            if (this._obligations != null)
            {
                this._obligations.Encode(output, indenter);
            }
            if (this._associatedAdvices != null)
            {
                this._associatedAdvices.Encode(output, indenter);
            }
            if (this._policyIdentifierList != null)
            {
                this._policyIdentifierList.Encode(output, indenter);
            }
            foreach (Attributes attrs in this._attributes)
            {
                attrs.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</Result>");
        }
Exemplo n.º 5
0
        private void EncodeChild(Node node, PrintStream psout, Indentation indenter)
        {
            psout.Print(indenter + "<" + node.NodeName);
            NamedNodeMap attrs = this._node.Attributes;

            for (int i = 0; i < attrs.Length; i++)
            {
                Node attr = attrs.Item(i);
                psout.Print(" " + attr.NodeName + "=\"" + attr.NodeValue + "\" ");
            }
            psout.Print("> ");
            psout.PrintLine();
            indenter.Down();
            NodeList children = node.ChildNodes;

            for (int i = 0; i < children.Length; i++)
            {
                Node child = children.Item(i);
                if (child.NodeType == Node.ELEMENT_NODE)
                {
                    this.EncodeChild(child, psout, indenter);
                }
                else
                {
                    string txt = child.TextContent.Trim();
                    if (txt.Length > 0)
                    {
                        psout.PrintLine(indenter + txt);
                    }
                }
            }
            indenter.Up();
            psout.PrintLine(indenter + "</" + node.NodeName + ">");
        }
Exemplo n.º 6
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<Description>");
            psout.PrintLine(indenter + this._description);
            psout.PrintLine(indenter + "</Description>");
        }
Exemplo n.º 7
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<PolicySetIdReference >");
            psout.PrintLine(indenter + this._url);
            psout.PrintLine(indenter + "</PolicySetIdReference >");
        }
Exemplo n.º 8
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var str   = new StringBuilder();
            var psout = new PrintStream(output);

            str.Append(indenter.ToString());
            str.Append("<Policy PolicyId=\"");
            str.Append(this._policyId);
            str.Append("\" ");
            str.Append("Version=\"");
            str.Append(this._version);
            str.Append("\" ");
            str.Append("RuleCombiningAlgId=\"");
            str.Append(this._ruleCombiningAlgId);
            str.Append("\" ");
            if (this._maxDelegationDepth != null)
            {
                str.Append("MaxDelegationDepth=\"");
                str.Append(this._maxDelegationDepth);
                str.Append("\" ");
            }
            str.Append(">");
            psout.PrintLine(str.ToString());
            indenter.Down();

            foreach (VariableDefinition var in this._variableDefinitions.Values)
            {
                var.Encode(output, indenter);
            }

            this._target.Encode(output, indenter);
            if (this._policyDefaults != null)
            {
                this._policyDefaults.Encode(output, indenter);
            }
            if (this._description != null)
            {
                this._description.Encode(output, indenter);
            }
            if (this._policyIssuer != null)
            {
                this._policyIssuer.Encode(output, indenter);
            }
            foreach (IPolicyLanguageModel o in this._policyLanguageModels)
            {
                o.Encode(output, indenter);
            }
            if (this._obligationExpressions != null)
            {
                this._obligationExpressions.Encode(output, indenter);
            }
            if (this._adviceExpressions != null)
            {
                this._adviceExpressions.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</Policy>");
        }
Exemplo n.º 9
0
 public void Encode(OutputStream output, Indentation indenter)
 {
     var psout = new PrintStream(output);
     psout.PrintLine(indenter + "<CombinerParameter ParameterName=\"" + this._parameterName + "\" >");
     indenter.Down();
     this._attributeValue.Encode(output, indenter);
     indenter.Up();
     psout.PrintLine(indenter + "</CombinerParameter>");
 }
Exemplo n.º 10
0
 public void Encode(OutputStream output, Indentation indenter)
 {
     var psout = new PrintStream(output);
     psout.PrintLine(indenter + "<RequestDefaults>");
     foreach (XPathVersion xpath in this._XPathVersions)
     {
         xpath.Encode(output, indenter);
     }
     psout.PrintLine(indenter + "</RequestDefaults>");
 }
Exemplo n.º 11
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<Condition>");
            indenter.Down();
            this._evaluatable.Encode(output, indenter);
            indenter.Up();
            psout.PrintLine(indenter + "</Condition>");
        }
Exemplo n.º 12
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<VariableDefinition VariableId=\"" + this._variableId + "\">");
            indenter.Down();
            this._evaluatable.Encode(output, indenter);
            indenter.Up();
            psout.PrintLine(indenter + "</VariableDefinition>");
        }
Exemplo n.º 13
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<Match MatchId=\"" + this._matchId.Encode() + "\">");
            indenter.Down();
            this._attributeValue.Encode(output, indenter);
            this._evaluatable.Encode(output, indenter);
            indenter.Up();
            psout.PrintLine(indenter + "</Match>");
        }
Exemplo n.º 14
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine("<StatusCode Value=\"" + this._value + "\" ");
            indenter.Down();
            foreach (StatusCode s in this._minorStatusCode)
            {
                s.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine("</StatusCode");
        }
Exemplo n.º 15
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<MultiRequests>");
            indenter.Down();
            foreach (RequestReference r in this._requestReferences)
            {
                r.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</MultiRequests>");
        }
Exemplo n.º 16
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<Obligations>");
            indenter.Down();
            foreach (Obligation o in this._obligations)
            {
                o.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</Obligations>");
        }
Exemplo n.º 17
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<Advice AdviceId=\"" + this.AdviceId + "\">");
            indenter.Down();
            foreach (AttributeAssignment a in this._attributeAssignments)
            {
                a.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</Advice>");
        }
Exemplo n.º 18
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.Print(indenter + "<AttributeValue DataType=\"" + this._datatype + "\"");
            if (this._anyAttributeName != null)
            {
                psout.Print(" " + this._anyAttributeName + "=\"" + this._anyAttributeValue + "\"");
            }
            psout.PrintLine(">");
            psout.PrintLine(indenter + this.DataTypeValue.Encode());
            psout.PrintLine((indenter + "</AttributeValue>"));
        }
Exemplo n.º 19
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<PolicyIdentifierList>");
            indenter.Down();
            foreach (IElement element in this._referenceList)
            {
                element.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</PolicyIdentifierList>");
        }
Exemplo n.º 20
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<AllOf>");
            indenter.Down();
            foreach (object o in this._matchs)
            {
                ((Match)o).Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</AllOf>");
        }
Exemplo n.º 21
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<RequestReference>");
            indenter.Down();
            foreach (AttributesReference a in this._AttributesReferences)
            {
                a.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</RequestReference>");
        }
Exemplo n.º 22
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<AssociatedAdvice>");
            indenter.Down();
            foreach (Advice advice in this._Advices)
            {
                advice.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</AssociatedAdvice>");
        }
Exemplo n.º 23
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<PolicySetDefaults>");
            indenter.Down();
            if (this._xPathVersion != null)
            {
                this._xPathVersion.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</PolicySetDefaults>");
        }
Exemplo n.º 24
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<AdviceExpressions>");
            indenter.Down();
            foreach (AdviceExpression o in this._adviceExpressions)
            {
                o.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</AdviceExpressions>");
        }
Exemplo n.º 25
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(
                indenter + "<AdviceExpression AdviceId=\"" + this._adviceId + "\" AppliesTo=\"" + this._appliesTo +
                "\">");
            indenter.Down();
            foreach (AttributeAssignmentExpression o in this._attributeAssignmentExpressions)
            {
                o.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</AdviceExpression>");
        }
Exemplo n.º 26
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(
                indenter + "<PolicySetCombinerParameters PolicySetIdRef=\"" + this._policySetIdRef + "\" />");
        }
Exemplo n.º 27
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<Attributes Category=\"" + this._category.Encode() + "\"> ");
            indenter.Down();
            if (this._content != null)
            {
                this._content.Encode(output, indenter);
            }
            foreach (Attribute attr in this._attributes)
            {
                attr.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</Attributes>");
        }
Exemplo n.º 28
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<Apply FunctionId=\"" + this._functionId + "\">");
            indenter.Down();
            if (this._description != null)
            {
                this._description.Encode(output, indenter);
            }
            foreach (IEvaluatable e in this._evaluatable)
            {
                e.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</Apply>");
        }
Exemplo n.º 29
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<Status>");
            indenter.Down();
            this._statusCode.Encode(output, indenter);
            if (this._statusMessage != null)
            {
                this._statusMessage.Encode(output, indenter);
            }
            if (this._statusDetail != null)
            {
                this._statusDetail.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</Status>");
        }
Exemplo n.º 30
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<ObligationExpression ObligationId=\"" + this._obligationId + "\"");
            if (this._fulfillOn != null)
            {
                psout.PrintLine(indenter + " FulfillOn=\"" + this._fulfillOn + "\"");
            }
            psout.PrintLine(indenter + ">");
            indenter.Down();
            foreach (AttributeAssignmentExpression attr in this._attributeAssignmentExpressions)
            {
                attr.Encode(output, indenter);
            }
            indenter.Up();
            psout.PrintLine(indenter + "</ObligationExpression>");
        }