import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
}
@Override
- public Collection<String> getProjectVersions( RepositorySession session, String repoId, String namespace, String projectId )
+ public List<String> getProjectVersions( RepositorySession session, String repoId, String namespace, String projectId )
{
return versions;
}
@Override
- public Collection<ArtifactMetadata> getArtifacts( RepositorySession session, String repoId, String namespace, String projectId,
- String projectVersion )
+ public List<ArtifactMetadata> getArtifacts( RepositorySession session, String repoId, String namespace, String projectId,
+ String projectVersion )
{
return artifacts;
}
}
@Override
- public Collection<String> getArtifactVersions( RepositorySession session, String repoId, String namespace, String projectId,
- String projectVersion )
+ public List<String> getArtifactVersions( RepositorySession session, String repoId, String namespace, String projectId,
+ String projectVersion )
throws MetadataResolutionException
{
throw new UnsupportedOperationException();
}
@Override
- public Collection<ProjectVersionReference> getProjectReferences( RepositorySession session, String repoId, String namespace, String projectId,
- String projectVersion )
+ public List<ProjectVersionReference> getProjectReferences( RepositorySession session, String repoId, String namespace, String projectId,
+ String projectVersion )
throws MetadataResolutionException
{
throw new UnsupportedOperationException();
}
@Override
- public Collection<String> getRootNamespaces( RepositorySession session, String repoId )
+ public List<String> getRootNamespaces( RepositorySession session, String repoId )
throws MetadataResolutionException
{
throw new UnsupportedOperationException();
}
@Override
- public Collection<String> getChildNamespaces( RepositorySession session, String repoId, String namespace )
+ public List<String> getChildNamespaces( RepositorySession session, String repoId, String namespace )
throws MetadataResolutionException
{
throw new UnsupportedOperationException();
}
@Override
- public Collection<String> getProjects( RepositorySession session, String repoId, String namespace )
+ public List<String> getProjects( RepositorySession session, String repoId, String namespace )
throws MetadataResolutionException
{
throw new UnsupportedOperationException();
}
@Override
- public Collection<String> getProjectVersions( RepositorySession session, String repoId, String namespace, String projectId )
+ public List<String> getProjectVersions( RepositorySession session, String repoId, String namespace, String projectId )
throws MetadataResolutionException
{
throw new UnsupportedOperationException();
}
@Override
- public Collection<ArtifactMetadata> getArtifacts( RepositorySession session, String repoId, String namespace, String projectId,
- String projectVersion )
+ public List<ArtifactMetadata> getArtifacts( RepositorySession session, String repoId, String namespace, String projectId,
+ String projectVersion )
throws MetadataResolutionException
{
throw new UnsupportedOperationException();
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import java.time.ZonedDateTime;
-import java.util.Collection;
import java.util.List;
import java.util.stream.Stream;
* @return A list of version strings, or a empty list if no versions are found, or this is not a snapshot version.
* @throws MetadataResolutionException if the retrieval of the metadata failed.
*/
- Collection<String> getArtifactVersions( RepositorySession session, String repoId, String namespace, String projectId, String projectVersion )
+ List<String> getArtifactVersions( RepositorySession session, String repoId, String namespace, String projectId, String projectVersion )
throws MetadataResolutionException;
/**
* @return a list of project references
* @throws MetadataResolutionException if the version could not be found.
*/
- Collection<ProjectVersionReference> getProjectReferences( RepositorySession session, String repoId, String namespace, String projectId,
- String projectVersion )
+ List<ProjectVersionReference> getProjectReferences( RepositorySession session, String repoId, String namespace, String projectId,
+ String projectVersion )
throws MetadataResolutionException;
/**
* @return A list of namespace names, or empty list, if no namespace is stored for this repository.
* @throws MetadataResolutionException If the retrieval failed.
*/
- Collection<String> getRootNamespaces( RepositorySession session, String repoId )
+ List<String> getRootNamespaces( RepositorySession session, String repoId )
throws MetadataResolutionException;
/**
* @param session The repository session.
* @param repoId The repository id.
* @param namespace The parent namespace '.'-separated.
- * @return {@link Collection} of child namespace names, or a empty list, if there are no children for the given parent namespace.
+ * @return {@link List} of child namespace names, or a empty list, if there are no children for the given parent namespace.
* @throws MetadataResolutionException if the retrieval failed.
*/
- Collection<String> getChildNamespaces( RepositorySession session, String repoId, String namespace )
+ List<String> getChildNamespaces( RepositorySession session, String repoId, String namespace )
throws MetadataResolutionException;
/**
* @return The list of project names or empty list if no project exists at the given namespace.
* @throws MetadataResolutionException if the retrieval failed.
*/
- Collection<String> getProjects( RepositorySession session, String repoId, String namespace )
+ List<String> getProjects( RepositorySession session, String repoId, String namespace )
throws MetadataResolutionException;
/**
* @return The list of versions or a empty list, if not version was found.
* @throws MetadataResolutionException if the retrieval failed.
*/
- Collection<String> getProjectVersions( RepositorySession session, String repoId, String namespace, String projectId )
+ List<String> getProjectVersions( RepositorySession session, String repoId, String namespace, String projectId )
throws MetadataResolutionException;
/**
* @return The list of artifact metadata objects, or a empty list, if no artifact exists for this version.
* @throws MetadataResolutionException if the retrieval failed.
*/
- Collection<ArtifactMetadata> getArtifacts( RepositorySession session, String repoId, String namespace, String projectId,
- String projectVersion )
+ List<ArtifactMetadata> getArtifacts( RepositorySession session, String repoId, String namespace, String projectId,
+ String projectVersion )
throws MetadataResolutionException;
/**
// FIXME this one need peformance improvement maybe a cache?
@Override
- public Collection<String> getRootNamespaces( RepositorySession session, final String repoId )
+ public List<String> getRootNamespaces( RepositorySession session, final String repoId )
throws MetadataResolutionException
{
namespaces.add( StringUtils.substringBefore( getStringValue( row.getColumnSlice(), NAME.toString() ), "." ) );
}
- return namespaces;
+ return new ArrayList<>( namespaces );
}
// FIXME this one need peformance improvement maybe a cache?
@Override
- public Collection<String> getChildNamespaces( RepositorySession session, final String repoId, final String namespaceId )
+ public List<String> getChildNamespaces( RepositorySession session, final String repoId, final String namespaceId )
throws MetadataResolutionException
{
}
@Override
- public Collection<String> getProjects( RepositorySession session, final String repoId, final String namespace )
+ public List<String> getProjects( RepositorySession session, final String repoId, final String namespace )
throws MetadataResolutionException
{
projects.add( getStringValue( row.getColumnSlice(), PROJECT_ID.toString() ) );
}
- return projects;
+ return new ArrayList<>( projects );
}
@Override
}
@Override
- public Collection<String> getProjectVersions( RepositorySession session, final String repoId, final String namespace, final String projectId )
+ public List<String> getProjectVersions( RepositorySession session, final String repoId, final String namespace, final String projectId )
throws MetadataResolutionException
{
versions.add( getStringValue( orderedRows.getColumnSlice(), PROJECT_VERSION.toString() ) );
}
- return versions;
+ return new ArrayList<>( versions );
}
}
@Override
- public Collection<String> getArtifactVersions( RepositorySession session, final String repoId, final String namespace, final String projectId,
- final String projectVersion )
+ public List<String> getArtifactVersions( RepositorySession session, final String repoId, final String namespace, final String projectId,
+ final String projectVersion )
throws MetadataResolutionException
{
versions.add( getStringValue( row.getColumnSlice(), VERSION.toString() ) );
}
- return versions;
+ return new ArrayList<>( versions );
}
- /**
+ /*
* iterate over available facets to remove/add from the artifactMetadata
*
* @param facetedMetadata
@Override
- public Collection<ProjectVersionReference> getProjectReferences( RepositorySession session, String repoId, String namespace, String projectId,
- String projectVersion )
+ public List<ProjectVersionReference> getProjectReferences( RepositorySession session, String repoId, String namespace, String projectId,
+ String projectVersion )
throws MetadataResolutionException
{
QueryResult<OrderedRows<String, String, String>> result = HFactory //
}
@Override
- public Collection<ArtifactMetadata> getArtifacts( RepositorySession session, final String repoId, final String namespace,
- final String projectId, final String projectVersion )
+ public List<ArtifactMetadata> getArtifacts( RepositorySession session, final String repoId, final String namespace,
+ final String projectId, final String projectVersion )
throws MetadataResolutionException
{
@Override
- public Collection<ArtifactMetadata> getArtifacts(RepositorySession session, String repoId, String namespace, String projectId,
- String projectVersion)
+ public List<ArtifactMetadata> getArtifacts( RepositorySession session, String repoId, String namespace, String projectId,
+ String projectVersion)
throws MetadataResolutionException {
try {
Map<String, ArtifactMetadata> artifacts = new HashMap<>();
}
}
}
- return artifacts.values();
+ return new ArrayList<>(artifacts.values());
} catch (IOException e) {
throw new MetadataResolutionException(e.getMessage(), e);
}
}
@Override
- public Collection<String> getArtifactVersions(RepositorySession session, String repoId, String namespace, String projectId,
- String projectVersion)
+ public List<String> getArtifactVersions( RepositorySession session, String repoId, String namespace, String projectId,
+ String projectVersion)
throws MetadataResolutionException {
try {
Path directory = getDirectory(repoId).resolve(namespace + "/" + projectId + "/" + projectVersion);
versions.add((String) entry.getValue());
}
}
- return versions;
+ return new ArrayList<>( versions );
} catch (IOException e) {
throw new MetadataResolutionException(e.getMessage(), e);
}
}
@Override
- public Collection<ProjectVersionReference> getProjectReferences(RepositorySession session, String repoId, String namespace, String projectId,
- String projectVersion)
+ public List<ProjectVersionReference> getProjectReferences( RepositorySession session, String repoId, String namespace, String projectId,
+ String projectVersion)
throws MetadataResolutionException {
try {
Path directory = getDirectory(repoId).resolve(namespace + "/" + projectId + "/" + projectVersion);
}
@Override
- public Collection<String> getRootNamespaces(RepositorySession session, String repoId)
+ public List<String> getRootNamespaces( RepositorySession session, String repoId)
throws MetadataResolutionException {
return this.getChildNamespaces(session, repoId, null);
}
}
@Override
- public Collection<String> getChildNamespaces( RepositorySession session, String repoId, String baseNamespace)
+ public List<String> getChildNamespaces( RepositorySession session, String repoId, String baseNamespace)
throws MetadataResolutionException {
try {
List<String> allNamespaces;
}
@Override
- public Collection<String> getProjects(RepositorySession session, String repoId, String namespace)
+ public List<String> getProjects( RepositorySession session, String repoId, String namespace)
throws MetadataResolutionException {
try {
List<String> projects;
}
@Override
- public Collection<String> getProjectVersions(RepositorySession session, String repoId, String namespace, String projectId)
+ public List<String> getProjectVersions( RepositorySession session, String repoId, String namespace, String projectId)
throws MetadataResolutionException {
try {
List<String> projectVersions;
}
@Override
- public Collection<String> getArtifactVersions( RepositorySession session, String repositoryId, String namespace, String projectId,
- String projectVersion )
+ public List<String> getArtifactVersions( RepositorySession session, String repositoryId, String namespace, String projectId,
+ String projectVersion )
throws MetadataResolutionException
{
final Session jcrSession;
throw new MetadataResolutionException( e.getMessage(), e );
}
- return versions;
+ return new ArrayList<>( versions );
}
@Override
- public Collection<ProjectVersionReference> getProjectReferences( RepositorySession session, String repositoryId, String namespace,
- String projectId, String projectVersion )
+ public List<ProjectVersionReference> getProjectReferences( RepositorySession session, String repositoryId, String namespace,
+ String projectId, String projectVersion )
throws MetadataResolutionException
{
final Session jcrSession;
}
@Override
- public Collection<String> getRootNamespaces( RepositorySession session, String repositoryId )
+ public List<String> getRootNamespaces( RepositorySession session, String repositoryId )
throws MetadataResolutionException
{
return this.getChildNamespaces(session , repositoryId, null );
}
@Override
- public Collection<String> getChildNamespaces( RepositorySession session, String repositoryId, String baseNamespace )
+ public List<String> getChildNamespaces( RepositorySession session, String repositoryId, String baseNamespace )
throws MetadataResolutionException
{
String path = baseNamespace != null
}
@Override
- public Collection<String> getProjects( RepositorySession session, String repositoryId, String namespace )
+ public List<String> getProjects( RepositorySession session, String repositoryId, String namespace )
throws MetadataResolutionException
{
try
}
@Override
- public Collection<String> getProjectVersions( RepositorySession session, String repositoryId, String namespace, String projectId )
+ public List<String> getProjectVersions( RepositorySession session, String repositoryId, String namespace, String projectId )
throws MetadataResolutionException
{
try
}
@Override
- public Collection<ArtifactMetadata> getArtifacts( RepositorySession session, String repositoryId, String namespace, String projectId,
- String projectVersion )
+ public List<ArtifactMetadata> getArtifacts( RepositorySession session, String repositoryId, String namespace, String projectId,
+ String projectVersion )
throws MetadataResolutionException
{
final Session jcrSession;
return node.hasProperty( name ) ? node.getProperty( name ).getString() : null;
}
- private Collection<String> getNodeNames( Session jcrSession, String path, String nodeType )
+ private List<String> getNodeNames( Session jcrSession, String path, String nodeType )
throws MetadataResolutionException
{