Java 类com.amazonaws.services.identitymanagement.model.ServerCertificateMetadata 实例源码

项目:cmn-project    文件:ServerCertLoader.java   
public void load() {
    List<ServerCertificateMetadata> certs = AWS.iam.listServerCerts(ServerCert.certPath(env));

    String prefix = env.name + "-";
    for (ServerCertificateMetadata cert : certs) {
        String certName = cert.getServerCertificateName();
        if (!certName.startsWith(prefix)) continue; // ignore cert not matching naming convention

        String resourceId = certName.substring(prefix.length());
        ServerCert serverCert = resources.find(ServerCert.class, resourceId)
                                         .orElseGet(() -> resources.add(new ServerCert(resourceId)));
        serverCert.name = certName;
        serverCert.remoteCert = AWS.iam.getServerCert(cert.getServerCertificateName());
        serverCert.foundInRemote();
    }
}
项目:aws-doc-sdk-examples    文件:ListServerCertificates.java   
public static void main(String[] args) {

        final AmazonIdentityManagement iam =
            AmazonIdentityManagementClientBuilder.defaultClient();

        boolean done = false;
        ListServerCertificatesRequest request =
                new ListServerCertificatesRequest();

        while(!done) {

            ListServerCertificatesResult response =
                iam.listServerCertificates(request);

            for(ServerCertificateMetadata metadata :
                    response.getServerCertificateMetadataList()) {
                System.out.printf("Retrieved server certificate %s",
                        metadata.getServerCertificateName());
            }

            request.setMarker(response.getMarker());

            if(!response.getIsTruncated()) {
                done = true;
            }
        }
    }
项目:gravity    文件:AwsAutomationAction.java   
public boolean isSSLCertificateLoaded( String certificateName ){
    List<ServerCertificateMetadata> certificates = this.getCertificates();
    for( ServerCertificateMetadata certificate : certificates){
        if(certificate.getServerCertificateName().equals(certificateName)) {
            return true;
        }
    }
    return false;
}
项目:gravity    文件:AwsAutomationAction.java   
public String getCertificateId( String certificateName){
    List<ServerCertificateMetadata> certificates = this.getCertificates();
    for( ServerCertificateMetadata certificate : certificates){
        if(certificate.getServerCertificateName().equals(certificateName)) {
            return certificate.getServerCertificateId();
        }
    }
    return null;
}
项目:gravity    文件:AwsAutomationActionTest.java   
@Test
public void testGetSSLCertificates() throws IOException {   
    List<ServerCertificateMetadata> certs = automationAction.getCertificates();
    System.out.println("Certificates: " + certs.size() );
    for( ServerCertificateMetadata cert : certs) {
        System.out.println(cert.getServerCertificateId() + " -> " + cert.getServerCertificateName());
    }
}
项目:gravity    文件:AwsAutomationAction.java   
public  List<ServerCertificateMetadata> getCertificates(){
    ListServerCertificatesResult listSigningCertificates = identityClient.listServerCertificates();
    return listSigningCertificates.getServerCertificateMetadataList();
}
项目:cmn-project    文件:IAM.java   
public List<ServerCertificateMetadata> listServerCerts(String path) {
    logger.info("list server certs, path={}", path);
    ListServerCertificatesResult result = iam.listServerCertificates(new ListServerCertificatesRequest().withPathPrefix(path));
    return result.getServerCertificateMetadataList();
}