1 package org.apache.archiva.metadata.repository.stats.model;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import org.apache.archiva.metadata.model.MetadataFacet;
24 import java.util.Date;
29 * Provides statistics data of metadata repositories.
33 public interface RepositoryStatistics extends MetadataFacet
35 String FACET_ID = "org.apache.archiva.metadata.repository.stats";
37 String getRepositoryId( );
39 Date getScanEndTime( );
41 Date getScanStartTime( );
43 long getTotalArtifactCount( );
45 void setTotalArtifactCount( long totalArtifactCount );
47 long getTotalArtifactFileSize( );
49 void setTotalArtifactFileSize( long totalArtifactFileSize );
51 long getTotalFileCount( );
53 void setTotalFileCount( long totalFileCount );
55 long getTotalGroupCount( );
57 void setTotalGroupCount( long totalGroupCount );
59 long getTotalProjectCount( );
61 void setTotalProjectCount( long totalProjectCount );
63 void setNewFileCount( long newFileCount );
65 long getNewFileCount( );
70 * Statistics data by artifact type.
72 * @return A list of data keys and values
74 Map<String, Long> getTotalCountForType( );
77 * Returns the value for the given artifact type.
79 * @param type The artifact type
80 * @return The count value.
82 long getTotalCountForType( String type );
85 * Sets the value for the given artifact type.
86 * @param type The artifact type.
87 * @param count The count value.
89 void setTotalCountForType( String type, long count );
92 * Reads custom statistic values that are store implementation
95 * @param fieldName A unique field name.
97 long getCustomValue(String fieldName);
100 * Saves custom statistic values that are store implementation
101 * specific. The field name should be unique (e.g. prefixed by the
102 * package name of the data provider).
104 * @param fieldName A unique field name.
105 * @param count The statistic counter value
107 void setCustomValue(String fieldName, long count);