Class LicenseContent
- All Implemented Interfaces:
Serializable,Cloneable
This class is not trusted by the license notary. As a result, the license manager validates and verifies the state of this object itself whenever necessary.
In general, all properties may be null which indicates that this
information is not (yet) available and should be ignored.
Note however that validation may fail if certain properties are not
available.
Subclasses are encouraged to use the firePropertyChange methods
to notify all listeners of all property events.
Subclasses must also implement the JavaBean pattern in order to
be usable.
Note that the property change listeners are not persistet when
using ObjectOutputStream or XMLEncoder.
- Author:
- Christian Schlichtherle, Christian Schlichtherle
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAdds a PropertyChangeListener to the listener list.protected Objectclone()Deprecated.There's no need for this method.booleanReturnstrueif and only ifobjectis an instance ofLicenseContentand their properties are considered equal.protected final voidprotected final voidfirePropertyChange(String propertyName, Object oldValue, Object newValue) intReturns the amount of consumers which are allowed to license the subject with this license.Returns the type of entity which needs to license the license subject in order to use it.getExtra()Returns the value of the property extra.Returns the legal entity (i.e. the user) to which the license is granted by the issuer.getInfo()Returns the value of the propertyinfo.Returns the time when the license represented by this license content has been issued.Returns the legal entity which grants the license to the holder.Returns the time when the license ends to be valid.Returns the time when the license begins to be valid.Returns the abstract description of the entity which needs to be licensed in order for it to be used - it could be the name of a software application like e.g.inthashCode()final voidRemoves a PropertyChangeListener from the listener list.voidsetConsumerAmount(int consumerAmount) Sets the amount of consumers which are allowed to license the subject with this license.voidsetConsumerType(String consumerType) Sets the type of entity which needs to license the license subject in order to use it.voidSets the value of the property extra.voidsetHolder(X500Principal holder) Sets the legal entity (i.e. the user) to which the license is granted by the issuer.voidSets the value of the propertyinfo.voidSets the time when the license represented by this license content has been issued.voidsetIssuer(X500Principal issuer) Sets the legal entity which grants the license to the holder.voidsetNotAfter(Date notAfter) Sets the time when the license ends to be valid.voidsetNotBefore(Date notBefore) Sets the time when the license begins to be valid.voidsetSubject(String subject) Sets the abstract description of the entity which needs to be licensed in order for it to be used - it could be the name of a software application like e.g.
-
Constructor Details
-
LicenseContent
public LicenseContent()
-
-
Method Details
-
clone
Deprecated.There's no need for this method. Since it's protected, it may vanish in the next major version update.Returns a clone of this instance. The returned clone shares the value of theextraproperty with this instance. All other mutable property values are cloned. -
getHolder
Returns the legal entity (i.e. the user) to which the license is granted by the issuer. The default isnull.- Returns:
- Value of property
holder. - See Also:
-
setHolder
Sets the legal entity (i.e. the user) to which the license is granted by the issuer.- Parameters:
holder- New value of bound propertyholder.- See Also:
-
getIssuer
Returns the legal entity which grants the license to the holder. The default isnull.- Returns:
- Value of property
issuer. - See Also:
-
setIssuer
Sets the legal entity which grants the license to the holder.- Parameters:
issuer- New value of bound propertyissuer.- See Also:
-
getSubject
Returns the abstract description of the entity which needs to be licensed in order for it to be used - it could be the name of a software application like e.g. "TrueMirror". The default isnull.- Returns:
- Value of property
subject.
-
setSubject
Sets the abstract description of the entity which needs to be licensed in order for it to be used - it could be the name of a software application like e.g. "TrueMirror".- Parameters:
subject- New value of bound propertysubject.
-
getIssued
Returns the time when the license represented by this license content has been issued. The default isnull.- Returns:
- Value of property
issued. - See Also:
-
setIssued
Sets the time when the license represented by this license content has been issued.- Parameters:
issued- New value of bound propertyissued.
-
getNotBefore
Returns the time when the license begins to be valid. The default isnull.- Returns:
- Value of property
notBefore.
-
setNotBefore
Sets the time when the license begins to be valid.- Parameters:
notBefore- New value of bound propertynotBefore.
-
getNotAfter
Returns the time when the license ends to be valid. The default isnull.- Returns:
- Value of property
notAfter.
-
setNotAfter
Sets the time when the license ends to be valid.- Parameters:
notAfter- New value of bound propertynotAfter.
-
getConsumerType
Returns the type of entity which needs to license the license subject in order to use it. This could be a computer or a user or something else. The default isnull.- Returns:
- Value of property
consumerType.
-
setConsumerType
Sets the type of entity which needs to license the license subject in order to use it. This could be a computer or a user or something else.- Parameters:
consumerType- New value of bound propertyconsumerType.
-
getConsumerAmount
public int getConsumerAmount()Returns the amount of consumers which are allowed to license the subject with this license. The default is1.- Returns:
- Value of property
consumerAmount.
-
setConsumerAmount
public void setConsumerAmount(int consumerAmount) Sets the amount of consumers which are allowed to license the subject with this license.- Parameters:
consumerAmount- New value of bound propertyconsumerAmount.
-
getInfo
Returns the value of the propertyinfo. This property may be used by applications to store public license text for informational purposes. Its value is displayed in thede.schlichtherle.license.wizard.LicensePanel. The default isnull. -
setInfo
Sets the value of the propertyinfo. This property may be used by applications to store public license text for informational purposes. Its value is displayed in thede.schlichtherle.license.wizard.LicensePanel.- Parameters:
info- New value of bound propertyinfo.
-
getExtra
Returns the value of the property extra. This property may be used by applications to store arbitrary private data which is not displayed to the user or checked by this library. The default isnull.- Since:
- The TrueLicense Library Collection 1.19.
-
setExtra
Sets the value of the property extra. This property may be used by applications to store arbitrary private data which is not displayed to the user or checked by this library.Warning: If you use this property, versions of the TrueLicense Library Collection prior to 1.19 will fail to install or verify the generated license key with an
AssertionError, which usually causes the application to terminate abnormally!(Since version 1.19, if an unknown property is found, a
PersistenceServiceExceptionis thrown by these methods instead.)- Parameters:
extra- New value of bound propertyextra. This object must either implement the JavaBeans specification or have direct support by the classXMLEncoder, such as strings and primitive type wrapper objects.- Since:
- The TrueLicense Library Collection 1.19.
-
hashCode
public int hashCode() -
equals
Returnstrueif and only ifobjectis an instance ofLicenseContentand their properties are considered equal. -
addPropertyChangeListener
Adds a PropertyChangeListener to the listener list.- Parameters:
l- The listener to add.
-
removePropertyChangeListener
Removes a PropertyChangeListener from the listener list.- Parameters:
l- The listener to remove.
-
firePropertyChange
-
firePropertyChange
-