Search in sources :

Example 1 with UpdateTransitionalVersionRequest

use of org.cloudfoundry.credhub.request.UpdateTransitionalVersionRequest in project credhub by cloudfoundry-incubator.

the class CertificatesHandler method handleUpdateTransitionalVersion.

public List<CertificateView> handleUpdateTransitionalVersion(String certificateId, UpdateTransitionalVersionRequest requestBody, List<EventAuditRecordParameters> auditRecordParameters) {
    List<CredentialVersion> credentialList;
    UUID versionUUID = null;
    if (requestBody.getVersionUuid() != null) {
        versionUUID = UUID.fromString(requestBody.getVersionUuid());
    }
    credentialList = permissionedCertificateService.updateTransitionalVersion(UUID.fromString(certificateId), versionUUID, auditRecordParameters);
    List<CertificateView> list = credentialList.stream().map(credential -> new CertificateView((CertificateCredentialVersion) credential)).collect(Collectors.toList());
    return list;
}
Also used : CredentialView(org.cloudfoundry.credhub.view.CredentialView) PermissionedCertificateService(org.cloudfoundry.credhub.service.PermissionedCertificateService) BaseCredentialGenerateRequest(org.cloudfoundry.credhub.request.BaseCredentialGenerateRequest) CertificateCredentialsView(org.cloudfoundry.credhub.view.CertificateCredentialsView) CertificateCredentialVersion(org.cloudfoundry.credhub.domain.CertificateCredentialVersion) CreateVersionRequest(org.cloudfoundry.credhub.request.CreateVersionRequest) UUID(java.util.UUID) CertificateView(org.cloudfoundry.credhub.view.CertificateView) CredentialVersion(org.cloudfoundry.credhub.domain.CredentialVersion) Collectors(java.util.stream.Collectors) CertificateCredentialView(org.cloudfoundry.credhub.view.CertificateCredentialView) CertificateRegenerateRequest(org.cloudfoundry.credhub.request.CertificateRegenerateRequest) UpdateTransitionalVersionRequest(org.cloudfoundry.credhub.request.UpdateTransitionalVersionRequest) List(java.util.List) Credential(org.cloudfoundry.credhub.entity.Credential) EventAuditRecordParameters(org.cloudfoundry.credhub.audit.EventAuditRecordParameters) AuditingOperationCode(org.cloudfoundry.credhub.audit.AuditingOperationCode) Service(org.springframework.stereotype.Service) CertificateCredentialValue(org.cloudfoundry.credhub.credential.CertificateCredentialValue) EntryNotFoundException(org.cloudfoundry.credhub.exceptions.EntryNotFoundException) CertificateService(org.cloudfoundry.credhub.service.CertificateService) UUID(java.util.UUID) CertificateCredentialVersion(org.cloudfoundry.credhub.domain.CertificateCredentialVersion) CredentialVersion(org.cloudfoundry.credhub.domain.CredentialVersion) CertificateView(org.cloudfoundry.credhub.view.CertificateView)

Aggregations

List (java.util.List)1 UUID (java.util.UUID)1 Collectors (java.util.stream.Collectors)1 AuditingOperationCode (org.cloudfoundry.credhub.audit.AuditingOperationCode)1 EventAuditRecordParameters (org.cloudfoundry.credhub.audit.EventAuditRecordParameters)1 CertificateCredentialValue (org.cloudfoundry.credhub.credential.CertificateCredentialValue)1 CertificateCredentialVersion (org.cloudfoundry.credhub.domain.CertificateCredentialVersion)1 CredentialVersion (org.cloudfoundry.credhub.domain.CredentialVersion)1 Credential (org.cloudfoundry.credhub.entity.Credential)1 EntryNotFoundException (org.cloudfoundry.credhub.exceptions.EntryNotFoundException)1 BaseCredentialGenerateRequest (org.cloudfoundry.credhub.request.BaseCredentialGenerateRequest)1 CertificateRegenerateRequest (org.cloudfoundry.credhub.request.CertificateRegenerateRequest)1 CreateVersionRequest (org.cloudfoundry.credhub.request.CreateVersionRequest)1 UpdateTransitionalVersionRequest (org.cloudfoundry.credhub.request.UpdateTransitionalVersionRequest)1 CertificateService (org.cloudfoundry.credhub.service.CertificateService)1 PermissionedCertificateService (org.cloudfoundry.credhub.service.PermissionedCertificateService)1 CertificateCredentialView (org.cloudfoundry.credhub.view.CertificateCredentialView)1 CertificateCredentialsView (org.cloudfoundry.credhub.view.CertificateCredentialsView)1 CertificateView (org.cloudfoundry.credhub.view.CertificateView)1 CredentialView (org.cloudfoundry.credhub.view.CredentialView)1