Class CertificateViewModel
- java.lang.Object
-
- de.xima.fc.certificate.gui.internal.administration.CertificateViewModel
-
- All Implemented Interfaces:
IKeystoreEntryViewModel,Serializable
public final class CertificateViewModel extends Object implements IKeystoreEntryViewModel
Locale specific view model for certificates.- Since:
- 8.5.0
- Author:
- XIMA Media GmbH
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface de.xima.fc.certificate.gui.internal.administration.IKeystoreEntryViewModel
UPDATE_OFFSET_IN_MINUTES
-
-
Constructor Summary
Constructors Constructor Description CertificateViewModel(int originalDtoHashCode, CertificateInfoDTO certificateInfoDto, Long id, de.xima.cmn.time.DateTimeRange validity, Instant createdAt, Instant updatedAt, X501DistinguishedName issuer, X501DistinguishedName subject, String serialNumber, String keyAlgorithm, Integer keySize, boolean hasCsr, Instant lastCsrExport, Instant lastCaResponseImport, List<KeystoreEntryUsageViewModel> usages, boolean hasPrivateKey, KeystoreViewModel keystore, List<KeyStoreEntryIssueDetailModel> issues, List<EKeystoreEntryTrait> traits, EViewStatus status, List<EViewKeystoreEntryUsageType> usageTypes, boolean canBeRenewedAutomatically)Creates a newCertificateViewModelinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)CertificateInfoDTOgetCertificateInfoDto()The underlying certificate info DTO.InstantgetCreatedAt()The date when the certificate was created.LonggetId()The (database) id of the certificate.X501DistinguishedNamegetIssuer()The issuer of the certificate in the form of a distinguished name (e.g.StringgetIssuerDisplayName()Returns the display name of the issuer of the certificate.List<KeyStoreEntryIssueDetailModel>getIssues()The issues with the certificate.StringgetKeyAlgorithm()The key algorithm of the certificate.IntegergetKeySize()The key size of the certificate.KeystoreViewModelgetKeystore()The keystore that contains the certificate.InstantgetLastCaResponseImport()The instant when the last CA (Certificate Authority) response was imported for this certificate.LocalDategetLastCaResponseImportLocalDate()LocalDateTimegetLastCaResponseImportLocalDateTime()InstantgetLastCsrExport()The instant when the CSR (Certificate Signing Request) was last exported.LocalDategetLastCsrExportLocalDate()LocalDateTimegetLastCsrExportLocalDateTime()intgetOriginalDtoHashCode()The original hash code of the certificate view model.StringgetSerialNumber()The serial number of the certificate.StringgetStateDescription(Locale locale)Returns the description of the state of the certificate.EViewStatusgetStatus()The status of the certificate, whether there are warnings or errors.X501DistinguishedNamegetSubject()The subject of the certificate in the form of a distinguished name (e.g.StringgetSubjectDisplayName()Returns the display name of the subject of the certificate.List<EKeystoreEntryTrait>getTraits()Traits to filter key store entries by in the administration view.EViewKeystoreEntryTypegetType()Gets the type of the keystore entry.StringgetTypeDisplayName(Locale locale)Returns the localized display name of the type of the keystore entry.InstantgetUpdatedAt()The date when the certificate was last updated.List<KeystoreEntryUsageViewModel>getUsages()A list of the usages of the certificate sorted by their localized display name.List<EViewKeystoreEntryUsageType>getUsageTypes()The intended usages of the certificate.LocalDategetValidFromLocalDate()Returns the valid from date as aLocalDate.LocalDateTimegetValidFromLocalDateTime()Returns the valid from date and time as aLocalDateTime.de.xima.cmn.time.DateTimeRangegetValidity()The date time range of the certificate's validity.LocalDategetValidUntilLocalDate()Returns the valid until date as aLocalDate.LocalDateTimegetValidUntilLocalDateTime()Returns the valid until date and time as aLocalDateTime.inthashCode()booleanisAutoRenew()Returns whether the certificate is set to auto-renew or not.booleanisCanBeRenewedAutomatically()Whether the certificate can be renewed automatically or not.booleanisDeletable()Returns whether this keystore entry is deletable or not.booleanisDownloadable()Returns whether this keystore entry is downloadable or not.booleanisHasChanged()booleanisHasCsr()Whether the certificate has a CSR (Certificate Signing Request) or not.booleanisHasPrivateKey()Whether the certificate has a private key in the database or not.voidsetAutoRenew(boolean autoRenew)Sets whether the certificate is set to auto-renew or not.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.xima.fc.certificate.gui.internal.administration.IKeystoreEntryViewModel
getCreatedAtLocalDate, getCreatedAtLocalDateTime, getUpdatedAtLocalDate, getUpdatedAtLocalDateTime, getValidFrom, getValidUntil, hasIssue, isNew, isRecentlyUpdated
-
-
-
-
Constructor Detail
-
CertificateViewModel
public CertificateViewModel(int originalDtoHashCode, CertificateInfoDTO certificateInfoDto, Long id, de.xima.cmn.time.DateTimeRange validity, Instant createdAt, Instant updatedAt, X501DistinguishedName issuer, X501DistinguishedName subject, String serialNumber, String keyAlgorithm, Integer keySize, boolean hasCsr, Instant lastCsrExport, Instant lastCaResponseImport, List<KeystoreEntryUsageViewModel> usages, boolean hasPrivateKey, KeystoreViewModel keystore, List<KeyStoreEntryIssueDetailModel> issues, List<EKeystoreEntryTrait> traits, EViewStatus status, List<EViewKeystoreEntryUsageType> usageTypes, boolean canBeRenewedAutomatically)Creates a newCertificateViewModelinstance.- Parameters:
originalDtoHashCode- The original hash code of the certificate view model. This is used to detect changes in the view model.certificateInfoDto- The underlying certificate info DTO.id- The (database) id of the certificate.validity- The date time range of the certificate's validity.createdAt- The date when the certificate was created.updatedAt- The date when the certificate was last updated.issuer- The issuer of the certificate in the form of a distinguished name (e.g. "CN=CA, OU=IT, O=XIMA").subject- The subject of the certificate in the form of a distinguished name (e.g. "CN=John Doe, OU=IT, O=XIMA").serialNumber- The serial number of the certificate.keyAlgorithm- The key algorithm of the certificate.keySize- The key size of the certificate.hasCsr- Whether the certificate has a CSR (Certificate Signing Request) or not. This is only applicable for certificates that are created by formcycle and signed by the formcycle CA.lastCsrExport- The instant when the CSR (Certificate Signing Request) was last exported. If this isnull, the CSR has never been exported and therefore no CSR process has been initiated for this certificate.lastCaResponseImport- The instant when the last CA (Certificate Authority) response was imported for this certificate. If this isnull, no CA response has been imported yet. If this isnullandlastCsrExportis notnull, it indicates that the CSR was exported, therefore a CSR process has been initiated, but no CA response has been received yet.usages- A list of the usages of the certificate sorted by their localized display name.hasPrivateKey- Whether the certificate has a private key in the database or not.keystore- The keystore that contains the certificate.issues- The issues with the certificate.traits- Traits to filter key store entries by in the administration view.status- The status of the certificate, whether there are warnings or errors.usageTypes- The intended usages of the certificate.canBeRenewedAutomatically- Whether the certificate can be renewed automatically or not.
-
-
Method Detail
-
getIssuerDisplayName
public String getIssuerDisplayName()
Returns the display name of the issuer of the certificate.- Specified by:
getIssuerDisplayNamein interfaceIKeystoreEntryViewModel- Returns:
- The display name of the issuer of the certificate.
-
getLastCaResponseImportLocalDate
public LocalDate getLastCaResponseImportLocalDate()
-
getLastCaResponseImportLocalDateTime
public LocalDateTime getLastCaResponseImportLocalDateTime()
-
getLastCsrExportLocalDate
public LocalDate getLastCsrExportLocalDate()
-
getLastCsrExportLocalDateTime
public LocalDateTime getLastCsrExportLocalDateTime()
-
getValidFromLocalDate
public LocalDate getValidFromLocalDate()
Description copied from interface:IKeystoreEntryViewModelReturns the valid from date as aLocalDate.- Specified by:
getValidFromLocalDatein interfaceIKeystoreEntryViewModel- Returns:
- The valid from date as a
LocalDate.
-
getValidFromLocalDateTime
public LocalDateTime getValidFromLocalDateTime()
Description copied from interface:IKeystoreEntryViewModelReturns the valid from date and time as aLocalDateTime.- Specified by:
getValidFromLocalDateTimein interfaceIKeystoreEntryViewModel- Returns:
- The valid from date and time as a
LocalDateTime.
-
getValidUntilLocalDate
public LocalDate getValidUntilLocalDate()
Description copied from interface:IKeystoreEntryViewModelReturns the valid until date as aLocalDate.- Specified by:
getValidUntilLocalDatein interfaceIKeystoreEntryViewModel- Returns:
- The valid until date as a
LocalDate.
-
getValidUntilLocalDateTime
public LocalDateTime getValidUntilLocalDateTime()
Description copied from interface:IKeystoreEntryViewModelReturns the valid until date and time as aLocalDateTime.- Specified by:
getValidUntilLocalDateTimein interfaceIKeystoreEntryViewModel- Returns:
- The valid until date and time as a
LocalDateTime.
-
isAutoRenew
public boolean isAutoRenew()
Returns whether the certificate is set to auto-renew or not.- Returns:
trueif the certificate is set to auto-renew,falseotherwise.
-
setAutoRenew
public void setAutoRenew(boolean autoRenew)
Sets whether the certificate is set to auto-renew or not.- Parameters:
autoRenew-trueto set the certificate to auto-renew,falseotherwise.
-
getStateDescription
public String getStateDescription(Locale locale)
Returns the description of the state of the certificate.- Specified by:
getStateDescriptionin interfaceIKeystoreEntryViewModel- Parameters:
locale- The locale to use for the description.- Returns:
- The description of the state of the certificate.
-
getSubjectDisplayName
public String getSubjectDisplayName()
Returns the display name of the subject of the certificate.- Specified by:
getSubjectDisplayNamein interfaceIKeystoreEntryViewModel- Returns:
- The display name of the subject of the certificate.
-
getType
public EViewKeystoreEntryType getType()
Description copied from interface:IKeystoreEntryViewModelGets the type of the keystore entry.- Specified by:
getTypein interfaceIKeystoreEntryViewModel- Returns:
- The type of the keystore entry.
-
getTypeDisplayName
public String getTypeDisplayName(Locale locale)
Description copied from interface:IKeystoreEntryViewModelReturns the localized display name of the type of the keystore entry.- Specified by:
getTypeDisplayNamein interfaceIKeystoreEntryViewModel- Parameters:
locale- The locale to use for the display name.- Returns:
- The localized display name of the type of the keystore entry.
-
isDeletable
public boolean isDeletable()
Description copied from interface:IKeystoreEntryViewModelReturns whether this keystore entry is deletable or not.- Specified by:
isDeletablein interfaceIKeystoreEntryViewModel- Returns:
- Whether this keystore entry is deletable or not.
-
isDownloadable
public boolean isDownloadable()
Description copied from interface:IKeystoreEntryViewModelReturns whether this keystore entry is downloadable or not.- Specified by:
isDownloadablein interfaceIKeystoreEntryViewModel- Returns:
- Whether this keystore entry is downloadable or not.
-
isHasChanged
public boolean isHasChanged()
-
getOriginalDtoHashCode
public int getOriginalDtoHashCode()
The original hash code of the certificate view model. This is used to detect changes in the view model.
-
getCertificateInfoDto
public CertificateInfoDTO getCertificateInfoDto()
The underlying certificate info DTO.
-
getId
public Long getId()
The (database) id of the certificate.
-
getValidity
public de.xima.cmn.time.DateTimeRange getValidity()
The date time range of the certificate's validity.- Specified by:
getValidityin interfaceIKeystoreEntryViewModel- Returns:
- The validity of the keystore entry.
-
getCreatedAt
public Instant getCreatedAt()
The date when the certificate was created.- Specified by:
getCreatedAtin interfaceIKeystoreEntryViewModel- Returns:
- The instant when this keystore entry was created.
-
getUpdatedAt
public Instant getUpdatedAt()
The date when the certificate was last updated.- Specified by:
getUpdatedAtin interfaceIKeystoreEntryViewModel- Returns:
- The instant when this keystore entry was last updated.
-
getIssuer
public X501DistinguishedName getIssuer()
The issuer of the certificate in the form of a distinguished name (e.g. "CN=CA, OU=IT, O=XIMA").
-
getSubject
public X501DistinguishedName getSubject()
The subject of the certificate in the form of a distinguished name (e.g. "CN=John Doe, OU=IT, O=XIMA").
-
getSerialNumber
public String getSerialNumber()
The serial number of the certificate.- Specified by:
getSerialNumberin interfaceIKeystoreEntryViewModel- Returns:
- The serial number of the keystore entry if the keystore entry is a certificate or
nullotherwise. - See Also:
for the type of the keystore entry.
-
getKeyAlgorithm
public String getKeyAlgorithm()
The key algorithm of the certificate.
-
getKeySize
public Integer getKeySize()
The key size of the certificate.
-
isHasCsr
public boolean isHasCsr()
Whether the certificate has a CSR (Certificate Signing Request) or not. This is only applicable for certificates that are created by formcycle and signed by the formcycle CA.
-
getLastCsrExport
public Instant getLastCsrExport()
The instant when the CSR (Certificate Signing Request) was last exported. If this isnull, the CSR has never been exported and therefore no CSR process has been initiated for this certificate.
-
getLastCaResponseImport
public Instant getLastCaResponseImport()
The instant when the last CA (Certificate Authority) response was imported for this certificate. If this isnull, no CA response has been imported yet. If this isnullandlastCsrExportis notnull, it indicates that the CSR was exported, therefore a CSR process has been initiated, but no CA response has been received yet.
-
getUsages
public List<KeystoreEntryUsageViewModel> getUsages()
A list of the usages of the certificate sorted by their localized display name.- Specified by:
getUsagesin interfaceIKeystoreEntryViewModel
-
isHasPrivateKey
public boolean isHasPrivateKey()
Whether the certificate has a private key in the database or not.
-
getKeystore
public KeystoreViewModel getKeystore()
The keystore that contains the certificate.- Specified by:
getKeystorein interfaceIKeystoreEntryViewModel- Returns:
- The keystore that contains this keystore entry.
-
getIssues
public List<KeyStoreEntryIssueDetailModel> getIssues()
The issues with the certificate.- Specified by:
getIssuesin interfaceIKeystoreEntryViewModel- Returns:
- The issues with the keystore entry.
-
getTraits
public List<EKeystoreEntryTrait> getTraits()
Traits to filter key store entries by in the administration view.- Specified by:
getTraitsin interfaceIKeystoreEntryViewModel- Returns:
- The traits of the keystore entry.
-
getStatus
public EViewStatus getStatus()
The status of the certificate, whether there are warnings or errors.- Specified by:
getStatusin interfaceIKeystoreEntryViewModel- Returns:
- The status of this keystore entry.
-
getUsageTypes
public List<EViewKeystoreEntryUsageType> getUsageTypes()
The intended usages of the certificate.
-
isCanBeRenewedAutomatically
public boolean isCanBeRenewedAutomatically()
Whether the certificate can be renewed automatically or not.
-
-