Package net.solarnetwork.central.domain
Class BaseUserCertificate<C extends BaseUserCertificate<C>>
java.lang.Object
net.solarnetwork.dao.BasicIdentity<UserStringCompositePK>
net.solarnetwork.dao.BasicEntity<UserStringCompositePK>
net.solarnetwork.central.dao.BaseUserModifiableEntity<C,UserStringCompositePK>
net.solarnetwork.central.domain.BaseUserCertificate<C>
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<UserStringCompositePK>,UserRelatedEntity<UserStringCompositePK>,UserIdRelated,net.solarnetwork.dao.Entity<UserStringCompositePK>,net.solarnetwork.domain.CopyingIdentity<UserStringCompositePK,,C> net.solarnetwork.domain.Differentiable<C>,net.solarnetwork.domain.Identity<UserStringCompositePK>
public abstract class BaseUserCertificate<C extends BaseUserCertificate<C>>
extends BaseUserModifiableEntity<C,UserStringCompositePK>
Base user-related certificate entity.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBaseUserCertificate(Long userId, String subjectDn, Instant created) Constructor.BaseUserCertificate(Long userId, X509Certificate certificate, Instant created) Constructor.BaseUserCertificate(UserStringCompositePK id, Instant created) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Get the DER-encoded certificate data.voidGet the certificate.Get the certificate expiration date.Get the certificate subject DN.booleanTest if this entity has the same property values as another.voidsetCertificate(X509Certificate certificate) Set the certificate.Methods inherited from class net.solarnetwork.central.dao.BaseUserModifiableEntity
clone, differsFrom, getModified, getUserId, ident, isEnabled, setEnabled, setModifiedMethods inherited from class net.solarnetwork.dao.BasicEntity
getCreatedMethods inherited from class net.solarnetwork.dao.BasicIdentity
compareTo, equals, getId, hashCodeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface net.solarnetwork.domain.CopyingIdentity
copyWithIdMethods inherited from interface net.solarnetwork.dao.Entity
getCreatedMethods inherited from interface net.solarnetwork.domain.Identity
getId, hasId
-
Constructor Details
-
BaseUserCertificate
Constructor.- Parameters:
id- the IDcreated- the creation date- Throws:
IllegalArgumentException- if any argument is null
-
BaseUserCertificate
Constructor.- Parameters:
subjectDn- the normalized certificate subject DNcreated- the creation dateuser- ID the user ID- Throws:
IllegalArgumentException- if any argument is null
-
BaseUserCertificate
Constructor.The
subjectDnvalue will be extracted from the certificate.- Parameters:
certificate- the certificatecreated- the creation dateuser- ID the user ID- Throws:
IllegalArgumentException- if any argument is null
-
-
Method Details
-
copyTo
- Specified by:
copyToin interfacenet.solarnetwork.domain.CopyingIdentity<UserStringCompositePK,C extends BaseUserCertificate<C>> - Overrides:
copyToin classBaseUserModifiableEntity<C extends BaseUserCertificate<C>,UserStringCompositePK>
-
isSameAs
Test if this entity has the same property values as another.The
id,created, andmodifiedproperties are not compared.- Overrides:
isSameAsin classBaseUserModifiableEntity<C extends BaseUserCertificate<C>,UserStringCompositePK> - Parameters:
other- the entity to compare to- Returns:
- true if the properties of this entity are equal to the other's
-
getSubjectDn
Get the certificate subject DN.- Returns:
- the subject DN
-
getCertificate
Get the certificate.- Returns:
- the certificate
-
setCertificate
Set the certificate.- Parameters:
certificate- the certificate to set
-
getExpires
Get the certificate expiration date.- Returns:
- the expiration date, or null if the certificate is not set
-
certificateData
public byte[] certificateData()Get the DER-encoded certificate data.- Returns:
- the certificate data
-