Class DefaultPdcSubscriptionService
- java.lang.Object
-
- org.silverpeas.core.pdc.subscription.service.DefaultPdcSubscriptionService
-
- All Implemented Interfaces:
PdcSubscriptionService
@Service public class DefaultPdcSubscriptionService extends Object implements PdcSubscriptionService
-
-
Constructor Summary
Constructors Constructor Description DefaultPdcSubscriptionService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkAxisOnDelete(int axisId, String axisName)
Remote inteface method Implements PdcSubscription check for axis deletion.protected boolean
checkSubscriptionRemove(PdcSubscription subscription, int axisId, List<String> oldPath, List<String> newPath)
void
checkSubscriptions(List<? extends Value> classifyValues, String componentId, int silverObjectid)
This method check is any subscription that match criterias provided and sends notification if succeedprotected boolean
checkValueInPath(String value, List<String> pathList)
Checks if values provided presented in provided path.void
checkValueOnDelete(int axisId, String axisName, List<String> oldPath, List<String> newPath, List<Value> pathInfo)
Implements PdcSubscription check for value deletion.protected boolean
checkValues(Criteria criteria, Value searchValue)
protected boolean
checkValuesRemove(String originalPath, List<String> oldPath, List<String> newPath)
int
createPDCSubscription(PdcSubscription subscription)
Remote interface methodList<PdcSubscription>
getPDCSubscriptionByUserId(int userId)
Remote interface methodPdcSubscription
getPDCSubsriptionById(int id)
Remote interface methodprotected boolean
isCorrespondingSubscription(PdcSubscription subscription, List<? extends Value> classifyValues)
void
removePDCSubscriptionById(int id)
Remote interface methodvoid
removePDCSubscriptionById(int[] ids)
Remote interface methodvoid
updatePDCSubscription(PdcSubscription subscription)
Remote interface method
-
-
-
Method Detail
-
getPDCSubscriptionByUserId
public List<PdcSubscription> getPDCSubscriptionByUserId(int userId)
Remote interface method- Specified by:
getPDCSubscriptionByUserId
in interfacePdcSubscriptionService
- Parameters:
userId
-- Returns:
- a list of
PDCSubscriptions
finded by id provided
-
getPDCSubsriptionById
public PdcSubscription getPDCSubsriptionById(int id)
Remote interface method- Specified by:
getPDCSubsriptionById
in interfacePdcSubscriptionService
- Parameters:
id
-- Returns:
-
createPDCSubscription
public int createPDCSubscription(PdcSubscription subscription)
Remote interface method- Specified by:
createPDCSubscription
in interfacePdcSubscriptionService
- Parameters:
subscription
-- Returns:
- new autogenerated PdcSubscription id
-
updatePDCSubscription
public void updatePDCSubscription(PdcSubscription subscription)
Remote interface method- Specified by:
updatePDCSubscription
in interfacePdcSubscriptionService
- Parameters:
subscription
-
-
removePDCSubscriptionById
public void removePDCSubscriptionById(int id)
Remote interface method- Specified by:
removePDCSubscriptionById
in interfacePdcSubscriptionService
- Parameters:
id
-
-
removePDCSubscriptionById
public void removePDCSubscriptionById(int[] ids)
Remote interface method- Specified by:
removePDCSubscriptionById
in interfacePdcSubscriptionService
- Parameters:
ids
-
-
checkAxisOnDelete
public void checkAxisOnDelete(int axisId, String axisName)
Remote inteface method Implements PdcSubscription check for axis deletion. It deletes all references to this axis from PdcSubscription module DB- Specified by:
checkAxisOnDelete
in interfacePdcSubscriptionService
- Parameters:
axisId
- the axis to be checkedaxisName
- the name of the axis
-
checkValueOnDelete
public void checkValueOnDelete(int axisId, String axisName, List<String> oldPath, List<String> newPath, List<Value> pathInfo)
Implements PdcSubscription check for value deletion. It deletes all references to the path containing this value from PdcSubscription module DB- Specified by:
checkValueOnDelete
in interfacePdcSubscriptionService
- Parameters:
axisId
- the axis to be checkedaxisName
- the name of the axisoldPath
- old path that would be removed soonnewPath
- new path. That will be places instead of old for this axispathInfo
- should contains PdcBm.getFullPath data structure
-
checkSubscriptions
public void checkSubscriptions(List<? extends Value> classifyValues, String componentId, int silverObjectid)
This method check is any subscription that match criterias provided and sends notification if succeed- Specified by:
checkSubscriptions
in interfacePdcSubscriptionService
- Parameters:
classifyValues
- Linst of ClassifyValues to be checkedcomponentId
- component where classify event occuressilverObjectid
- object that was classified
-
checkSubscriptionRemove
protected boolean checkSubscriptionRemove(PdcSubscription subscription, int axisId, List<String> oldPath, List<String> newPath)
- Parameters:
subscription
- PdcSubscription to checkaxisId
- id of the axis value of which should be removedoldPath
- list of original axis paths (before deletion)newPath
- list new axis path to be places instead of old path- Returns:
- true if subscription should be removed
-
checkValuesRemove
protected boolean checkValuesRemove(String originalPath, List<String> oldPath, List<String> newPath)
- Parameters:
originalPath
-oldPath
-newPath
-- Returns:
- true if path provided was removed should be removed
-
checkValueInPath
protected boolean checkValueInPath(String value, List<String> pathList)
Checks if values provided presented in provided path.
Ex1: path /2/3/4/5/ value: /5/ result:true
Ex2: path /2/3/4/5/ value: /3/ result true
Ex2: path /2/3/4/5/ value: /8/ result false
-
isCorrespondingSubscription
protected boolean isCorrespondingSubscription(PdcSubscription subscription, List<? extends Value> classifyValues)
- Parameters:
subscription
-classifyValues
-- Returns:
- true if subscription provided match the list of classify values
-
-