Examples of SRBAccount


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

    {
        super(rootName, fileSystemOptions);

        try {
            SRBFileSystemConfigBuilder configurations = SRBFileSystemConfigBuilder.getInstance();
            SRBAccount srbAccount = configurations.getAccount(fileSystemOptions);
            srbFileSystem = new SRBFileSystemExt(srbAccount);
            attribs.put(ACCOUNT, srbFileSystem.getAccount());
            attribs.put(FILESYSTEM, srbFileSystem);
        } catch (Throwable e) {
            throw new FileSystemException(e);
View Full Code Here

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

    {
        try
        {
            GlobusCredential gCert = GlobusCredential.getDefaultCredential();
            GSSCredential cert = new GlobusGSSCredentialImpl(gCert, GSSCredential.INITIATE_AND_ACCEPT);
            acc = new SRBAccount(SRBHOST, 5544, cert);
            acc.setDefaultStorageResource(DEFAULT_RESOURCE);

            System.out.println(cert.getName());

            //acc =  new SRBAccount(SRBHOST, 5544, SRB_USERNAME, SRB_PASSWORD, SRB_HOME, SRB_DOMAIN, DEFAULT_RESOURCE);
View Full Code Here

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

        try {
            SRBFileSystemConfigBuilder configurations = SRBFileSystemConfigBuilder.getInstance();
            //SRBAccount would have been created at this point in time.  It's stored in
            //the FileSystemOptions key ACCOUNT.
            SRBAccount srbAccount = configurations.getAccount(fileSystemOptions);

            if(srbAccount == null)
            {
                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());
            attribs.put(DEFAULT_RESOURCE, srbAccount.getDefaultStorageResource());
            attribs.put(MDAS_ZONE, srbAccount.getMcatZone());
            attribs.put(MDAS_DOMAIN, srbAccount.getDomainName());
        } catch (Throwable e) {
            throw new FileSystemException(e);
    }
    }
View Full Code Here

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

     */
    private SRBFileSystem createSrbFileSystem(GenericFileName rootName,
        FileSystemOptions opts) throws FileSystemException {
        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
View Full Code Here

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

    {
        String mdasDomainName = SRBFileSystemConfigBuilder.getInstance().getMdasDomainName(opts);

        log.debug("Create SRBAccount using ENCRYPT1");

        SRBAccount srb = null;

        if (homeDir != null && mdasDomainName != null &&
            defaultStorageResource != null && zone != null) {
            //
            srb = new SRBAccount(host, port, new String(username), new String(password),
                homeDir, mdasDomainName, defaultStorageResource, zone);

        } else if (homeDir != null && mdasDomainName != null &&
            defaultStorageResource != null) {
            //
            srb = new SRBAccount(host, port, new String(username), new String(password),
                homeDir, mdasDomainName, defaultStorageResource);
        }
       
        return srb;
    }
View Full Code Here

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

     */
    protected RemoteAccount createGsiAccount(String host, int port, String zone,
                                                      GSSCredential credential, String homeDir,
                                                      String defaultStorageResource)
    {
        SRBAccount srb = null;

        if (homeDir != null && defaultStorageResource != null) {
                log.debug("Create SRBAccount using GSI with homeDir and storageResource");
                srb = new SRBAccount(host, port, credential, homeDir,
                    defaultStorageResource, SRBAccount.GSI_AUTH);
            } else if(defaultStorageResource != null){
                // uses special constructor that sets GSI_AUTH and
                // implements a login procedure using the 'ticketuser' in
                // order to get the users home directory
                srb = new SRBAccount(host, port, credential);
                }

        if (defaultStorageResource != null) {
                srb.setDefaultStorageResource(defaultStorageResource);
            }
       
        return srb;
    }
View Full Code Here

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

     * @throws java.io.FileNotFoundException - thrown when the local info file cannot be found
     * @throws java.io.IOException - thrown when local info file cannot be read.
     */
    protected RemoteAccount createAccountFromConfig(String userInfoDir, String defaultStorage) throws java.io.FileNotFoundException, java.io.IOException
    {
        SRBAccount srb = null;
        log.debug("Create SRBAccount using local MDAS files");
        // Load some stuff from ~/.srb/.MdasEnv and .MdasAuth files
        // (use default location unless otherwise specified).
        if (userInfoDir == null) {
            srb = new SRBAccount();
        } else {
            srb = new SRBAccount(userInfoDir);
        }

        // Always try to specify the default storage resource - this is required so that
        // uploads are targeted to the correct default storage resource, otherwise, any
        // srb storage resource may be used and that can cause firewall block
        // (remeber, that the srb uses multiple storage resources).
        //srb.setDefaultStorageResource("ral-ngs1");
        if (defaultStorage != null) {
            srb.setDefaultStorageResource(defaultStorage);
        }

        return srb;
    }
View Full Code Here

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

    }

   
    @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);
View Full Code Here

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

        //assertTrue(file.exists());
    }
   
    //@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);
View Full Code Here

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

    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);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.