Package org.apache.airavata.credential.store.credential

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


        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

        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);
        certificateCredential.setToken(portalTokenId);

        certificateCredentialWriter.writeCredentials(certificateCredential);
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

        addTestCredentials();

        Connection connection = getConnection();

        try {
            CommunityUser communityUser = getCommunityUser("gw1", "tom");
            CertificateCredential certificateCredential = new CertificateCredential();
            certificateCredential.setToken("tom");
            certificateCredential.setCommunityUser(communityUser);
            certificateCredential.setCertificate(x509Certificate);
            // 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.getCertificate().getIssuerDN().toString());
View Full Code Here

        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

            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

            if (resultSet.next()) {
                String communityUserName = resultSet.getString("COMMUNITY_USER_NAME");
                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

                    date.setDate(date.getDate() + 1);    // gap is 1 days

                    Date currentDate = new Date();
                    if (currentDate.after(date)) {
                        // Send an email
                        CommunityUser communityUser = certificateCredential.getCommunityUser();
                        String body =
                                String.format(MESSAGE, communityUser.getUserName(), certificateCredential.getNotAfter());
                        String subject = String.format(SUBJECT, communityUser.getUserName());
                        NotificationMessage notificationMessage
                                = new EmailNotificationMessage(subject, communityUser.getUserEmail(), body);

                        this.credentialStoreNotifier.notifyMessage(notificationMessage);

                    }
                }
View Full Code Here

TOP

Related Classes of org.apache.airavata.credential.store.credential.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.