Examples of CommunityUser


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

        certificateCredential.setNotBefore(Utility.convertDateToString(certificates[0].getNotBefore())); //TODO check this is correct
        certificateCredential.setNotAfter(Utility.convertDateToString(certificates[0].getNotAfter()));
        certificateCredential.setCertificates(certificates);
        certificateCredential.setPrivateKey(privateKey);
        certificateCredential
                .setCommunityUser(new CommunityUser(gatewayName, assetResponse.getUsername(), contactEmail));
        certificateCredential.setPortalUserName(portalUserName);
        certificateCredential.setLifeTime(duration);
        certificateCredential.setToken(portalTokenId);

View Full Code Here

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

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

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

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

        addTestCredentials();

        Connection connection = getConnection();

        try {
            CommunityUser communityUser = getCommunityUser("gw1", "tom");
            CertificateCredential certificateCredential = new CertificateCredential();
            certificateCredential.setToken("tom");
            certificateCredential.setCommunityUser(communityUser);
            certificateCredential.setCertificates(x509Certificates);
            // certificateCredential.setPrivateKey(privateKey);
            certificateCredential.setPortalUserName("test2");
            certificateCredential.setLifeTime(50);
            certificateCredential.setNotBefore("15 OCT 2012 5:34:23");
            certificateCredential.setNotAfter("16 OCT 2012 5:34:23");

            credentialsDAO.updateCredentials(communityUser.getGatewayName(), certificateCredential, connection);

            certificateCredential = (CertificateCredential) credentialsDAO.getCredential("gw1", "tom", connection);

            Assert.assertEquals("CN=Airavata Project, OU=IU, O=Indiana University, L=Bloomington, ST=IN, C=US",
                    certificateCredential.getCertificates()[0].getIssuerDN().toString());
View Full Code Here

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

        Connection connection = getConnection();

        try {

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

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

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

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

            user = communityUserDAO.getCommunityUserByToken("gw1", "Token1", connection);
            Assert.assertNotNull(user);
            Assert.assertEquals("ogce", user.getUserName());
            Assert.assertEquals("ogce@sciencegateway.org", user.getUserEmail());

            user = communityUserDAO.getCommunityUserByToken("gw1", "Token2", connection);
            Assert.assertNotNull(user);
            Assert.assertEquals("ogce2", user.getUserName());
            Assert.assertEquals("ogce@sciencegateway.org", user.getUserEmail());

        } finally {
            connection.close();
        }
View Full Code Here

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

    public void testDeleteCommunityUser() throws Exception {

        Connection connection = getConnection();

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

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

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

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

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

    public void testDeleteCommunityUserByToken() throws Exception {

        Connection connection = getConnection();

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

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

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

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

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

    public void testGetCommunityUsers() throws Exception {

        Connection connection = getConnection();

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

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

        } finally {
            connection.close();
        }
View Full Code Here

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

    @Test
    public void testGetCommunityUsersForGateway() throws Exception {

        Connection connection = getConnection();

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

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

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

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

    public void setCredentialLifeTime(long credentialLifeTime) {
        this.credentialLifeTime = credentialLifeTime;
    }

    public CommunityUser getCommunityUser() {
        return new CommunityUser(gatewayName, communityUserName);
    }
View Full Code Here

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

            CertificateCredential certificateCredential = (CertificateCredential) this.credentialsDAO.getCredential(
                    gatewayName, tokenId, connection);

            certificateAuditInfo = new CertificateAuditInfo();

            CommunityUser retrievedUser = certificateCredential.getCommunityUser();
            certificateAuditInfo.setCommunityUserName(retrievedUser.getUserName());
            certificateAuditInfo.setCredentialLifeTime(certificateCredential.getLifeTime());
            certificateAuditInfo.setCredentialsRequestedTime(certificateCredential.getCertificateRequestedTime());
            certificateAuditInfo.setGatewayName(gatewayName);
            certificateAuditInfo.setNotAfter(certificateCredential.getNotAfter());
            certificateAuditInfo.setNotBefore(certificateCredential.getNotBefore());
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.