Package com.iizix.server.agreement
Class AcceptedAgreement
java.lang.Object
com.iizix.server.agreement.AcceptedAgreement
The user acceptance of agreement. This class is used when displaying the agreement to the user and when he/she/it accepts it, it is saved in the database.
- Author:
- Christopher Mindus
Field Summary
Modifier and TypeFieldDescriptionfinal LicenseAgreement
The agreement accepted.final String
The language code.final InetAddress
The remote internet address that accepted it, null for none.final AuthenticatedUser
The User.Constructor Summary
ConstructorDescriptionAcceptedAgreement
(LicenseAgreement agreement, String languageCode, AuthenticatedUser user, ClientSessionGyro clientGyro) Constructs a user acceptance of an agreement.Method Summary
Modifier and TypeMethodDescriptionGets the IP address to use, max 41 characters.void
Marks the agreement as accepted and saves it in the database.
Field Details
agreement
The agreement accepted.languageCode
The language code.user
The User.remoteAddress
The remote internet address that accepted it, null for none.
Constructor Details
AcceptedAgreement
public AcceptedAgreement(LicenseAgreement agreement, String languageCode, AuthenticatedUser user, ClientSessionGyro clientGyro) Constructs a user acceptance of an agreement.- Parameters:
agreement
- The agreement accepted.languageCode
- The language code.user
- The user who accepted the agreement.clientGyro
- The client session.
Method Details
getIPAddress
Gets the IP address to use, max 41 characters.- Returns:
- The IP v4 or v6 address, maximum 41 characters.
setAccepted
public void setAccepted()Marks the agreement as accepted and saves it in the database. No exception is thrown, however everything is logged in the server (both the acceptance and exceptions).