org.repoweb.model
Class FailSafeRepository

java.lang.Object
  extended byorg.repoweb.model.FailSafeRepository
All Implemented Interfaces:
GroupList, Repository

class FailSafeRepository
extends java.lang.Object
implements Repository, GroupList

Mock an empty repository .


Constructor Summary
(package private) FailSafeRepository()
           
 
Method Summary
 Artifact buildPom(Project project)
          Build a new POM in the repository.
 ArtifactList findArtifactByClass(java.lang.String fullClassName)
          Search Artifacts that contains a class.
 ArtifactList findArtifacts(java.lang.String groupId, java.lang.String typeId, java.lang.String filename)
          Search for Artifacts.
 GroupList findGroups(java.lang.String pattern)
          Search groups that have a groupId that match pattern.
 GroupList getAllGroups()
          Get alll groups of this repository.
 Artifact getArtifact(java.lang.String groupId, java.lang.String typeId, java.lang.String filename)
          Get one Artifact.
 Group getGroup(int idx)
           
 Group getGroup(java.lang.String groupId)
          Get a group from this repository.
 int getGroupCount()
           
 java.util.List getGroups()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FailSafeRepository

FailSafeRepository()
Method Detail

getGroup

public Group getGroup(java.lang.String groupId)
               throws UnknownGroupIdException
Description copied from interface: Repository
Get a group from this repository.

Specified by:
getGroup in interface Repository
Parameters:
groupId - group Id.
Returns:
One group.
Throws:
UnknownGroupIdException - group Id does not exist in the repo.

findGroups

public GroupList findGroups(java.lang.String pattern)
Description copied from interface: Repository
Search groups that have a groupId that match pattern.

Specified by:
findGroups in interface Repository
Parameters:
pattern - pattern for search
Returns:
List of groups.

findArtifacts

public ArtifactList findArtifacts(java.lang.String groupId,
                                  java.lang.String typeId,
                                  java.lang.String filename)
Description copied from interface: Repository
Search for Artifacts.

Specified by:
findArtifacts in interface Repository
Parameters:
groupId - Group Id of the artifact (e.g. 'junit')
typeId - Artifact type (e.g. 'jar')
filename - Artifact file name (e.g. 'junit-3.8.1.jar')
Returns:
an Artifact.

findArtifactByClass

public ArtifactList findArtifactByClass(java.lang.String fullClassName)
Description copied from interface: Repository
Search Artifacts that contains a class.

Specified by:
findArtifactByClass in interface Repository
Parameters:
fullClassName - full qualified class name
Returns:
List of artifacts containing the searched class.

buildPom

public Artifact buildPom(Project project)
                  throws BuildFailureException
Description copied from interface: Repository
Build a new POM in the repository.

Specified by:
buildPom in interface Repository
Parameters:
project - the bean of the POM.
Returns:
the Artifact that represent the POM.
Throws:
BuildFailureException - Failed to build the POM.

getArtifact

public Artifact getArtifact(java.lang.String groupId,
                            java.lang.String typeId,
                            java.lang.String filename)
                     throws UnknownArtifactException
Description copied from interface: Repository
Get one Artifact.

Specified by:
getArtifact in interface Repository
Parameters:
groupId - Group Id of the artifact (e.g. 'junit')
typeId - Artifact type (e.g. 'jar')
filename - Artifact file name (e.g. 'junit-3.8.1.jar')
Returns:
an Artifact.
Throws:
UnknownArtifactException - artifact do not exist in the repo.

getAllGroups

public GroupList getAllGroups()
Description copied from interface: Repository
Get alll groups of this repository.

Specified by:
getAllGroups in interface Repository
Returns:
List of groups.

getGroups

public java.util.List getGroups()
Specified by:
getGroups in interface GroupList

getGroup

public Group getGroup(int idx)
Specified by:
getGroup in interface GroupList

getGroupCount

public int getGroupCount()
Specified by:
getGroupCount in interface GroupList


Copyright © 2003-2005 Repoweb. All Rights Reserved.