Search in sources :

Example 16 with XXServiceVersionInfo

use of org.apache.ranger.entity.XXServiceVersionInfo in project ranger by apache.

the class XXServiceVersionInfoDao method updateTagVersionAndTagUpdateTime.

private void updateTagVersionAndTagUpdateTime(List<XXServiceVersionInfo> serviceVersionInfos, Date updateTime) {
    if (CollectionUtils.isEmpty(serviceVersionInfos)) {
        return;
    }
    if (updateTime == null) {
        updateTime = new Date();
    }
    for (XXServiceVersionInfo serviceVersionInfo : serviceVersionInfos) {
        Long currentTagVersion = serviceVersionInfo.getTagVersion();
        if (currentTagVersion == null) {
            currentTagVersion = Long.valueOf(0);
        }
        serviceVersionInfo.setTagVersion(currentTagVersion + 1);
        serviceVersionInfo.setTagUpdateTime(updateTime);
    }
}
Also used : XXServiceVersionInfo(org.apache.ranger.entity.XXServiceVersionInfo) Date(java.util.Date)

Aggregations

XXServiceVersionInfo (org.apache.ranger.entity.XXServiceVersionInfo)16 XXService (org.apache.ranger.entity.XXService)14 Date (java.util.Date)8 XXServiceVersionInfoDao (org.apache.ranger.db.XXServiceVersionInfoDao)8 ArrayList (java.util.ArrayList)5 XXServiceDef (org.apache.ranger.entity.XXServiceDef)5 XXServiceDefDao (org.apache.ranger.db.XXServiceDefDao)4 RangerService (org.apache.ranger.plugin.model.RangerService)4 Test (org.junit.Test)4 XXPortalUserDao (org.apache.ranger.db.XXPortalUserDao)3 XXServiceConfigMapDao (org.apache.ranger.db.XXServiceConfigMapDao)3 XXServiceDao (org.apache.ranger.db.XXServiceDao)3 XXPortalUser (org.apache.ranger.entity.XXPortalUser)3 XXServiceConfigMap (org.apache.ranger.entity.XXServiceConfigMap)3 IOException (java.io.IOException)2 UnknownHostException (java.net.UnknownHostException)2 PList (org.apache.ranger.plugin.store.PList)2 ServicePolicies (org.apache.ranger.plugin.util.ServicePolicies)2 ServiceTags (org.apache.ranger.plugin.util.ServiceTags)2 JSONException (org.codehaus.jettison.json.JSONException)2