Beispiel #1
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>");
        }
Beispiel #2
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>");
        }
Beispiel #3
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>");
        }
Beispiel #4
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>");
        }
Beispiel #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 + ">");
        }
Beispiel #6
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>");
        }
Beispiel #7
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>");
 }
Beispiel #8
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>");
        }
Beispiel #9
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>");
        }
Beispiel #10
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>");
        }
Beispiel #11
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>");
        }
Beispiel #12
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");
        }
Beispiel #13
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>");
        }
Beispiel #14
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>");
        }
Beispiel #15
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>");
        }
Beispiel #16
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>");
        }
Beispiel #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>");
        }
Beispiel #18
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>");
        }
Beispiel #19
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>");
        }
Beispiel #20
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>");
        }
Beispiel #21
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>");
        }
Beispiel #22
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>");
        }
Beispiel #23
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>");
        }
Beispiel #24
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>");
        }
Beispiel #25
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var @out = new PrintStream(output);

            @out.PrintLine(indenter + "<PolicyIssuer>");
            indenter.Down();
            if (this._content != null)
            {
                this._content.Encode(output, indenter);
            }

            foreach (Attribute a in this._attributes)
            {
                a.Encode(output, indenter);
            }
            indenter.Up();
            @out.PrintLine(indenter + "</PolicyIssuer>");
        }
Beispiel #26
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>");
        }
Beispiel #27
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<PolicySet PolicySetId=\"" + this._policySetId + "\"");
            psout.PrintLine(indenter + "Version=\"" + this._version + "\"");
            psout.PrintLine(indenter + "PolicyCombiningAlgId=\"" + this._policyCombiningAlgId + "\"");
            if (this._maxDelegationDepth >= 0)
            {
                psout.PrintLine(indenter + "MaxDelegationDepth=\"" + this._maxDelegationDepth + "\"");
            }
            psout.PrintLine(indenter + ">");

            indenter.Down();
            if (this._description != null)
            {
                this._description.Encode(output, indenter);
            }
            this._target.Encode(output, indenter);
            if (this._policyIssuer != null)
            {
                this._policyIssuer.Encode(output, indenter);
            }
            if (this._policySetDefaults != null)
            {
                this._policySetDefaults.Encode(output, indenter);
            }

            foreach (IPolicyLanguageModel eval in this._policies)
            {
                eval.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 + "</PolicySet>");
        }
Beispiel #28
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            psout.PrintLine(indenter + "<AttributeAssignmentExpression AttributeId=\"" + this._attributeId + "\"");
            if (this._category != null)
            {
                psout.PrintLine(indenter + " Category=\"" + this._category + "\"");
            }
            if (this._issuer != null)
            {
                psout.PrintLine(indenter + " Issuer=\"" + this._issuer + "\"");
            }
            psout.PrintLine(indenter + ">");
            indenter.Down();
            this._evaluatable.Encode(output, indenter);
            indenter.Up();
            psout.PrintLine(indenter + "</AttributeAssignmentExpression>");
        }
Beispiel #29
0
        public void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            if (this._combinerParameters.Count == 0)
            {
                psout.PrintLine(indenter + "<CombinerParameters />");
            }
            else
            {
                psout.PrintLine(indenter + "<CombinerParameters>");
                indenter.Down();
                foreach (object o in this._combinerParameters)
                {
                    ((CombinerParameter)o).Encode(output, indenter);
                }
                indenter.Up();
                psout.PrintLine(indenter + "</CombinerParameters>");
            }
        }
Beispiel #30
0
        public virtual void Encode(OutputStream output, Indentation indenter)
        {
            var psout = new PrintStream(output);

            if (this.ReturnIsBag())
            {
                foreach (object o in this.Children)
                {
                    ((DataTypeValue)o).Encode(output, indenter);
                }
            }
            else
            {
                psout.PrintLine(indenter + "<AttributeValue DataType=\"" + this._uri + "\">");
                indenter.Down();
                psout.PrintLine(indenter + this.Encode());
                indenter.Up();
                psout.PrintLine((indenter + "</AttributeValue>"));
            }
        }