Search in sources :

Example 46 with SRMInternalErrorException

use of org.dcache.srm.SRMInternalErrorException in project dcache by dCache.

the class DcacheUserManager method login.

protected LoginReply login(CertPath path, String remoteIP) throws SRMInternalErrorException, SRMAuthorizationException {
    try {
        Subject subject = new Subject();
        subject.getPublicCredentials().add(path);
        try {
            subject.getPrincipals().add(new Origin(remoteIP));
        } catch (UnknownHostException e) {
            LOGGER.info("Could not add origin {}: {}", remoteIP, e.getMessage());
        }
        return loginStrategy.login(subject);
    } catch (PermissionDeniedCacheException e) {
        throw new SRMAuthorizationException(e.getMessage(), e);
    } catch (CacheException e) {
        throw new SRMInternalErrorException(e.getMessage(), e);
    }
}
Also used : Origin(org.dcache.auth.Origin) SRMInternalErrorException(org.dcache.srm.SRMInternalErrorException) PermissionDeniedCacheException(diskCacheV111.util.PermissionDeniedCacheException) SRMAuthorizationException(org.dcache.srm.SRMAuthorizationException) UnknownHostException(java.net.UnknownHostException) CacheException(diskCacheV111.util.CacheException) PermissionDeniedCacheException(diskCacheV111.util.PermissionDeniedCacheException) Subject(javax.security.auth.Subject)

Aggregations

SRMInternalErrorException (org.dcache.srm.SRMInternalErrorException)46 SRMException (org.dcache.srm.SRMException)34 SRMAuthorizationException (org.dcache.srm.SRMAuthorizationException)26 SRMInvalidPathException (org.dcache.srm.SRMInvalidPathException)21 CacheException (diskCacheV111.util.CacheException)20 PermissionDeniedCacheException (diskCacheV111.util.PermissionDeniedCacheException)19 TimeoutCacheException (diskCacheV111.util.TimeoutCacheException)18 FileCorruptedCacheException (diskCacheV111.util.FileCorruptedCacheException)17 FileExistsCacheException (diskCacheV111.util.FileExistsCacheException)17 FileIsNewCacheException (diskCacheV111.util.FileIsNewCacheException)17 FileNotFoundCacheException (diskCacheV111.util.FileNotFoundCacheException)17 NotDirCacheException (diskCacheV111.util.NotDirCacheException)17 FsPath (diskCacheV111.util.FsPath)13 TReturnStatus (org.dcache.srm.v2_2.TReturnStatus)13 NoRouteToCellException (dmg.cells.nucleus.NoRouteToCellException)10 Subject (javax.security.auth.Subject)10 URI (java.net.URI)9 PnfsHandler (diskCacheV111.util.PnfsHandler)8 SRMInvalidRequestException (org.dcache.srm.SRMInvalidRequestException)7 SRMDuplicationException (org.dcache.srm.SRMDuplicationException)6