Package org.cyclos.impl.users
Class ProductsHandlerImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseNetworkedHandlerImpl
-
- org.cyclos.impl.users.ProductsHandlerImpl
-
- All Implemented Interfaces:
ProductsHandler
@Component public class ProductsHandlerImpl extends BaseNetworkedHandlerImpl implements ProductsHandler
-
-
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 ProductsHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProductsAccessorgetAccessibleGroupsAccessor()Returns a products accessor for products on any of the current user's accessible groupsProductsAccessorgetAccessor(Collection<? extends BasicGroup> basicGroups)Returns a products accessor for products on any of the given groupsProductsAccessorgetAccessor(BasicGroup group)Returns a products accessor for the given groupProductsAccessorgetAccessor(BasicUser basicUser)Returns a product accessor for a given user.ProductsAccessorgetAccessor(BasicUser basicUser, Channel channel, PrincipalType principalType)Returns a product accessor for a user in a specific channel and using a specific principal typeProductsAccessorgetAccessor(BasicUser user, Network network)Returns a product accessor for a user on the given network.ProductsAccessorgetAccessor(User user)Returns a product accessor for a given user.ProductsAccessorgetAccessorFor(Collection<? extends Product> products)Returns a products accessor for the given productsProductsAccessorgetAccessorFor(Collection<Product> products, Channel channel, PrincipalType principalType)Returns a products accessor for the given products filtering the products list by the specified channel and principal type.<PR extends PropertyResolver<?>>
PRgetPropertyResolver(Class<PR> type)Returns a property resolver by typeObjectgetProxy(Class<? extends IProduct> type, Collection<? extends Product> products)Returns a proxy instance containing the given productsvoidinitialize()<R extends Bean,K>
List<R>toList(Collection<K> allKeys, BooleanPropertiesHolder<K> booleanProperties, Class<R> resultType, Property<?,R> keyProperty)Converts a map of some type toBooleanPropertiesinto a list of objects, for each entry, usesBooleanProperties.instantiate(Class)to instantiate a bean and fills the key as a property in the resulting beans-
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
-
getAccessibleGroupsAccessor
public ProductsAccessor getAccessibleGroupsAccessor()
Description copied from interface:ProductsHandlerReturns a products accessor for products on any of the current user's accessible groups- Specified by:
getAccessibleGroupsAccessorin interfaceProductsHandler
-
getAccessor
public ProductsAccessor getAccessor(BasicGroup group)
Description copied from interface:ProductsHandlerReturns a products accessor for the given group- Specified by:
getAccessorin interfaceProductsHandler
-
getAccessor
public ProductsAccessor getAccessor(BasicUser basicUser)
Description copied from interface:ProductsHandlerReturns a product accessor for a given user. When logged-in exactly as thatBasicUser, returnsSessionData.getProducts()to avoid creating a new accessor.- Specified by:
getAccessorin interfaceProductsHandler
-
getAccessor
public ProductsAccessor getAccessor(BasicUser basicUser, Channel channel, PrincipalType principalType)
Description copied from interface:ProductsHandlerReturns a product accessor for a user in a specific channel and using a specific principal type- Specified by:
getAccessorin interfaceProductsHandler
-
getAccessor
public ProductsAccessor getAccessor(BasicUser user, Network network)
Description copied from interface:ProductsHandlerReturns a product accessor for a user on the given network. Maybe a global administrator switched to a network or a user of the same network- Specified by:
getAccessorin interfaceProductsHandler
-
getAccessor
public ProductsAccessor getAccessor(Collection<? extends BasicGroup> basicGroups)
Description copied from interface:ProductsHandlerReturns a products accessor for products on any of the given groups- Specified by:
getAccessorin interfaceProductsHandler
-
getAccessor
public ProductsAccessor getAccessor(User user)
Description copied from interface:ProductsHandlerReturns a product accessor for a given user. When logged-in as thatUseror operators of the given user, returnsSessionData.getProducts()to avoid creating a new accessor.- Specified by:
getAccessorin interfaceProductsHandler
-
getAccessorFor
public ProductsAccessor getAccessorFor(Collection<? extends Product> products)
Description copied from interface:ProductsHandlerReturns a products accessor for the given products- Specified by:
getAccessorForin interfaceProductsHandler
-
getAccessorFor
public ProductsAccessor getAccessorFor(Collection<Product> products, Channel channel, PrincipalType principalType)
Description copied from interface:ProductsHandlerReturns a products accessor for the given products filtering the products list by the specified channel and principal type.- Specified by:
getAccessorForin interfaceProductsHandler
-
getPropertyResolver
public <PR extends PropertyResolver<?>> PR getPropertyResolver(Class<PR> type)
Description copied from interface:ProductsHandlerReturns a property resolver by type- Specified by:
getPropertyResolverin interfaceProductsHandler
-
getProxy
public Object getProxy(Class<? extends IProduct> type, Collection<? extends Product> products)
Returns a proxy instance containing the given products
-
initialize
@PostConstruct public void initialize()
-
toList
public <R extends Bean,K> List<R> toList(Collection<K> allKeys, BooleanPropertiesHolder<K> booleanProperties, Class<R> resultType, Property<?,R> keyProperty)
Description copied from interface:ProductsHandlerConverts a map of some type toBooleanPropertiesinto a list of objects, for each entry, usesBooleanProperties.instantiate(Class)to instantiate a bean and fills the key as a property in the resulting beans- Specified by:
toListin interfaceProductsHandler
-
-