Package org.cyclos.impl.users
Interface ProductsHandler
-
public interface ProductsHandler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ProductsAccessorgetAccessibleGroupsAccessor()Returns a products accessor for products on any of the current user's accessible groupsProductsAccessorgetAccessor(Collection<? extends ProductOwner> groups)Returns a products accessor for products on any of the given product ownersProductsAccessorgetAccessor(BasicGroup group)Returns a products accessor for the given groupProductsAccessorgetAccessor(BasicUser user)Returns a product accessor for a given user.
This method would returnSessionData.getProducts()for the following cases: When the given user is the same as the logged user; When the given user is the owner of the logged user (i.e.ProductsAccessorgetAccessor(BasicUser user, 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.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 BooleanPropertiesResolver<?>>
PRgetPropertyResolver(Class<PR> type)Returns a property resolver by type<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
-
-
-
Method Detail
-
getAccessibleGroupsAccessor
ProductsAccessor getAccessibleGroupsAccessor()
Returns a products accessor for products on any of the current user's accessible groups
-
getAccessor
ProductsAccessor getAccessor(BasicGroup group)
Returns a products accessor for the given group
-
getAccessor
ProductsAccessor getAccessor(BasicUser user)
Returns a product accessor for a given user.
This method would returnSessionData.getProducts()for the following cases:- When the given user is the same as the logged user;
- When the given user is the owner of the logged user (i.e. an operator);
-
getAccessor
ProductsAccessor getAccessor(BasicUser user, Channel channel, PrincipalType principalType)
Returns a product accessor for a user in a specific channel and using a specific principal type
-
getAccessor
ProductsAccessor getAccessor(BasicUser user, Network network)
Returns 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
-
getAccessor
ProductsAccessor getAccessor(Collection<? extends ProductOwner> groups)
Returns a products accessor for products on any of the given product owners
-
getAccessorFor
ProductsAccessor getAccessorFor(Collection<? extends Product> products)
Returns a products accessor for the given products
-
getAccessorFor
ProductsAccessor getAccessorFor(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.
-
getPropertyResolver
<PR extends BooleanPropertiesResolver<?>> PR getPropertyResolver(Class<PR> type)
Returns a property resolver by type
-
toList
<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
-
-