Search in sources :

Example 1 with ListDirectoryHandler

use of org.dcache.util.list.ListDirectoryHandler in project dcache by dCache.

the class DirectoryLookUpPool method starting.

@Override
protected void starting() throws Exception {
    _log.info("Lookup Pool {} starting", _poolName);
    super.starting();
    _pnfs = new PnfsHandler(this, _pnfsManager);
    ListDirectoryHandler listHandler = new ListDirectoryHandler(_pnfs);
    addMessageListener(listHandler);
    _list = listHandler;
    useInterpreter(true);
}
Also used : ListDirectoryHandler(org.dcache.util.list.ListDirectoryHandler) PnfsHandler(diskCacheV111.util.PnfsHandler)

Example 2 with ListDirectoryHandler

use of org.dcache.util.list.ListDirectoryHandler in project dcache by dCache.

the class AbstractFtpDoorV1 method acceptLogin.

protected void acceptLogin(Subject mappedSubject, Set<LoginAttribute> loginAttributes, Restriction restriction, FsPath doorRootPath) {
    FsPath userRootPath = FsPath.ROOT;
    String userHomePath = "/";
    for (LoginAttribute attribute : loginAttributes) {
        if (attribute instanceof RootDirectory) {
            userRootPath = FsPath.create(((RootDirectory) attribute).getRoot());
        } else if (attribute instanceof HomeDirectory) {
            userHomePath = ((HomeDirectory) attribute).getHome();
        } else if (attribute instanceof MaxUploadSize) {
            long max = ((MaxUploadSize) attribute).getMaximumSize();
            if (!_maximumUploadSize.isPresent() || max < _maximumUploadSize.getAsLong()) {
                _maximumUploadSize = OptionalLong.of(max);
            }
        }
    }
    _authz = Restrictions.concat(_doorRestriction, restriction);
    String cwd;
    if (doorRootPath == null) {
        doorRootPath = userRootPath;
        cwd = userHomePath;
    } else {
        if (userRootPath.hasPrefix(doorRootPath)) {
            cwd = userRootPath.chroot(userHomePath).stripPrefix(doorRootPath);
        } else {
            cwd = "/";
        }
    }
    _pnfs = _settings.createPnfsHandler(_cellEndpoint);
    _pnfs.setSubject(mappedSubject);
    _pnfs.setRestriction(_authz);
    _listSource = new ListDirectoryHandler(_pnfs);
    _subject = mappedSubject;
    _cwd = cwd;
    _doorRootPath = doorRootPath;
    _userRootPath = userRootPath;
    _userHomePath = FsPath.create(userHomePath);
    _identityResolver = _identityResolverFactory.withSubject(mappedSubject);
}
Also used : HomeDirectory(org.dcache.auth.attributes.HomeDirectory) ListDirectoryHandler(org.dcache.util.list.ListDirectoryHandler) LoginAttribute(org.dcache.auth.attributes.LoginAttribute) MaxUploadSize(org.dcache.auth.attributes.MaxUploadSize) RootDirectory(org.dcache.auth.attributes.RootDirectory) FsPath(diskCacheV111.util.FsPath)

Example 3 with ListDirectoryHandler

use of org.dcache.util.list.ListDirectoryHandler in project dcache by dCache.

the class RemoteNameSpaceProviderTests method setup.

@Before
public void setup() throws NoSuchMethodException {
    _endpoint = mock(CellEndpoint.class);
    CellStub stub = new CellStub(_endpoint, CELLPATH_PNFSMANAGER);
    PnfsHandler pnfs = new PnfsHandler(stub);
    _listHandler = new ListDirectoryHandler(pnfs);
    _namespace = new RemoteNameSpaceProvider(pnfs, _listHandler);
}
Also used : ListDirectoryHandler(org.dcache.util.list.ListDirectoryHandler) CellEndpoint(dmg.cells.nucleus.CellEndpoint) CellStub(org.dcache.cells.CellStub) PnfsHandler(diskCacheV111.util.PnfsHandler) Before(org.junit.Before)

Example 4 with ListDirectoryHandler

use of org.dcache.util.list.ListDirectoryHandler in project dcache by dCache.

the class BulkMultipleTargetJobTest method setup.

@Before
public void setup() throws Exception {
    fileTree = HashMultimap.create();
    attributesMap = new HashMap<>();
    loadEntries();
    pnfsHandler = new TestPnfsHandler();
    listDirectoryHandler = new ListDirectoryHandler(pnfsHandler);
    submissionHandler = mock(BulkSubmissionHandler.class);
    completionHandler = new BulkJobCompletionHandler(this);
}
Also used : BulkJobCompletionHandler(org.dcache.services.bulk.handlers.BulkJobCompletionHandler) ListDirectoryHandler(org.dcache.util.list.ListDirectoryHandler) BulkSubmissionHandler(org.dcache.services.bulk.handlers.BulkSubmissionHandler) Before(org.junit.Before)

Aggregations

ListDirectoryHandler (org.dcache.util.list.ListDirectoryHandler)4 PnfsHandler (diskCacheV111.util.PnfsHandler)2 Before (org.junit.Before)2 FsPath (diskCacheV111.util.FsPath)1 CellEndpoint (dmg.cells.nucleus.CellEndpoint)1 HomeDirectory (org.dcache.auth.attributes.HomeDirectory)1 LoginAttribute (org.dcache.auth.attributes.LoginAttribute)1 MaxUploadSize (org.dcache.auth.attributes.MaxUploadSize)1 RootDirectory (org.dcache.auth.attributes.RootDirectory)1 CellStub (org.dcache.cells.CellStub)1 BulkJobCompletionHandler (org.dcache.services.bulk.handlers.BulkJobCompletionHandler)1 BulkSubmissionHandler (org.dcache.services.bulk.handlers.BulkSubmissionHandler)1