<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://www.ehcache.org/v3"
        xmlns:jsr107="http://www.ehcache.org/v3/jsr107"
        xsi:schemaLocation="
            http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.0.xsd
            http://www.ehcache.org/v3/jsr107 http://www.ehcache.org/schema/ehcache-107-ext-3.0.xsd">
    <service>
        <jsr107:defaults enable-management="true" enable-statistics="true"/>
    </service>

    <persistence directory="${gisbi.path.ehcache}" />

    <cache-template name="common-cache">
        <expiry>
            <none/>
        </expiry>
        <resources>
            <heap unit="entries">1000</heap>
            <offheap unit="MB">10</offheap>
        </resources>
    </cache-template>


    <cache alias="de_v2_rsa" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>io.gisbi.rsa.dao.entity.CoreRsa</value-type>
    </cache>

    <!--以下属于权限系统缓存-->
    <!--用户角色缓存-->
    <cache alias="de_v2_user_roles" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>java.util.List</value-type>
    </cache>

    <!--用户资源权限缓存-->
    <cache alias="de_v2_user_busi_pers" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>java.util.List</value-type>
    </cache>
    <!--角色资源权限缓存-->
    <cache alias="de_v2_role_busi_pers" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>java.util.List</value-type>
    </cache>
    <!--角色菜单权限缓存-->
    <cache alias="de_v2_role_menu_pers" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>java.util.List</value-type>
    </cache>
    <!--组织内所有资源缓存 包括 用户 角色 数据源 数据集 仪表板 大屏 key由什么组成？组织id+flag 例如orgid + '1'-->
    <cache alias="de_v2_org_global_resource" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>java.util.List</value-type>
    </cache>
    <cache alias="de_v2_all_oid_flag_resource" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>java.util.List</value-type>
    </cache>

    <cache alias="de_v2_user_count" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>java.lang.Integer</value-type>
    </cache>

    <cache alias="de_v2_user_echelon" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>java.util.List</value-type>
    </cache>

    <cache alias="de_v2_role_busi_pers_interactive" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>java.util.List</value-type>
    </cache>

    <cache alias="de_v2_user_busi_pers_interactive" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>java.util.List</value-type>
    </cache>

    <cache alias="de_v2_world_map" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>io.gisbi.api.map.vo.AreaNode</value-type>
    </cache>
    <cache alias="de_v2_login_user_cache" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>java.lang.Object</value-type>
    </cache>
    <cache alias="de_v2_custom_geo" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>java.util.List</value-type>
    </cache>
    <cache alias="de_v2_global_mfa" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>java.lang.Object</value-type>
    </cache>
    <cache alias="de_v2_user_community_language" uses-template="common-cache">
        <key-type>java.lang.String</key-type>
        <value-type>java.lang.Object</value-type>
    </cache>

    <cache alias="de_v2_user_token_cache">
        <key-type>java.lang.String</key-type>
        <value-type>java.lang.Integer</value-type>
        <expiry>
            <ttl unit="minutes">${gisbi.login_timeout}</ttl>
        </expiry>
        <listeners>
            <listener>
                <class>io.gisbi.listener.MyCacheListener</class>
                <event-firing-mode>ASYNCHRONOUS</event-firing-mode>
                <event-ordering-mode>ORDERED</event-ordering-mode>
                <events-to-fire-on>CREATED</events-to-fire-on>
                <events-to-fire-on>UPDATED</events-to-fire-on>
                <events-to-fire-on>EXPIRED</events-to-fire-on>
                <events-to-fire-on>REMOVED</events-to-fire-on>
            </listener>
        </listeners>
        <resources>
            <heap unit="entries">100</heap>
            <offheap unit="MB">10</offheap>
            <disk unit="MB" persistent="true">200</disk>
        </resources>
    </cache>



</config>

