/**
 * Copyright (C) 2011-2019 Red Hat, Inc. (https://github.com/Commonjava/indy)
 *
 * 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.
 */
package org.commonjava.indy.infinispan.data;

import org.commonjava.indy.model.core.ArtifactStore;
import org.commonjava.indy.model.core.StoreKey;
import org.commonjava.indy.subsys.infinispan.CacheHandle;
import org.commonjava.indy.subsys.infinispan.CacheProducer;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;

public class StoreDataCacheProducer
{
    public static final String STORE_DATA_CACHE = "store-data-v1";

    @Inject
    private CacheProducer cacheProducer;

    @StoreDataCache
    @Produces
    @ApplicationScoped
    public CacheHandle<StoreKey, ArtifactStore> getStoreDataCache()
    {
        return cacheProducer.getCache( STORE_DATA_CACHE );
    }

//    @StoreDataCache
//    @Produces
//    @ApplicationScoped
//    public CacheHandle<StoreKey, String> getStoreDataCache()
//    {
//        return cacheProducer.getCache( STORE_DATA_CACHE );
//    }


}
/**
 * Copyright (C) 2011-2019 Red Hat, Inc. (https://github.com/Commonjava/indy)
 *
 * 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.
 */
package org.commonjava.indy.infinispan.data;

import org.commonjava.indy.model.core.ArtifactStore;
import org.commonjava.indy.model.core.StoreKey;
import org.commonjava.indy.subsys.infinispan.CacheHandle;
import org.commonjava.indy.subsys.infinispan.CacheProducer;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;

public class StoreDataCacheProducer
{
    public static final String STORE_DATA_CACHE = "store-data-v2";

    @Inject
    private CacheProducer cacheProducer;

    @StoreDataCache
    @Produces
    @ApplicationScoped
    public CacheHandle<StoreKey, ArtifactStore> getStoreDataCache()
    {
        return cacheProducer.getCache( STORE_DATA_CACHE );
    }

//    @StoreDataCache
//    @Produces
//    @ApplicationScoped
//    public CacheHandle<StoreKey, String> getStoreDataCache()
//    {
//        return cacheProducer.getCache( STORE_DATA_CACHE );
//    }


}
change the current store-data cache name to 'store-data-v2' to imply that 'store-data' is v1 (#1458)