<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
  ~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~
  ~   Licensed under the Apache License, Version 2.0 (the "License");
  ~   you may not use this file except in compliance with the License.
  ~   You may obtain a copy of the License at
  ~
  ~        http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~   Unless required by applicable law or agreed to in writing, software
  ~   distributed under the License is distributed on an "AS IS" BASIS,
  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~   See the License for the specific language governing permissions and
  ~   limitations under the License.
  -->
<GovernanceConfiguration xmlns="http://wso2.org/projects/carbon/governance.xml">
    {% if governance.life_cycle_checklist_items_enabled is defined %}
    <!-- This configuraion used to enable lifecycle checklist items -->
    <!-- possible values, true|false -->
    <enableLifecycleChecklistItems>{{governance.life_cycle_checklist_items_enabled}}</enableLifecycleChecklistItems>
    {% endif %}
    <DiscoveryAgents>
        <!--  Example Configuration -->
        <!--<DiscoveryAgent>-->
        <!--<ServerTypeId>WSO2ESB</ServerTypeId>-->
        <!--<AgentClass>org.wso2.carbon.examples.esb.DiscoveryAgents</AgentClass>-->
        <!--</DiscoveryAgent>-->
        {% for agent in governance.discovery_agents %}
        <DiscoveryAgent>
        <ServerTypeId>{{agent.type}}</ServerTypeId>
        <AgentClass>{{agent.class}}</AgentClass>
        </DiscoveryAgent>
        {% endfor %}
    </DiscoveryAgents>
    {% if governance.comparators is defined %}
    <Comparators>
        {% for comparator in governance.comparators %}
        <Comparator class="{{comparator}}"/>
        {% endfor %}
    </Comparators>
    {% endif %}

    <!-- Possible values, enabled|disable-->|
    <EndpointStateManagement>{{governance.endpoint_state_management}}</EndpointStateManagement>
    <!-- Duration in seconds             -->|
    <DefaultEndpointActiveDuration>90</DefaultEndpointActiveDuration>
    <AssociationConfig>
        {% for association in governance.associations %}

        <Association type="{{association.type}}">
            <security reverseAssociation ="secures" iconClass="fw-security">{{association.secures}}</security>
            <ownedBy reverseAssociation ="owns" iconClass="fw-user">{{association.owns}}</ownedBy>
            <usedBy reverseAssociation ="depends" iconClass="fw-globe">{{association.depends}}</usedBy>
            <depends reverseAssociation ="usedBy" iconClass="fw-store">{{association.usedby}}</depends>
        </Association>
        {% endfor %}

    </AssociationConfig>
    {% endif %}
</GovernanceConfiguration>
