Package org.cyclos.impl.users
Class BrokeringServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.users.BrokeringServiceImpl
-
- All Implemented Interfaces:
BrokeringServiceLocal,Service,BrokeringService
@Service public class BrokeringServiceImpl extends BaseServiceImpl implements BrokeringServiceLocal
Session Bean implementation class for brokering
-
-
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 BrokeringServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LongaddBroker(User user, User broker, boolean mainBroker, boolean notifyUser)Adds a brokering relationLongaddBroker(UserLocatorVO userLocator, UserLocatorVO brokerLocator, boolean mainBroker)Adds a broker for the given user, optionally setting the broker as mainBrokeringgetActiveBrokering(User user, User broker)Returns the active brokering for the given user and broker, or throwsEntityNotFoundExceptionif not his broker or the relation has expiredAddBrokerDatagetAddBrokerData(UserLocatorVO locator)Returns data for adding a broker to the given userBrokeringWithUserVOgetByUserAndBroker(@NotNull UserLocatorVO userLocator, @NotNull UserLocatorVO brokerLocator)Returns details of a brokering relation by user and broker, only if the broker is currently the user's brokerBrokeringDatagetData(UserLocatorVO locator)Returns data for a user brokeringsprotected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkvoidremoveAll(User user)Removes all brokerings relations in which the given user is either the broker or a the membervoidremoveBroker(User user, User broker)Removes a brokering relationvoidremoveBroker(UserLocatorVO userLocator, UserLocatorVO brokerLocator)Removes the given broker from the user brokeringsvoidsetMainBroker(UserLocatorVO userLocator, UserLocatorVO brokerLocator)Assigns the given brokering as main-
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
-
addBroker
public Long addBroker(User user, User broker, boolean mainBroker, boolean notifyUser)
Description copied from interface:BrokeringServiceLocalAdds a brokering relation- Specified by:
addBrokerin interfaceBrokeringServiceLocal
-
addBroker
public Long addBroker(UserLocatorVO userLocator, UserLocatorVO brokerLocator, boolean mainBroker) throws FrameworkException, IllegalActionException
Description copied from interface:BrokeringServiceAdds a broker for the given user, optionally setting the broker as main- Specified by:
addBrokerin interfaceBrokeringService- Throws:
IllegalActionException- When the given broker is either inactive or is not a brokerFrameworkException
-
getActiveBrokering
public Brokering getActiveBrokering(User user, User broker) throws FrameworkException
Description copied from interface:BrokeringServiceLocalReturns the active brokering for the given user and broker, or throwsEntityNotFoundExceptionif not his broker or the relation has expired- Specified by:
getActiveBrokeringin interfaceBrokeringServiceLocal- Throws:
FrameworkException
-
getAddBrokerData
public AddBrokerData getAddBrokerData(UserLocatorVO locator) throws FrameworkException
Description copied from interface:BrokeringServiceReturns data for adding a broker to the given user- Specified by:
getAddBrokerDatain interfaceBrokeringService- Throws:
FrameworkException
-
getByUserAndBroker
public BrokeringWithUserVO getByUserAndBroker(@NotNull @NotNull UserLocatorVO userLocator, @NotNull @NotNull UserLocatorVO brokerLocator) throws FrameworkException
Description copied from interface:BrokeringServiceReturns details of a brokering relation by user and broker, only if the broker is currently the user's broker- Specified by:
getByUserAndBrokerin interfaceBrokeringService- Throws:
FrameworkException
-
getData
public BrokeringData getData(UserLocatorVO locator) throws FrameworkException
Description copied from interface:BrokeringServiceReturns data for a user brokerings- Specified by:
getDatain interfaceBrokeringService- Throws:
FrameworkException
-
removeAll
public void removeAll(User user) throws FrameworkException
Description copied from interface:BrokeringServiceLocalRemoves all brokerings relations in which the given user is either the broker or a the member- Specified by:
removeAllin interfaceBrokeringServiceLocal- Throws:
FrameworkException
-
removeBroker
public void removeBroker(User user, User broker)
Description copied from interface:BrokeringServiceLocalRemoves a brokering relation- Specified by:
removeBrokerin interfaceBrokeringServiceLocal
-
removeBroker
public void removeBroker(UserLocatorVO userLocator, UserLocatorVO brokerLocator) throws IllegalActionException
Description copied from interface:BrokeringServiceRemoves the given broker from the user brokerings- Specified by:
removeBrokerin interfaceBrokeringService- Throws:
IllegalActionException- When the given broker is not a broker of the given user
-
setMainBroker
public void setMainBroker(UserLocatorVO userLocator, UserLocatorVO brokerLocator) throws FrameworkException, IllegalActionException
Description copied from interface:BrokeringServiceAssigns the given brokering as main- Specified by:
setMainBrokerin interfaceBrokeringService- Throws:
IllegalActionException- When the given broker is not a broker of the given userFrameworkException
-
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
-
-