Package org.apache.cloudstack.api.response

Examples of org.apache.cloudstack.api.response.SslCertResponse


    @Override
    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
        ResourceAllocationException, NetworkRuleConflictException {

        try {
            SslCertResponse response = _certService.uploadSslCert(this);
            setResponseObject(response);
            response.setResponseName(getCommandName());
        } catch (Exception e) {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
        }

    }
View Full Code Here


        if (chainInput != null)
            validateChain(chain, cert);
    }

    public SslCertResponse createCertResponse(SslCertVO cert, List<LoadBalancerCertMapVO> lbCertMap) {
        SslCertResponse response = new SslCertResponse();

        Account account = _accountDao.findByIdIncludingRemoved(cert.getAccountId());

        response.setObjectName("sslcert");
        response.setId(cert.getUuid());
        response.setCertificate(cert.getCertificate());
        response.setPrivatekey(cert.getKey());
        response.setFingerprint(cert.getFingerPrint());
        response.setAccountName(account.getAccountName());

        if (cert.getChain() != null)
            response.setCertchain(cert.getChain());

        if (lbCertMap != null && !lbCertMap.isEmpty()) {
            List<String> lbIds = new ArrayList<String>();
            for (LoadBalancerCertMapVO mapVO : lbCertMap) {
                LoadBalancer lb = _entityMgr.findById(LoadBalancerVO.class, mapVO.getLbId());
                lbIds.add(lb.getUuid());
            }
            response.setLbIds(lbIds);
        }

        return response;
    }
View Full Code Here

    @Override
    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {

        try{
            SslCertResponse response = _certService.uploadSslCert(this);
            setResponseObject(response);
            response.setResponseName(getCommandName());
        } catch (Exception e){
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
        }

    }
View Full Code Here

        if ( _chain != null )
            validateChain(chain, cert);
    }

    public SslCertResponse createCertResponse(SslCertVO cert, List<LoadBalancerCertMapVO> lbCertMap) {
        SslCertResponse response = new SslCertResponse();

        Account account = _accountDao.findByIdIncludingRemoved(cert.getAccountId());

        response.setObjectName("sslcert");
        response.setId(cert.getUuid());
        response.setCertificate(cert.getCertificate());
        response.setPrivatekey(cert.getKey());
        response.setFingerprint(cert.getFingerPrint());
        response.setAccountName(account.getAccountName());

        if ( cert.getChain() != null)
            response.setCertchain(cert.getChain());

        if ( lbCertMap != null && !lbCertMap.isEmpty()){
            List<String> lbIds = new ArrayList<String>();
            for ( LoadBalancerCertMapVO mapVO : lbCertMap ) {
                LoadBalancer lb = _entityMgr.findById(LoadBalancerVO.class, mapVO.getLbId());
                lbIds.add(lb.getUuid());
            }
            response.setLbIds(lbIds);
        }

        return response;
    }
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.api.response.SslCertResponse

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.