Package edu.sdsc.grid.io.srb

Examples of edu.sdsc.grid.io.srb.SRBFileSystem


    public void testNullClientReconnect() throws Exception {
        // get the gridftp client from the file system and make it null to
        // simulate a client timeout (e.g. maybe client that uses vfs has been
        // left idle for over 30 mins)
        SRBVfsFileSystem fs = (SRBVfsFileSystem) this.relativeToFO.getFileSystem();
        SRBFileSystem client = fs.getClient();
        client = null;
        // now do some operations following the timeout.
        // The fileSystem should perform a reconnect
        vfsTestHelp.doListTest(relativeToFO);
    }
View Full Code Here


                fileSystem = this.createSrbFileSystem(rootName, fileSystemOptions);
                srbAccount = (SRBAccount)(fileSystem.getAccount());
            }
            else
            {
                fileSystem = new SRBFileSystem(srbAccount);
            }
           
            attribs.put(ACCOUNT, fileSystem.getAccount());
            attribs.put(FILESYSTEM, fileSystem);
            attribs.put(HOME_DIRECTORY, srbAccount.getHomeDirectory());
View Full Code Here

                    this.fileSystem = this.createSrbFileSystem((GenericFileName)(this.getRootName()), this.getFileSystemOptions());
                }
            } catch (Exception ex) {
                throw new FileSystemException("vfs.provider.srb/connect.error", ex);
            }
            SRBFileSystem returnClient = this.getSRBFileSystem();
            //this.srbFileSystem = null;
            return returnClient;
        }
    }
View Full Code Here

        try {
            log.debug("createSrbFileSystem");
            SRBAccount srbAccount = (SRBAccount)(createAccount(rootName, opts, SRBFileSystemConfigBuilder.getInstance()));
            log.debug("got account");

            SRBFileSystem _srbFileSystem = new SRBFileSystem(srbAccount);

            // update the firewall port range
            Integer portMin = SRBFileSystemConfigBuilder.getInstance().getFileWallPortMin(opts);
            Integer portMax = SRBFileSystemConfigBuilder.getInstance().getFileWallPortMax(opts);
            if (portMin != null && portMax != null) {
                _srbFileSystem.setFirewallPorts(portMin, portMax); // 64000, 65000
            }

            return _srbFileSystem;

        } catch (Exception ex) {
View Full Code Here

   
    @Test
    public void listingTest() throws Exception {
        SRBAccount srbAccount = new SRBAccount("srb1.ngs.rl.ac.uk", 5544, this.cred);
        srbAccount.setDefaultStorageResource("ral-ngs1");
        SRBFileSystem client = new SRBFileSystem(srbAccount);

        client.setFirewallPorts(64000, 65000);
        String home = client.getHomeDirectory();
        System.out.println("home: " + home);

        SRBFile file = new SRBFile(client, "/ngs/home");
        GeneralFile[] kids = file.listFiles();
        if(kids != null){
View Full Code Here

   
    //@Test
    public void overwriteTest() throws Exception {
        SRBAccount srbAccount = new SRBAccount("srb1.ngs.rl.ac.uk", 5544, this.cred);
        srbAccount.setDefaultStorageResource("ral-ngs1");
        SRBFileSystem client = new SRBFileSystem(srbAccount);

        client.setFirewallPorts(64000, 65000);
        String home = client.getHomeDirectory();
        System.out.println("home: " + home);

        SRBFile file = new SRBFile(client, home + "/test.txt");

        //file.listFiles();
View Full Code Here

    private void getInfo() throws FileSystemException {
        // Load File info from the SRB server and:
        // set FileType (of this FileObject)
        log.debug("getInfo(): " + filePath);
        final SRBFileSystem client = this.fileSystem.getClient();
        try {
            this.file = new SRBFile(client, getName().getPath());

            // set this FileObjects FileType
            if (file.isDirectory()) {
View Full Code Here

        }

        log.debug("=====> listing srb server: " + getName().getPath());
        // can get FS through super class method as commented out below
        //SRBFileSystem client = (SRBFileSystem) ((SrbFileSystem) getFileSystem()).getClient();
        final SRBFileSystem client = this.fileSystem.getClient();

        try {
            // list the srb server
            GeneralFile[] kids = file.listFiles();
View Full Code Here

                    this.idleClient = this.createSrbFileSystem((GenericFileName) this.getRootName(), this.getFileSystemOptions());           
                }
            } catch (Exception ex) {
                throw new FileSystemException("vfs.provider.srb/connect.error", ex);
            }
            SRBFileSystem returnClient = this.idleClient;
            this.idleClient = null;
            return returnClient;
        }
    }
View Full Code Here

    private SRBFileSystem createSrbFileSystem(GenericFileName rootName,
        FileSystemOptions opts) throws FileSystemException {
        try {
            log.debug("before srbAccount creation ");
            SRBAccount srbAccount = SrbFileSystem.createSrbAccount(rootName, opts);
            SRBFileSystem _srbFileSystem = new SRBFileSystem(srbAccount);
            log.debug("after srbAccount creation");
            // update the firewall port range
            Integer portMin = SrbFileSystemConfigBuilder.getInstance().getFileWallPortMin(opts);
            Integer portMax = SrbFileSystemConfigBuilder.getInstance().getFileWallPortMax(opts);
            if (portMin != null && portMax != null) {
                _srbFileSystem.setFirewallPorts(portMin, portMax); // 64000, 65000
            }
               
            return _srbFileSystem;

        } catch (Exception ex) {
View Full Code Here

TOP

Related Classes of edu.sdsc.grid.io.srb.SRBFileSystem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.