@Override
public MetadataFacet getMetadataFacet( final String repositoryId, final String facetId, final String name )
throws MetadataRepositoryException
{
MetadataFacetFactory metadataFacetFactory = metadataFacetFactories.get( facetId );
if ( metadataFacetFactory == null )
{
return null;
}
QueryResult<OrderedRows<String, String, String>> result = HFactory //
.createRangeSlicesQuery( keyspace, ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getMetadataFacetFamilyName() ) //
.setColumnNames( "key", "value" ) //
.addEqualsExpression( "repositoryName", repositoryId ) //
.addEqualsExpression( "facetId", facetId ) //
.addEqualsExpression( "name", name ) //
.execute();
MetadataFacet metadataFacet = metadataFacetFactory.createMetadataFacet( repositoryId, name );
int size = result.get().getCount();
if ( size < 1 )
{
return null;
}