Package org.apache.airavata.credential.store

Examples of org.apache.airavata.credential.store.CommunityUser


            ResultSet resultSet = preparedStatement.executeQuery();

            if (resultSet.next()) {
                String email = resultSet.getString("COMMUNITY_USER_EMAIL")//TODO fix typo

                return new CommunityUser(gatewayName, communityUserName, email);

            }

        } catch (SQLException e) {
            StringBuilder stringBuilder = new StringBuilder("Error retrieving community user.");
View Full Code Here


            while (resultSet.next()) {
                String userName = resultSet.getString("COMMUNITY_USER_NAME");
                String email = resultSet.getString("COMMUNITY_USER_EMAIL")//TODO fix typo

                userList.add(new CommunityUser(gatewayName, userName, email));

            }

        } catch (SQLException e) {
            StringBuilder stringBuilder = new StringBuilder("Error retrieving community users for ");
View Full Code Here

        certificateCredential.setNotBefore(Utility.convertDateToString(cert.getNotBefore()));
        certificateCredential.setNotAfter(Utility.convertDateToString(cert.getNotAfter()));
        certificateCredential.setCertificate(cert);
        certificateCredential.setPrivateKey(oa4MPResponse.getPrivateKey());
        certificateCredential.setCommunityUser(new CommunityUser(gatewayName, assetResponse.getUsername(),
                contactEmail));
        certificateCredential.setPortalUserName(portalUserName);
        certificateCredential.setLifeTime(duration);

        certificateCredentialWriter.writeCredentials(certificateCredential);
View Full Code Here

                certificateCredential.setCertificate((X509Certificate) convertByteArrayToObject(certificate));
                certificateCredential.setPrivateKey((PrivateKey) convertByteArrayToObject(pk));

                certificateCredential.setLifeTime(resultSet.getLong("LIFETIME"));
                certificateCredential.setCommunityUser(new CommunityUser(gatewayName, communityUserName, null));
                certificateCredential.setPortalUserName(resultSet.getString("REQUESTING_PORTAL_USER_NAME"));
                certificateCredential.setCertificateRequestedTime(resultSet.getTimestamp("REQUESTED_TIME"));

                return certificateCredential;
            }
View Full Code Here

            CertificateCredential certificateCredential;

            while (resultSet.next()) {
                certificateCredential = new CertificateCredential();

                certificateCredential.setCommunityUser(new CommunityUser(gatewayName,
                        resultSet.getString("COMMUNITY_USER_NAME"), null));

                Blob blobCredentials = resultSet.getBlob("CREDENTIAL");
                byte[] certificate = blobCredentials.getBytes(1, (int) blobCredentials.length());
View Full Code Here

        Assert.assertNotNull(privateKey);
        Assert.assertNotNull(x509Certificate);
    }

    private CommunityUser getCommunityUser(String gateway, String name) {
        return new CommunityUser(gateway, name, "amila@sciencegateway.org");
    }
View Full Code Here

    }

    @Test
    public void testAddCommunityUser() throws Exception {

        CommunityUser communityUser = new CommunityUser("gw1", "ogce","ogce@sciencegateway.org");
        communityUserDAO.addCommunityUser(communityUser);

        communityUser = new CommunityUser("gw1", "ogce2","ogce@sciencegateway.org");
        communityUserDAO.addCommunityUser(communityUser);

        CommunityUser user = communityUserDAO.getCommunityUser("gw1", "ogce");
        Assert.assertNotNull(user);
        Assert.assertEquals("ogce@sciencegateway.org", user.getUserEmail());

        user = communityUserDAO.getCommunityUser("gw1", "ogce2");
        Assert.assertNotNull(user);
        Assert.assertEquals("ogce@sciencegateway.org", user.getUserEmail());
    }
View Full Code Here

    }

    @Test
    public void testDeleteCommunityUser() throws Exception {

        CommunityUser communityUser = new CommunityUser("gw1", "ogce","ogce@sciencegateway.org");
        communityUserDAO.addCommunityUser(communityUser);

        CommunityUser user = communityUserDAO.getCommunityUser("gw1", "ogce");
        Assert.assertNotNull(user);

        communityUser = new CommunityUser("gw1", "ogce","ogce@sciencegateway.org");
        communityUserDAO.deleteCommunityUser(communityUser);

        user = communityUserDAO.getCommunityUser("gw1", "ogce");
        Assert.assertNull(user);
View Full Code Here

    }

    @Test
    public void testGetCommunityUsers() throws Exception {

        CommunityUser communityUser = new CommunityUser("gw1", "ogce","ogce@sciencegateway.org");
        communityUserDAO.addCommunityUser(communityUser);

        CommunityUser user = communityUserDAO.getCommunityUser("gw1", "ogce");
        Assert.assertNotNull(user);
        Assert.assertEquals("ogce@sciencegateway.org", user.getUserEmail());

    }
View Full Code Here

    }

    @Test
    public void testGetCommunityUsersForGateway() throws Exception {

        CommunityUser communityUser = new CommunityUser("gw1", "ogce","ogce@sciencegateway.org");
        communityUserDAO.addCommunityUser(communityUser);

        communityUser = new CommunityUser("gw1", "ogce2","ogce@sciencegateway.org");
        communityUserDAO.addCommunityUser(communityUser);

        List<CommunityUser> users = communityUserDAO.getCommunityUsers("gw1");
        Assert.assertNotNull(users);
        Assert.assertEquals(2, users.size());
View Full Code Here

TOP

Related Classes of org.apache.airavata.credential.store.CommunityUser

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.