Package org.cyclos.impl.users
Class BaseProductsOwnerServiceImpl<O extends ProductOwner,L extends ProductAssignmentLog<O>,VO extends EntityVO,D extends ProductsCollections>
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.users.BaseProductsOwnerServiceImpl<O,L,VO,D>
-
- All Implemented Interfaces:
BaseProductsOwnerServiceLocal<O,VO,D>,Service,BaseProductsOwnerService<VO,D>
- Direct Known Subclasses:
ProductsGroupServiceImpl,ProductsUserServiceImpl
public abstract class BaseProductsOwnerServiceImpl<O extends ProductOwner,L extends ProductAssignmentLog<O>,VO extends EntityVO,D extends ProductsCollections> extends BaseServiceImpl implements BaseProductsOwnerServiceLocal<O,VO,D>
Implementation forBaseProductsOwnerService
-
-
Field Summary
Fields Modifier and Type Field Description protected Class<L>logClassprotected Class<O>ownerClass-
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 BaseProductsOwnerServiceImpl(Class<O> ownerClass, Class<L> logClass)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanassign(ProductVO productVO, VO ownerVO)Assigns the given product to the product owner.ActiveProductsDatagetActiveProducts(VO ownerVO, ChannelVO channelVO, PrincipalTypeVO principalTypeVO)Returns theActiveProductsData, containing all the actual product data for the user/group with the given id and the specified channel (if null then it doesn't filter the products by channel) and principal type (if null then it doesn't filter the products by principal type).DgetData(O owner)Returns the data used to view / manage an owner's individual productsDgetData(VO ownerVO)Returns the data used to view / manage an owner's individual productsprotected abstract DgetDataWithoutLogs(O owner)protected abstract List<ProductAssignmentLogVO>getLogs(O owner)List<ProductAssignmentLogVO>getLogs(VO ownerVO)Returns the log for the individually assigned products to the given user.protected abstract booleanisCanAssign(O owner)Returns if products can be assigned to the ownerprotected booleanisProductInHigherHierarchy(O owner, Product product)Returns whether the given product is available higher in the hierarchy than the given owner.protected voidlog(ProductAssignmentAction action, Product product, O owner)Logs a given actionprotected abstract voidonProductAssigned(O owner, Product product)protected abstract voidonProductUnassigned(O owner, Product product)booleanunassign(ProductVO productVO, VO ownerVO)Unassigns the given product from the ownerprotected abstract voidvalidateAssign(O owner, Product product)protected abstract voidvalidateUnAssign(O owner, Product product)-
Methods inherited from class org.cyclos.impl.BaseServiceImpl
initializeNetworkMappings, registerNetworkMappings
-
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
-
-
-
-
Field Detail
-
ownerClass
protected final Class<O extends ProductOwner> ownerClass
-
logClass
protected final Class<L extends ProductAssignmentLog<O>> logClass
-
-
Method Detail
-
assign
public boolean assign(ProductVO productVO, VO ownerVO) throws FrameworkException
Description copied from interface:BaseProductsOwnerServiceAssigns the given product to the product owner.- Specified by:
assignin interfaceBaseProductsOwnerService<O extends ProductOwner,L extends ProductAssignmentLog<O>>- Throws:
FrameworkException
-
getActiveProducts
public ActiveProductsData getActiveProducts(VO ownerVO, ChannelVO channelVO, PrincipalTypeVO principalTypeVO) throws EntityNotFoundException
Description copied from interface:BaseProductsOwnerServiceReturns theActiveProductsData, containing all the actual product data for the user/group with the given id and the specified channel (if null then it doesn't filter the products by channel) and principal type (if null then it doesn't filter the products by principal type).- Specified by:
getActiveProductsin interfaceBaseProductsOwnerService<O extends ProductOwner,L extends ProductAssignmentLog<O>>- Throws:
EntityNotFoundException
-
getData
public final D getData(O owner)
Description copied from interface:BaseProductsOwnerServiceLocalReturns the data used to view / manage an owner's individual products- Specified by:
getDatain interfaceBaseProductsOwnerServiceLocal<O extends ProductOwner,L extends ProductAssignmentLog<O>,VO extends EntityVO>
-
getData
public final D getData(@NotNull VO ownerVO)
Description copied from interface:BaseProductsOwnerServiceReturns the data used to view / manage an owner's individual products- Specified by:
getDatain interfaceBaseProductsOwnerService<O extends ProductOwner,L extends ProductAssignmentLog<O>>
-
getLogs
public final List<ProductAssignmentLogVO> getLogs(@NotNull VO ownerVO) throws FrameworkException
Description copied from interface:BaseProductsOwnerServiceReturns the log for the individually assigned products to the given user.- Specified by:
getLogsin interfaceBaseProductsOwnerService<O extends ProductOwner,L extends ProductAssignmentLog<O>>- Throws:
FrameworkException
-
unassign
public boolean unassign(ProductVO productVO, VO ownerVO) throws FrameworkException
Description copied from interface:BaseProductsOwnerServiceUnassigns the given product from the owner- Specified by:
unassignin interfaceBaseProductsOwnerService<O extends ProductOwner,L extends ProductAssignmentLog<O>>- Throws:
FrameworkException
-
getLogs
protected abstract List<ProductAssignmentLogVO> getLogs(O owner)
-
isCanAssign
protected abstract boolean isCanAssign(O owner)
Returns if products can be assigned to the owner
-
isProductInHigherHierarchy
protected boolean isProductInHigherHierarchy(O owner, Product product)
Returns whether the given product is available higher in the hierarchy than the given owner.
-
log
protected final void log(ProductAssignmentAction action, Product product, O owner)
Logs a given action
-
-