Package edu.sdsc.grid.io.irods

Examples of edu.sdsc.grid.io.irods.IRODSFileSystem


    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)
        IRODSVfsFileSystem fs = (IRODSVfsFileSystem) this.relativeToFO.getFileSystem();
        IRODSFileSystem 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


    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)
        IRODSVfsFileSystem fs = (IRODSVfsFileSystem) this.relativeToFO.getFileSystem();
        IRODSFileSystem 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.createIRODSFileSystem(rootName, opts);
                irodsAccount = (IRODSAccount)(fileSystem.getAccount());
            }
            else
            {
                fileSystem = new IRODSFileSystem(irodsAccount);
            }

            attribs.put(ACCOUNT, fileSystem.getAccount());
            attribs.put(FILESYSTEM, fileSystem);
            attribs.put(HOME_DIRECTORY, irodsAccount.getHomeDirectory());
View Full Code Here

                }
            } catch (Exception ex) {
                throw new FileSystemException("vfs.provider.srb/connect.error", ex);
            }
            IRODSFileSystem returnClient = this.getIRODSFileSystem();
            //this.srbFileSystem = null;
            return returnClient;
        }
    }
View Full Code Here

    private IRODSFileSystem createIRODSFileSystem(final GenericFileName rootName, final FileSystemOptions optsthrows FileSystemException
    {
        try {
            IRODSAccount irodsAccount = (IRODSAccount)(createAccount(rootName, opts, IRODSFileSystemConfigBuilder.getInstance()));
            IRODSFileSystem irodsFileSystem = new IRODSFileSystem(irodsAccount);
            return irodsFileSystem;

        } catch (Exception ex) {
            throw new FileSystemException("vfs.provider.irods/connect.error", rootName, ex);
        }
View Full Code Here

    protected void doCloseCommunicationLink()
    {
        try
        {
            IRODSFileSystem tmpFS = getIRODSFileSystem();
            if(tmpFS.isConnected())
                tmpFS.close();
        }
        catch(IOException e)
        {
            log.error("Error closing iRODS connection", e);
        }
View Full Code Here

       
        try
        {
            IRODSFileSystemConfigBuilder configurations = IRODSFileSystemConfigBuilder.getInstance();
            IRODSAccount account = configurations.getAccount(opts);
            irodsFileSystem = new IRODSFileSystem(account);
            attribs.put(ACCOUNT, account);
            attribs.put(FILESYSTEM, irodsFileSystem);
        }
        catch (Exception e)
        {
View Full Code Here

        //irodsBuilder.setAccount(irodsAccount, irodsOpts);
        //IRODSVfsFileSystem vfsFileSystem = (IRODSVfsFileSystem) VFS.getManager().resolveFile(getURIString(irodsAccount), irodsOpts).getFileSystem();
        //IRODSFileSystem irodsFs = (IRODSFileSystem) vfsFileSystem.getAttribute(IRODSVfsFileSystem.FILESYSTEM);
        try
        {
            IRODSFileSystem irodsFS = new IRODSFileSystem(irodsAccount);
            System.out.println("after constructor - about to query with GSI");

            MetaDataRecordList[] recordList = null;

            try
            {
                recordList = irodsFS
                .query(
                        new MetaDataCondition[] {
                                MetaDataSet
                                .newCondition(
                                        IRODSMetaDataSet.USER_DN,
                                        MetaDataCondition.EQUAL,
                                        "/C=AU/O=APACGrid/OU=TPAC/CN=Pauline Mak")
                        },
                        new MetaDataSelect[] { MetaDataSet
                                .newSelection(IRODSMetaDataSet.USER_NAME) });
            }
            catch (IOException e)
            {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            if(recordList == null)
            {
                System.out.println("getiRODSUsernameByDN: no result");
            }
            else
            {
                System.out.println("getiRODSUsernameByDN: " + recordList.length);
            }

            if(recordList != null&&recordList.length>0)
            {
                System.out.println("result: " + (String)recordList[0].getValue(IRODSMetaDataSet.USER_NAME));
            }

            System.out.println("account 1 info: " + irodsAccount.getUserName());

            IRODSAccount irodsAccount2 = new IRODSAccount("srbdev.vpac.org", 1247,
                                                    "paulinemak1", "", "/srbdev.vpac.org/home/paulinemak1",
                                                    "srbdev.vpac.org", "datafabric.srbdev.vpac.org");

            irodsAccount2.setGSSCredential(cert);

            System.out.println("acount 2");
           
            FileSystemOptions irodsOpts = new FileSystemOptions();
            IRODSFileSystemConfigBuilder irodsBuilder = IRODSFileSystemConfigBuilder.getInstance();
            irodsBuilder.setAccount(irodsAccount2, irodsOpts);
           
            System.out.println("Account 2 URI: " + getURIString(irodsAccount2) + " " + irodsAccount2.getUserName());


            IRODSFileSystem irodsFS2 = (IRODSFileSystem)(VFS.getManager().
                    resolveFile(getURIString(irodsAccount2), irodsOpts)
                    .getFileSystem().getAttribute(IRODSVfsFileSystem.FILESYSTEM));

            System.out.println("resolved FS " + irodsFS2);
View Full Code Here

TOP

Related Classes of edu.sdsc.grid.io.irods.IRODSFileSystem

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.