Package org.cyclos.security.marketplace
Class AdQuestionServiceSecurity
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.security.BaseServiceSecurity
-
- org.cyclos.security.marketplace.AdQuestionServiceSecurity
-
- All Implemented Interfaces:
AdQuestionService,Service
@Security public class AdQuestionServiceSecurity extends BaseServiceSecurity implements AdQuestionService
Security layer forAdQuestionService
-
-
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 AdQuestionServiceSecurity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidanswer(Long id, String answer)Saves the answer for the given question For theanswerparameter we don't use the ValidationApi because it is validated in the service implementation to allow send a properly validation message.Longask(BasicAdVO adVO, String question)Creates a new question for the given ad For thequestionparameter we don't use the ValidationApi because it is validated in the service implementation to allow send a properly validation message.List<AdQuestionVO>list(BasicAdVO adVO)Returns the questions for the given adAdQuestionVOload(Long id)Loads a question by id.
Only if the logged user can ask for or it's the owner of the related advertisement.voidremove(Long id)Removes a questionprotected EntityCheck<?>resolveEntityCheck()Must be implemented in order to return theEntityCheckmanaged by this security component, or null if nonePage<AdQuestionVO>search(AdQuestionQuery params)Searches for unanswered questions-
Methods inherited from class org.cyclos.security.BaseServiceSecurity
checkGuest, checkId, checkIds, checkInternalName, checkLoggedIn, checkManagesUser, checkRelatesToUser, checkScope, checkVO, checkVOs, doInitialize, getEntityCheckRegistry, getUser, initialize
-
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, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, delete, detach, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
answer
public void answer(Long id, String answer) throws FrameworkException, IllegalActionException
Description copied from interface:AdQuestionServiceSaves the answer for the given question For theanswerparameter we don't use the ValidationApi because it is validated in the service implementation to allow send a properly validation message.- Specified by:
answerin interfaceAdQuestionService- Throws:
IllegalActionException- If the given question was already answeredFrameworkException
-
ask
public Long ask(BasicAdVO adVO, String question) throws FrameworkException
Description copied from interface:AdQuestionServiceCreates a new question for the given ad For thequestionparameter we don't use the ValidationApi because it is validated in the service implementation to allow send a properly validation message.- Specified by:
askin interfaceAdQuestionService- Throws:
FrameworkException
-
list
public List<AdQuestionVO> list(BasicAdVO adVO)
Description copied from interface:AdQuestionServiceReturns the questions for the given ad- Specified by:
listin interfaceAdQuestionService
-
load
public AdQuestionVO load(Long id) throws FrameworkException
Description copied from interface:AdQuestionServiceLoads a question by id.
Only if the logged user can ask for or it's the owner of the related advertisement.- Specified by:
loadin interfaceAdQuestionService- Throws:
FrameworkException
-
remove
public void remove(Long id) throws FrameworkException
Description copied from interface:AdQuestionServiceRemoves a question- Specified by:
removein interfaceAdQuestionService- Throws:
FrameworkException
-
search
public Page<AdQuestionVO> search(AdQuestionQuery params)
Description copied from interface:AdQuestionServiceSearches for unanswered questions- Specified by:
searchin interfaceAdQuestionService
-
resolveEntityCheck
protected EntityCheck<?> resolveEntityCheck()
Description copied from class:BaseServiceSecurityMust be implemented in order to return theEntityCheckmanaged by this security component, or null if none- Specified by:
resolveEntityCheckin classBaseServiceSecurity
-
-