Search in sources :

Example 1 with MetadataKey

use of org.commonjava.indy.pkg.maven.content.MetadataKey in project indy by Commonjava.

the class MetadataKeyMarshaller method readFrom.

@Override
public MetadataKey readFrom(ProtoStreamReader reader) throws IOException {
    StoreKey storeKey = reader.readObject("storeKey", StoreKey.class);
    String path = reader.readString("path");
    return new MetadataKey(storeKey, path);
}
Also used : MetadataKey(org.commonjava.indy.pkg.maven.content.MetadataKey) StoreKey(org.commonjava.indy.model.core.StoreKey)

Example 2 with MetadataKey

use of org.commonjava.indy.pkg.maven.content.MetadataKey in project indy by Commonjava.

the class MetadataCacheProducer method mavenMetadataKeyCacheCfg.

@MavenMetadataKeyCache
@Produces
@ApplicationScoped
public BasicCacheHandle<MetadataKey, MetadataKey> mavenMetadataKeyCacheCfg() {
    if (remoteConfiguration.isEnabled()) {
        List<BaseMarshaller> keyMarshallers = new ArrayList<>();
        keyMarshallers.add(new MetadataKeyMarshaller());
        keyMarshallers.add(new StoreKeyMarshaller());
        keyMarshallers.add(new StoreTypeMarshaller());
        cacheProducer.registerProtoAndMarshallers("metadata_key.proto", keyMarshallers);
    }
    BasicCacheHandle<MetadataKey, MetadataKey> handler = cacheProducer.getBasicCache(METADATA_KEY_CACHE);
    registerTransformer(handler);
    return handler;
}
Also used : StoreTypeMarshaller(org.commonjava.indy.pkg.maven.content.marshaller.StoreTypeMarshaller) BaseMarshaller(org.infinispan.protostream.BaseMarshaller) ArrayList(java.util.ArrayList) MetadataKey(org.commonjava.indy.pkg.maven.content.MetadataKey) MetadataKeyMarshaller(org.commonjava.indy.pkg.maven.content.marshaller.MetadataKeyMarshaller) StoreKeyMarshaller(org.commonjava.indy.pkg.maven.content.marshaller.StoreKeyMarshaller) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Aggregations

MetadataKey (org.commonjava.indy.pkg.maven.content.MetadataKey)2 ArrayList (java.util.ArrayList)1 ApplicationScoped (javax.enterprise.context.ApplicationScoped)1 Produces (javax.enterprise.inject.Produces)1 StoreKey (org.commonjava.indy.model.core.StoreKey)1 MetadataKeyMarshaller (org.commonjava.indy.pkg.maven.content.marshaller.MetadataKeyMarshaller)1 StoreKeyMarshaller (org.commonjava.indy.pkg.maven.content.marshaller.StoreKeyMarshaller)1 StoreTypeMarshaller (org.commonjava.indy.pkg.maven.content.marshaller.StoreTypeMarshaller)1 BaseMarshaller (org.infinispan.protostream.BaseMarshaller)1