Package org.cyclos.impl.access
Class AgreementLogServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.access.AgreementLogServiceImpl
-
- All Implemented Interfaces:
AgreementLogServiceLocal,AgreementLogService,Service
@Service public class AgreementLogServiceImpl extends BaseServiceImpl implements AgreementLogServiceLocal
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description AgreementLogServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AgreementLogaccept(Agreement agreement, User user)Accepts the agreement for the given uservoidacceptPending(Set<AgreementVO> agreements)Marks the given pending agreements as accepted.voidappendValidations(Validator validator, List<Agreement> agreements, Collection<AgreementVO> acceptedVOs)Appends a validation for each of the given agreements, if the corresponding one isn't acceptedUserAgreementsDatagetData(UserLocatorVO locator)Returns agreements data for the given userList<Agreement>getUserPendingAgreements(User user)Return pending agreements of the given user.booleanhasPendingAgreements(User user)Returns if the given user has a pending agreementbooleanhasPendingAgreements(User user, ProductsAccessor products)Returns if the given user has a pending agreement, using the given products to checkbooleanisAgreementAccepted(Agreement agreement, User user)Returns whether the given agreement is accepted for the given userbooleanisAnyAgreementAccepted(User user)Returns whether the given user has ever accepted some agreementAgreementLogVOload(Long id)Loads anAgreementLogVOby idprotected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkvoidsaveOptional(@NotNull UserOptionalAgreementsDTO params)Saves the accepted status for optional agreementsvoidtriggerActivatedExtensionPoints(User user)Extension points aren't triggered until the user is validated.-
Methods inherited from class org.cyclos.impl.BaseServiceImpl
initializeNetworkMappings
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, setAlreadyValidated, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
accept
public AgreementLog accept(Agreement agreement, User user)
Description copied from interface:AgreementLogServiceLocalAccepts the agreement for the given user- Specified by:
acceptin interfaceAgreementLogServiceLocal
-
acceptPending
public void acceptPending(Set<AgreementVO> agreements) throws FrameworkException
Description copied from interface:AgreementLogServiceMarks the given pending agreements as accepted. It is validated that all the currently pending agreements are accepted, ie, it is not possible to accept a subset of the pending agreements- Specified by:
acceptPendingin interfaceAgreementLogService- Throws:
FrameworkException
-
appendValidations
public void appendValidations(Validator validator, List<Agreement> agreements, Collection<AgreementVO> acceptedVOs)
Description copied from interface:AgreementLogServiceLocalAppends a validation for each of the given agreements, if the corresponding one isn't accepted- Specified by:
appendValidationsin interfaceAgreementLogServiceLocal
-
getData
public UserAgreementsData getData(UserLocatorVO locator) throws FrameworkException
Description copied from interface:AgreementLogServiceReturns agreements data for the given user- Specified by:
getDatain interfaceAgreementLogService- Throws:
FrameworkException
-
getUserPendingAgreements
public List<Agreement> getUserPendingAgreements(User user)
Description copied from interface:AgreementLogServiceLocalReturn pending agreements of the given user.- Specified by:
getUserPendingAgreementsin interfaceAgreementLogServiceLocal
-
hasPendingAgreements
public boolean hasPendingAgreements(User user)
Description copied from interface:AgreementLogServiceLocalReturns if the given user has a pending agreement- Specified by:
hasPendingAgreementsin interfaceAgreementLogServiceLocal
-
hasPendingAgreements
public boolean hasPendingAgreements(User user, ProductsAccessor products)
Description copied from interface:AgreementLogServiceLocalReturns if the given user has a pending agreement, using the given products to check- Specified by:
hasPendingAgreementsin interfaceAgreementLogServiceLocal
-
isAgreementAccepted
public boolean isAgreementAccepted(Agreement agreement, User user)
Description copied from interface:AgreementLogServiceLocalReturns whether the given agreement is accepted for the given user- Specified by:
isAgreementAcceptedin interfaceAgreementLogServiceLocal
-
isAnyAgreementAccepted
public boolean isAnyAgreementAccepted(User user)
Description copied from interface:AgreementLogServiceLocalReturns whether the given user has ever accepted some agreement- Specified by:
isAnyAgreementAcceptedin interfaceAgreementLogServiceLocal
-
load
public AgreementLogVO load(Long id) throws EntityNotFoundException
Description copied from interface:AgreementLogServiceLoads anAgreementLogVOby id- Specified by:
loadin interfaceAgreementLogService- Throws:
EntityNotFoundException
-
saveOptional
public void saveOptional(@NotNull @NotNull UserOptionalAgreementsDTO params) throws FrameworkExceptionDescription copied from interface:AgreementLogServiceSaves the accepted status for optional agreements- Specified by:
saveOptionalin interfaceAgreementLogService- Throws:
FrameworkException
-
triggerActivatedExtensionPoints
public void triggerActivatedExtensionPoints(User user)
Description copied from interface:AgreementLogServiceLocalExtension points aren't triggered until the user is validated. Only then trigger them.- Specified by:
triggerActivatedExtensionPointsin interfaceAgreementLogServiceLocal
-
registerNetworkMappings
protected void registerNetworkMappings(NetworkPathRegistry networkPathRegistry)
Description copied from class:BaseServiceImplNeeds to be overridden by subclasses to register the path up to the network- Specified by:
registerNetworkMappingsin classBaseServiceImpl
-
-