mirror of https://github.com/apache/archiva.git
fix fuzzy override placing failure on web
This commit is contained in:
parent
99117364be
commit
d54c2b5472
|
@ -61,10 +61,10 @@ public class DefaultDataValidatorService
|
|||
catch ( RepositoryAdminException e )
|
||||
{
|
||||
throw new ArchivaRestServiceException( e.getMessage(), e );
|
||||
@Override
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean remoteRepositoryIdNotExists( String id )
|
||||
throws ArchivaRestServiceException
|
||||
{
|
||||
|
@ -74,11 +74,11 @@ public class DefaultDataValidatorService
|
|||
}
|
||||
catch ( RepositoryAdminException e )
|
||||
{
|
||||
throw new ArchivaRestServiceException( e.getMessa @Override
|
||||
ge(), e );
|
||||
throw new ArchivaRestServiceException( e.getMessage(), e );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean networkProxyIdNotExists( String id )
|
||||
throws ArchivaRestServiceException
|
||||
{
|
||||
|
|
|
@ -173,13 +173,13 @@ public class DefaultFileUploadService
|
|||
(List<FileMetadata>) httpServletRequest.getSession().getAttribute( FILES_SESSION_KEY );
|
||||
if ( fileMetadatas == null )
|
||||
{
|
||||
fileMetadatas = new CopyOnWriteArrayList<FileMetadata>();
|
||||
fileMetadatas = new CopyOnWriteArrayList<>();
|
||||
httpServletRequest.getSession().setAttribute( FILES_SESSION_KEY, fileMetadatas );
|
||||
}
|
||||
return fileMeta @Override
|
||||
datas;
|
||||
return fileMetadatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteFile( String fileName )
|
||||
throws ArchivaRestServiceException
|
||||
{
|
||||
|
@ -195,10 +195,10 @@ datas;
|
|||
{
|
||||
return file.delete();
|
||||
}
|
||||
r @Override
|
||||
eturn Boolean.FALSE;
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean clearUploadedFiles()
|
||||
throws ArchivaRestServiceException
|
||||
{
|
||||
|
@ -207,21 +207,21 @@ eturn Boolean.FALSE;
|
|||
{
|
||||
deleteFile( new File( fileMetadata.getServerFileName() ).getPath() );
|
||||
}
|
||||
getSessionFileMetadatas().cle @Override
|
||||
ar();
|
||||
getSessionFileMetadatas().clear();
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FileMetadata> getSessionFileMetadatas()
|
||||
throws ArchivaRestServiceException
|
||||
{
|
||||
List<FileMetadata> fileMetadatas =
|
||||
(List<FileMetadata>) httpServletRequest.getSession().getAttribute( FILES_SESSION_KEY );
|
||||
|
||||
return fileMetadatas == null ? Collec @Override
|
||||
tions.<FileMetadata>emptyList() : fileMetadatas;
|
||||
return fileMetadatas == null ? Collections.<FileMetadata>emptyList() : fileMetadatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean save( String repositoryId, String groupId, String artifactId, String version, String packaging,
|
||||
boolean generatePom )
|
||||
throws ArchivaRestServiceException
|
||||
|
@ -265,8 +265,7 @@ tions.<FileMetadata>emptyList() : fileMetadatas;
|
|||
|
||||
// get from the session file with groupId/artifactId
|
||||
|
||||
Iterable<FileMetadata> filesToAdd = Ite @Override
|
||||
rables.filter( fileMetadatas, new Predicate<FileMetadata>()
|
||||
Iterable<FileMetadata> filesToAdd = Iterables.filter( fileMetadatas, new Predicate<FileMetadata>()
|
||||
{
|
||||
public boolean apply( FileMetadata fileMetadata )
|
||||
{
|
||||
|
@ -285,9 +284,9 @@ rables.filter( fileMetadatas, new Predicate<FileMetadata>()
|
|||
deleteFile( fileMetadata.getServerFileName() );
|
||||
}
|
||||
|
||||
@Override
|
||||
filesToAdd = Iterables.filter( fileMetadatas, new Predicate<FileMetadata>()
|
||||
{
|
||||
@Override
|
||||
public boolean apply( FileMetadata fileMetadata )
|
||||
{
|
||||
return fileMetadata != null && fileMetadata.isPomFile();
|
||||
|
|
|
@ -43,10 +43,10 @@ public class DefaultJavascriptLogger
|
|||
return Boolean.TRUE;
|
||||
}
|
||||
toUse.trace( javascriptLog.getMessage() );
|
||||
return Boolean @Override
|
||||
.TRUE;
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean debug( JavascriptLog javascriptLog )
|
||||
{
|
||||
Logger toUse =
|
||||
|
@ -58,10 +58,10 @@ public class DefaultJavascriptLogger
|
|||
}
|
||||
|
||||
toUse.debug( javascriptLog.getMessage() );
|
||||
@Override
|
||||
return Boolean.TRUE;
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean info( JavascriptLog javascriptLog )
|
||||
{
|
||||
Logger toUse =
|
||||
|
@ -72,11 +72,11 @@ return Boolean.TRUE;
|
|||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
toUse.info( javascriptLog.getMessage @Override
|
||||
() );
|
||||
toUse.info( javascriptLog.getMessage() );
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean warn( JavascriptLog javascriptLog )
|
||||
{
|
||||
Logger toUse =
|
||||
|
@ -87,11 +87,11 @@ return Boolean.TRUE;
|
|||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
toUse.warn( javascript @Override
|
||||
Log.getMessage() );
|
||||
toUse.warn( javascriptLog.getMessage() );
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean error( JavascriptLog javascriptLog )
|
||||
{
|
||||
Logger toUse =
|
||||
|
|
|
@ -102,10 +102,10 @@ public class DefaultRuntimeInfoService
|
|||
{
|
||||
return req.getScheme() + "://" + req.getServerName() + ( req.getServerPort() == 80
|
||||
? ""
|
||||
: ":" + req.getServerPort() ) + req.getContextP @Override
|
||||
ath();
|
||||
: ":" + req.getServerPort() ) + req.getContextPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean logMissingI18n( String key )
|
||||
{
|
||||
i18nLogger.info( "missing i18n key : '{}'", key );
|
||||
|
|
|
@ -103,10 +103,10 @@ public class RssFeedServlet
|
|||
servletAuth = wac.getBean( ServletAuthenticator.class );
|
||||
httpAuth = wac.getBean( "httpAuthenticator#basic", HttpAuthenticator.class );
|
||||
// TODO: what if there are other types?
|
||||
repositorySessionFactory = wac.getBean( "repositorySessionFactory", RepositorySessionFactory.cl @Override
|
||||
ass );
|
||||
repositorySessionFactory = wac.getBean( "repositorySessionFactory", RepositorySessionFactory.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doGet( HttpServletRequest req, HttpServletResponse res )
|
||||
throws ServletException, IOException
|
||||
{
|
||||
|
|
|
@ -25,10 +25,8 @@ import org.apache.archiva.redback.users.AbstractUserManager;
|
|||
import org.apache.archiva.redback.users.User;
|
||||
import org.apache.archiva.redback.users.UserManager;
|
||||
import org.apache.archiva.redback.users.UserManagerException;
|
||||
import org.apache.archiva.redback.users.UserManagerListener;
|
||||
import org.apache.archiva.redback.users.UserNotFoundException;
|
||||
import org.apache.archiva.redback.users.UserQuery;
|
||||
import org.apache.archiva.redback.users.configurable.ConfigurableUserManager;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -73,7 +71,7 @@ public class ArchivaConfigurableUsersManager
|
|||
redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getUserManagerImpls();
|
||||
log.info( "use userManagerImpls: '{}'", userManagerImpls );
|
||||
|
||||
userManagerPerId = new LinkedHashMap<String, UserManager>( userManagerImpls.size() );
|
||||
userManagerPerId = new LinkedHashMap<>( userManagerImpls.size() );
|
||||
for ( String id : userManagerImpls )
|
||||
{
|
||||
UserManager userManagerImpl = applicationContext.getBean( "userManager#" + id, UserManager.class );
|
||||
|
@ -93,10 +91,10 @@ public class ArchivaConfigurableUsersManager
|
|||
|
||||
protected boolean useUsersCache()
|
||||
{
|
||||
return this.useUsers @Override
|
||||
Cache;
|
||||
return this.useUsersCache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public User addUser( User user )
|
||||
throws UserManagerException
|
||||
{
|
||||
|
@ -107,10 +105,10 @@ Cache;
|
|||
usersCache.put( user.getUsername(), user );
|
||||
}
|
||||
|
||||
@Override
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addUserUnchecked( User user )
|
||||
throws UserManagerException
|
||||
{
|
||||
|
@ -118,11 +116,11 @@ Cache;
|
|||
|
||||
if ( useUsersCache() )
|
||||
{
|
||||
usersCache.put( use @Override
|
||||
r.getUsername(), user );
|
||||
usersCache.put( user.getUsername(), user );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public User createUser( String username, String fullName, String emailAddress )
|
||||
throws UserManagerException
|
||||
{
|
||||
|
@ -146,19 +144,19 @@ r.getUsername(), user );
|
|||
}
|
||||
if ( lastException != null && allFailed )
|
||||
{
|
||||
throw new UserManagerException( lastException.getMessage(), @Override
|
||||
lastException );
|
||||
throw new UserManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserQuery createUserQuery()
|
||||
{
|
||||
return u @Override
|
||||
serManagerPerId.values().iterator().next().createUserQuery();
|
||||
return userManagerPerId.values().iterator().next().createUserQuery();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void deleteUser( String username )
|
||||
throws UserNotFoundException, UserManagerException
|
||||
{
|
||||
|
@ -182,11 +180,11 @@ serManagerPerId.values().iterator().next().createUserQuery();
|
|||
}
|
||||
if ( lastException != null && allFailed )
|
||||
{
|
||||
throw new @Override
|
||||
UserManagerException( lastException.getMessage(), lastException );
|
||||
throw new UserManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void eraseDatabase()
|
||||
{
|
||||
for ( UserManager userManager : userManagerPerId.values() )
|
||||
|
@ -242,14 +240,14 @@ UserManagerException( lastException.getMessage(), lastException );
|
|||
{
|
||||
throw (UserNotFoundException) lastException;
|
||||
}
|
||||
throw new UserManagerException( @Override
|
||||
lastException.getMessage(), lastException );
|
||||
throw new UserManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
}
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public User findUser( String username )
|
||||
throws UserManagerException
|
||||
{
|
||||
|
@ -259,12 +257,12 @@ lastException.getMessage(), lastException );
|
|||
|
||||
@Override
|
||||
public User getGuestUser()
|
||||
@Override
|
||||
throws UserNotFoundException, UserManagerException
|
||||
{
|
||||
return findUser( GUEST_USERNAME );
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<User> findUsersByEmailKey( String emailKey, boolean orderAscending )
|
||||
throws UserManagerException
|
||||
{
|
||||
|
@ -273,8 +271,7 @@ lastException.getMessage(), lastException );
|
|||
for ( UserManager userManager : userManagerPerId.values() )
|
||||
{
|
||||
List<User> found = userManager.findUsersByEmailKey( emailKey, orderAscending );
|
||||
i @Override
|
||||
f ( found != null )
|
||||
if ( found != null )
|
||||
{
|
||||
users.addAll( found );
|
||||
}
|
||||
|
@ -282,6 +279,7 @@ f ( found != null )
|
|||
return users;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<User> findUsersByFullNameKey( String fullNameKey, boolean orderAscending )
|
||||
throws UserManagerException
|
||||
{
|
||||
|
@ -289,8 +287,7 @@ f ( found != null )
|
|||
|
||||
for ( UserManager userManager : userManagerPerId.values() )
|
||||
{
|
||||
List<User> found = userManager.findUsersByFullNameKey( fullNameKey, orderAscending ); @Override
|
||||
|
||||
List<User> found = userManager.findUsersByFullNameKey( fullNameKey, orderAscending );
|
||||
if ( found != null )
|
||||
{
|
||||
users.addAll( found );
|
||||
|
@ -299,6 +296,7 @@ f ( found != null )
|
|||
return users;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<User> findUsersByQuery( UserQuery query )
|
||||
throws UserManagerException
|
||||
{
|
||||
|
@ -306,8 +304,7 @@ f ( found != null )
|
|||
|
||||
for ( UserManager userManager : userManagerPerId.values() )
|
||||
{
|
||||
List<User> found = userManager.findUsersByQ @Override
|
||||
uery( query );
|
||||
List<User> found = userManager.findUsersByQuery( query );
|
||||
if ( found != null )
|
||||
{
|
||||
users.addAll( found );
|
||||
|
@ -316,6 +313,7 @@ uery( query );
|
|||
return users;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<User> findUsersByUsernameKey( String usernameKey, boolean orderAscending )
|
||||
throws UserManagerException
|
||||
{
|
||||
|
@ -323,10 +321,8 @@ uery( query );
|
|||
|
||||
for ( UserManager userManager : userManagerPerId.values() )
|
||||
{
|
||||
List<User> found = userManager.findUsersByUsernameKey( us @Override
|
||||
ernameKey, orderAscending );
|
||||
if ( @Override
|
||||
found != null )
|
||||
List<User> found = userManager.findUsersByUsernameKey( usernameKey, orderAscending );
|
||||
if ( found != null )
|
||||
{
|
||||
users.addAll( found );
|
||||
}
|
||||
|
@ -334,19 +330,20 @@ found != null )
|
|||
return users;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<User> getUsers()
|
||||
throws UserManagerException
|
||||
{
|
||||
List<User> users = new ArrayList<>();
|
||||
|
||||
for ( UserManager userManager : userManagerPerId.values() )
|
||||
@Override
|
||||
{
|
||||
{
|
||||
List<User> found = userManager.getUsers();
|
||||
if ( found != null )
|
||||
{
|
||||
|
@ -356,6 +353,7 @@ found != null )
|
|||
return users;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<User> getUsers( boolean orderAscending )
|
||||
throws UserManagerException
|
||||
{
|
||||
|
@ -363,7 +361,6 @@ found != null )
|
|||
|
||||
for ( UserManager userManager : userManagerPerId.values() )
|
||||
{
|
||||
@Override
|
||||
List<User> found = userManager.getUsers( orderAscending );
|
||||
if ( found != null )
|
||||
{
|
||||
|
@ -373,8 +370,8 @@ found != null )
|
|||
return users;
|
||||
}
|
||||
|
||||
public boolean isReadOnly( @Override
|
||||
)
|
||||
@Override
|
||||
public boolean isReadOnly()
|
||||
{
|
||||
boolean readOnly = false;
|
||||
|
||||
|
@ -385,12 +382,12 @@ found != null )
|
|||
return readOnly;
|
||||
}
|
||||
|
||||
@Override
|
||||
public User updateUser( User user )
|
||||
throws UserNotFoundException, UserManagerException
|
||||
{
|
||||
|
||||
UserManager userManage @Override
|
||||
r = userManagerPerId.get( user.getUserManagerId() );
|
||||
UserManager userManager = userManagerPerId.get( user.getUserManagerId() );
|
||||
|
||||
user = userManager.updateUser( user );
|
||||
|
||||
|
@ -402,6 +399,7 @@ r = userManagerPerId.get( user.getUserManagerId() );
|
|||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public User updateUser( User user, boolean passwordChangeRequired )
|
||||
throws UserNotFoundException, UserManagerException
|
||||
{
|
||||
|
@ -439,7 +437,6 @@ r = userManagerPerId.get( user.getUserManagerId() );
|
|||
}
|
||||
}
|
||||
catch ( Exception e )
|
||||
@Override
|
||||
{
|
||||
lastException = e;
|
||||
}
|
||||
|
@ -452,6 +449,7 @@ r = userManagerPerId.get( user.getUserManagerId() );
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean userExists( String userName )
|
||||
throws UserManagerException
|
||||
{
|
||||
|
@ -475,8 +473,7 @@ r = userManagerPerId.get( user.getUserManagerId() );
|
|||
lastException = e;
|
||||
}
|
||||
}
|
||||
if ( las @Override
|
||||
tException != null && allFailed )
|
||||
if ( lastException != null && allFailed )
|
||||
{
|
||||
throw new UserManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
|
@ -490,6 +487,7 @@ tException != null && allFailed )
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescriptionKey()
|
||||
{
|
||||
return "archiva.redback.usermanager.configurable.archiva";
|
||||
|
|
|
@ -70,11 +70,11 @@ public class ArchivaLdapRoleMapperConfiguration
|
|||
catch ( RepositoryAdminException e )
|
||||
{
|
||||
throw new MappingException( e.getMessage(), e );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void updateLdapMapping( String ldapGroup, List<String> roles )
|
||||
throws MappingException
|
||||
{
|
||||
|
@ -96,11 +96,11 @@ public class ArchivaLdapRoleMapperConfiguration
|
|||
}
|
||||
catch ( RepositoryAdminException e )
|
||||
{
|
||||
throw new MappingException( e.getMessa @Override
|
||||
ge(), e );
|
||||
throw new MappingException( e.getMessage(), e );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeLdapMapping( String group )
|
||||
throws MappingException
|
||||
{
|
||||
|
@ -115,12 +115,12 @@ ge(), e );
|
|||
}
|
||||
catch ( RepositoryAdminException e )
|
||||
{
|
||||
throw new MappingExceptio @Override
|
||||
n( e.getMessage(), e );
|
||||
throw new MappingException( e.getMessage(), e );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Collection<String>> getLdapGroupMappings()
|
||||
throws MappingException
|
||||
{
|
||||
|
@ -147,11 +147,11 @@ n( e.getMessage(), e );
|
|||
}
|
||||
catch ( RepositoryAdminException e )
|
||||
{
|
||||
throw new @Override
|
||||
MappingException( e.getMessage(), e );
|
||||
throw new MappingException( e.getMessage(), e );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLdapGroupMappings( Map<String, List<String>> mappings )
|
||||
throws MappingException
|
||||
{
|
||||
|
|
|
@ -132,10 +132,10 @@ public class ArchivaRbacManager
|
|||
@Override
|
||||
public Role createRole( String name )
|
||||
{
|
||||
return getRbacManagerForWrite().createRole( n @Override
|
||||
ame );
|
||||
return getRbacManagerForWrite().createRole( name );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Role saveRole( Role role )
|
||||
throws RbacObjectInvalidException, RbacManagerException
|
||||
{
|
||||
|
@ -160,10 +160,10 @@ ame );
|
|||
{
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
@Override
|
||||
return role;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveRoles( Collection<Role> roles )
|
||||
throws RbacObjectInvalidException, RbacManagerException
|
||||
{
|
||||
|
@ -186,11 +186,11 @@ ame );
|
|||
}
|
||||
if ( lastException != null && allFailed )
|
||||
{
|
||||
throw new RbacManagerException( lastException.getMes @Override
|
||||
sage(), lastException );
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Role getRole( String roleName )
|
||||
throws RbacObjectNotFoundException, RbacManagerException
|
||||
{
|
||||
|
@ -221,12 +221,12 @@ sage(), lastException );
|
|||
log.debug( "cannot find role for name: ‘{}", roleName );
|
||||
if ( lastException != null )
|
||||
{
|
||||
throw new RbacManagerException( lastException.getMessage(), @Override
|
||||
lastException );
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Role> getAllRoles()
|
||||
throws RbacManagerException
|
||||
{
|
||||
|
@ -253,12 +253,12 @@ sage(), lastException );
|
|||
if ( lastException != null && allFailed )
|
||||
{
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
@Override
|
||||
}
|
||||
|
||||
return new ArrayList<>( allRoles.values() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeRole( Role role )
|
||||
throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
|
||||
{
|
||||
|
@ -280,25 +280,25 @@ sage(), lastException );
|
|||
|
||||
if ( lastException != null && allFailed )
|
||||
{
|
||||
throw new @Override
|
||||
RbacManagerException( lastException.getMessage(), lastException );
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Permission createPermission( String name )
|
||||
throws Rb @Override
|
||||
acManagerException
|
||||
throws RbacManagerException
|
||||
{
|
||||
return getRbacManagerForWrite().createPermission( name );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Permission createPermission( String name, String operationName, String resourceIdentifier )
|
||||
throws RbacManagerException
|
||||
@Override
|
||||
{
|
||||
return getRbacManagerForWrite().createPermission( name, operationName, resourceIdentifier );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Permission savePermission( Permission permission )
|
||||
throws RbacObjectInvalidException, RbacManagerException
|
||||
{
|
||||
|
@ -322,13 +322,13 @@ acManagerException
|
|||
|
||||
if ( lastException != null && allFailed )
|
||||
{
|
||||
@Override
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
|
||||
return permission;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Permission getPermission( String permissionName )
|
||||
throws RbacObjectNotFoundException, RbacManagerException
|
||||
{
|
||||
|
@ -357,14 +357,14 @@ acManagerException
|
|||
}
|
||||
}
|
||||
|
||||
if ( lastException != null @Override
|
||||
)
|
||||
if ( lastException != null )
|
||||
{
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Permission> getAllPermissions()
|
||||
throws RbacManagerException
|
||||
{
|
||||
|
@ -390,12 +390,12 @@ acManagerException
|
|||
|
||||
if ( lastException != null && allFailed )
|
||||
{
|
||||
@Override
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
return new ArrayList<>( allPermissions.values() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePermission( Permission permission )
|
||||
throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
|
||||
{
|
||||
|
@ -413,22 +413,22 @@ acManagerException
|
|||
{
|
||||
lastException = e;
|
||||
}
|
||||
} @Override
|
||||
|
||||
}
|
||||
|
||||
if ( lastException != null && allFailed )
|
||||
{
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
@Override
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Operation createOperation( String name )
|
||||
throws RbacManagerException
|
||||
{
|
||||
return getRbacManagerForWrite().createOperation( name );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Operation saveOperation( Operation operation )
|
||||
throws RbacObjectInvalidException, RbacManagerException
|
||||
{
|
||||
|
@ -448,7 +448,6 @@ acManagerException
|
|||
{
|
||||
lastException = e;
|
||||
}
|
||||
@Override
|
||||
}
|
||||
|
||||
if ( lastException != null && allFailed )
|
||||
|
@ -458,6 +457,7 @@ acManagerException
|
|||
return operation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Operation getOperation( String operationName )
|
||||
throws RbacObjectNotFoundException, RbacManagerException
|
||||
{
|
||||
|
@ -482,8 +482,7 @@ acManagerException
|
|||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
lastExce @Override
|
||||
ption = e;
|
||||
lastException = e;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -494,6 +493,7 @@ ption = e;
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Operation> getAllOperations()
|
||||
throws RbacManagerException
|
||||
{
|
||||
|
@ -517,7 +517,6 @@ ption = e;
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
if ( lastException != null && allFailed )
|
||||
{
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
|
@ -525,6 +524,7 @@ ption = e;
|
|||
return new ArrayList<>( allOperations.values() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeOperation( Operation operation )
|
||||
throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
|
||||
{
|
||||
|
@ -539,7 +539,6 @@ ption = e;
|
|||
allFailed = false;
|
||||
}
|
||||
catch ( Exception e )
|
||||
@Override
|
||||
{
|
||||
lastException = e;
|
||||
}
|
||||
|
@ -547,17 +546,18 @@ ption = e;
|
|||
|
||||
if ( lastException != null && allFailed )
|
||||
{
|
||||
throw new RbacMan @Override
|
||||
agerException( lastException.getMessage(), lastException );
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resource createResource( String identifier )
|
||||
throws RbacManagerException
|
||||
{
|
||||
return getRbacManagerForWrite().createResource( identifier );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resource saveResource( Resource resource )
|
||||
throws RbacObjectInvalidException, RbacManagerException
|
||||
{
|
||||
|
@ -573,8 +573,7 @@ agerException( lastException.getMessage(), lastException );
|
|||
allFailed = false;
|
||||
}
|
||||
}
|
||||
catch ( Exception e ) @Override
|
||||
|
||||
catch ( Exception e )
|
||||
{
|
||||
lastException = e;
|
||||
}
|
||||
|
@ -587,6 +586,7 @@ agerException( lastException.getMessage(), lastException );
|
|||
return resource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resource getResource( String resourceIdentifier )
|
||||
throws RbacObjectNotFoundException, RbacManagerException
|
||||
{
|
||||
|
@ -609,7 +609,6 @@ agerException( lastException.getMessage(), lastException );
|
|||
return r;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
catch ( Exception e )
|
||||
{
|
||||
lastException = e;
|
||||
|
@ -623,6 +622,7 @@ agerException( lastException.getMessage(), lastException );
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Resource> getAllResources()
|
||||
throws RbacManagerException
|
||||
{
|
||||
|
@ -641,7 +641,6 @@ agerException( lastException.getMessage(), lastException );
|
|||
allFailed = false;
|
||||
}
|
||||
catch ( Exception e )
|
||||
@Override
|
||||
{
|
||||
lastException = e;
|
||||
}
|
||||
|
@ -654,6 +653,7 @@ agerException( lastException.getMessage(), lastException );
|
|||
return new ArrayList<>( allResources.values() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeResource( Resource resource )
|
||||
throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
|
||||
{
|
||||
|
@ -665,7 +665,6 @@ agerException( lastException.getMessage(), lastException );
|
|||
{
|
||||
rbacManager.removeResource( resource );
|
||||
resourcesCache.remove( resource.getIdentifier() );
|
||||
@Override
|
||||
allFailed = false;
|
||||
}
|
||||
catch ( Exception e )
|
||||
|
@ -674,19 +673,20 @@ agerException( lastException.getMessage(), lastException );
|
|||
}
|
||||
}
|
||||
|
||||
if ( lastException != null @Override
|
||||
&& allFailed )
|
||||
if ( lastException != null && allFailed )
|
||||
{
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserAssignment createUserAssignment( String principal )
|
||||
throws RbacManagerException
|
||||
{
|
||||
return getRbacManagerForWrite().createUserAssignment( principal );
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserAssignment saveUserAssignment( UserAssignment userAssignment )
|
||||
throws RbacObjectInvalidException, RbacManagerException
|
||||
{
|
||||
|
@ -700,7 +700,6 @@ agerException( lastException.getMessage(), lastException );
|
|||
{
|
||||
userAssignment = rbacManager.saveUserAssignment( userAssignment );
|
||||
allFailed = false;
|
||||
@Override
|
||||
}
|
||||
}
|
||||
catch ( Exception e )
|
||||
|
@ -716,6 +715,7 @@ agerException( lastException.getMessage(), lastException );
|
|||
return userAssignment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserAssignment getUserAssignment( String principal )
|
||||
throws RbacObjectNotFoundException, RbacManagerException
|
||||
{
|
||||
|
@ -793,7 +793,6 @@ agerException( lastException.getMessage(), lastException );
|
|||
{
|
||||
for ( RBACManager rbacManager : rbacManagersPerId.values() )
|
||||
{
|
||||
@Override
|
||||
try
|
||||
{
|
||||
boolean exists = rbacManager.userAssignmentExists( assignment );
|
||||
|
@ -811,6 +810,7 @@ agerException( lastException.getMessage(), lastException );
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserAssignment> getAllUserAssignments()
|
||||
throws RbacManagerException
|
||||
{
|
||||
|
@ -834,8 +834,7 @@ agerException( lastException.getMessage(), lastException );
|
|||
}
|
||||
allUserAssignments.put( ua.getPrincipal(), ua );
|
||||
}
|
||||
allFai @Override
|
||||
led = false;
|
||||
allFailed = false;
|
||||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
|
@ -850,6 +849,7 @@ led = false;
|
|||
return new ArrayList<>( allUserAssignments.values() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
|
||||
throws RbacManagerException
|
||||
{
|
||||
|
@ -862,8 +862,7 @@ led = false;
|
|||
{
|
||||
List<UserAssignment> userAssignments = rbacManager.getUserAssignmentsForRoles( roleNames );
|
||||
|
||||
allUserAssignments.addAll( @Override
|
||||
userAssignments );
|
||||
allUserAssignments.addAll( userAssignments );
|
||||
|
||||
allFailed = false;
|
||||
}
|
||||
|
@ -880,6 +879,7 @@ userAssignments );
|
|||
return allUserAssignments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeUserAssignment( UserAssignment userAssignment )
|
||||
throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
|
||||
{
|
||||
|
@ -929,27 +929,25 @@ userAssignments );
|
|||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
@Override
|
||||
lastException = e;
|
||||
}
|
||||
}
|
||||
|
||||
if ( lastException != null && allFailed )
|
||||
{
|
||||
throw new RbacManagerException( lastException.getMe @Override
|
||||
ssage(), lastException );
|
||||
throw new RbacManagerException( lastException.getMessage(), lastException );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public b @Override
|
||||
oolean roleExists( Role role )
|
||||
public boolean roleExists( Role role )
|
||||
throws RbacManagerException
|
||||
{
|
||||
return roleExists( role.getName() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void eraseDatabase()
|
||||
{
|
||||
log.warn( "eraseDatabase not implemented" );
|
||||
|
@ -961,11 +959,13 @@ oolean roleExists( Role role )
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescriptionKey()
|
||||
{
|
||||
return "archiva.redback.rbacmanager.archiva";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly()
|
||||
{
|
||||
return false;
|
||||
|
|
|
@ -106,10 +106,10 @@ public class SecuritySynchronization
|
|||
{
|
||||
syncRepoConfiguration( (String) propertyValue );
|
||||
}
|
||||
@Override
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeConfigurationChange( org.apache.archiva.redback.components.registry.Registry registry,
|
||||
String propertyName, Object propertyValue )
|
||||
{
|
||||
|
|
|
@ -44,9 +44,6 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipFile;
|
||||
|
@ -124,12 +121,12 @@ public class DownloadArtifactsTest
|
|||
redirectServer.setHandler( contextRedirect );
|
||||
redirectServer.start();
|
||||
this.redirectPort = redirectServer.getConnectors()[0].getLocalPort();
|
||||
log.info( "redirect server port {}", redirec @Override
|
||||
tPort );
|
||||
log.info( "redirect server port {}", redirectPort );
|
||||
|
||||
}
|
||||
|
||||
@After
|
||||
@Override
|
||||
public void tearDown()
|
||||
throws Exception
|
||||
{
|
||||
|
|
|
@ -77,138 +77,136 @@ public class TestMetadataRepository
|
|||
@Override
|
||||
public ProjectMetadata getProject( String repoId, String namespace, String projectId )
|
||||
{
|
||||
throw new UnsupportedOperationExcept @Override
|
||||
ion();
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId,
|
||||
String projectVersion )
|
||||
{
|
||||
throw new UnsupportedO @Override
|
||||
perationException();
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId,
|
||||
String projectVersion )
|
||||
{
|
||||
throw ne @Override
|
||||
w UnsupportedOperationException();
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ProjectVersionReference> getProjectReferences( String repoId, String namespace, String projectId,
|
||||
String projectVersion )
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Collection<String> getRootNamespaces( String rep @Override
|
||||
oId )
|
||||
public Collection<String> getRootNamespaces( String repoId )
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Collection<String> getNamespaces( String repoId, @Override
|
||||
String namespace )
|
||||
@Override
|
||||
public Collection<String> getNamespaces( String repoId, String namespace )
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Collection<String> getProjects( @Override
|
||||
String repoId, String namespace )
|
||||
@Override
|
||||
public Collection<String> getProjects( String repoId, String namespace )
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Collection<String @Override
|
||||
> getProjectVersions( String repoId, String namespace, String projectId )
|
||||
@Override
|
||||
public Collection<String> getProjectVersions( String repoId, String namespace, String projectId )
|
||||
{
|
||||
return versions;
|
||||
}
|
||||
|
||||
public @Override
|
||||
void updateProject( String repoId, ProjectMetadata project )
|
||||
@Override
|
||||
public void updateProject( String repoId, ProjectMetadata project )
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void updateArtifact( String repoId, String namespace, String projectId, String proj @Override
|
||||
ectVersion,
|
||||
@Override
|
||||
public void updateArtifact( String repoId, String namespace, String projectId, String projectVersion,
|
||||
ArtifactMetadata artifactMeta )
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void updateProjectVersion( String repoId, String namespace, String @Override
|
||||
projectId,
|
||||
@Override
|
||||
public void updateProjectVersion( String repoId, String namespace, String projectId,
|
||||
ProjectVersionMetadata versionMetadata )
|
||||
{
|
||||
throw new Uns @Override
|
||||
upportedOperationException();
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateNamespace( String repoId, String namespace )
|
||||
{
|
||||
@Override
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMetadataFacets( String repodId, String facetId )
|
||||
{
|
||||
r @Override
|
||||
eturn Collections.emptyList();
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public MetadataFacet getMetadataFacet( String repositoryId, String facetId, String name )
|
||||
@Override
|
||||
public MetadataFacet getMetadataFacet( String repositoryId, String facetId, String name )
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void addMetadataFacet( String repositoryId, MetadataFa @Override
|
||||
cet metadataFacet )
|
||||
@Override
|
||||
public void addMetadataFacet( String repositoryId, MetadataFacet metadataFacet )
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeMetadataFacets( String repositoryId, String facetId )
|
||||
{
|
||||
@Override
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void removeMetadataFacet( String repoId, String facetId, Strin @Override
|
||||
g name )
|
||||
@Override
|
||||
public void removeMetadataFacet( String repoId, String facetId, String name )
|
||||
{
|
||||
//To change body of implemented methods use File | Settings | File Templates.
|
||||
@Override
|
||||
}
|
||||
|
||||
public List<ArtifactMetadata> getArtifactsByDateRange( String repoId, Date startTime, Date endTime )
|
||||
@Override
|
||||
public List<ArtifactMetadata> getArtifactsByDateRange( String repoId, Date startTime, Date endTime )
|
||||
{
|
||||
return artifacts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getRepositories()
|
||||
{
|
||||
return Collections.singletonList( TEST_REPO );
|
||||
}
|
||||
|
||||
public @Override
|
||||
List<ArtifactMetadata> getArtifactsByChecksum( String repoId, String checksum )
|
||||
@Override
|
||||
public List<ArtifactMetadata> getArtifactsByChecksum( String repoId, String checksum )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeArtifact( String repositoryId, String namespace, String project, String version, String id )
|
||||
{
|
||||
throw new Unsu @Override
|
||||
pportedOperationException();
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void removeArtifact( String repositoryId, String name @Override
|
||||
space, String project, String version,
|
||||
@Override
|
||||
public void removeArtifact( String repositoryId, String namespace, String project, String version,
|
||||
MetadataFacet metadataFacet )
|
||||
throws MetadataRepositoryException
|
||||
{
|
||||
|
@ -216,73 +214,74 @@ space, String project, String version,
|
|||
}
|
||||
|
||||
@Override
|
||||
public void remove @Override
|
||||
Repository( String repo @Override
|
||||
Id )
|
||||
public void removeRepository( String repoId )
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
pu @Override
|
||||
blic Collection<ArtifactMetadata> getArtifacts( String repoId, String names @Override
|
||||
pace, String projectId,
|
||||
@Override
|
||||
public Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId,
|
||||
String projectVersion )
|
||||
{
|
||||
return artifacts;
|
||||
}
|
||||
|
||||
public void save() @Override
|
||||
|
||||
@Override
|
||||
public void save()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void revert()
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public boolean canObtainAccess( Class @Override
|
||||
<?> aClass )
|
||||
@Override
|
||||
public boolean canObtainAccess( Class<?> aClass )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T>T obtainAccess( Class<T> aClass )
|
||||
{
|
||||
return @Override
|
||||
null;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArtifactMetadata> getArtifacts( String repositoryId )
|
||||
{
|
||||
return artifacts;
|
||||
}
|
||||
|
||||
public void removeArtifact( A @Override
|
||||
rtifactMetadata artifactMetadata, String baseVersion )
|
||||
@Override
|
||||
public void removeArtifact( ArtifactMetadata artifactMetadata, String baseVersion )
|
||||
throws MetadataRepositoryException
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void remov @Override
|
||||
eNamespace( String repositoryId, String namespace )
|
||||
@Override
|
||||
public void removeNamespace( String repositoryId, String namespace )
|
||||
throws MetadataRepositoryException
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeProjectVersion( String repoId, String namespace, String projectId, String projectVersion )
|
||||
throws MetadataRepositoryException
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeProject( String repositoryId, String namespace, String projectId )
|
||||
throws MetadataRepositoryException
|
||||
{
|
||||
|
@ -290,6 +289,7 @@ eNamespace( String repositoryId, String namespace )
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasMetadataFacet( String repositoryId, String facetId )
|
||||
throws MetadataRepositoryException
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue