com.silverpeas.pdcSubscription.ejb
Class PdcSubscriptionBmEJB

java.lang.Object
  extended by com.silverpeas.pdcSubscription.ejb.PdcSubscriptionBmEJB
All Implemented Interfaces:
PdcSubscriptionBm

public class PdcSubscriptionBmEJB
extends Object
implements PdcSubscriptionBm


Constructor Summary
PdcSubscriptionBmEJB()
           
 
Method Summary
 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 succeed
protected  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 method
 List<PDCSubscription> getPDCSubscriptionByUserId(int userId)
          Remote interface method
 PDCSubscription getPDCSubsriptionById(int id)
          Remote interface method
protected  boolean isCorrespondingSubscription(PDCSubscription subscription, List<? extends Value> classifyValues)
           
 void removePDCSubscriptionById(int id)
          Remote interface method
 void removePDCSubscriptionById(int[] ids)
          Remote interface method
 void updatePDCSubscription(PDCSubscription subscription)
          Remote interface method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PdcSubscriptionBmEJB

public PdcSubscriptionBmEJB()
Method Detail

getPDCSubscriptionByUserId

public List<PDCSubscription> getPDCSubscriptionByUserId(int userId)
Remote interface method

Specified by:
getPDCSubscriptionByUserId in interface PdcSubscriptionBm
Parameters:
userId -
Returns:
a list of PDCSubscriptions finded by id provided

getPDCSubsriptionById

public PDCSubscription getPDCSubsriptionById(int id)
Remote interface method

Specified by:
getPDCSubsriptionById in interface PdcSubscriptionBm
Parameters:
id -
Returns:

createPDCSubscription

public int createPDCSubscription(PDCSubscription subscription)
Remote interface method

Specified by:
createPDCSubscription in interface PdcSubscriptionBm
Parameters:
subscription -
Returns:
new autogenerated PDCSubscription id

updatePDCSubscription

public void updatePDCSubscription(PDCSubscription subscription)
Remote interface method

Specified by:
updatePDCSubscription in interface PdcSubscriptionBm
Parameters:
subscription -

removePDCSubscriptionById

public void removePDCSubscriptionById(int id)
Remote interface method

Specified by:
removePDCSubscriptionById in interface PdcSubscriptionBm
Parameters:
id -

removePDCSubscriptionById

public void removePDCSubscriptionById(int[] ids)
Remote interface method

Specified by:
removePDCSubscriptionById in interface PdcSubscriptionBm
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 interface PdcSubscriptionBm
Parameters:
axisId - the axis to be checked
axisName - 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 interface PdcSubscriptionBm
Parameters:
axisId - the axis to be checked
axisName - the name of the axis
oldPath - old path that would be removed soon
newPath - new path. That will be places instead of old for this axis
pathInfo - 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 interface PdcSubscriptionBm
Parameters:
classifyValues - Linst of ClassifyValues to be checked
componentId - component where classify event occures
silverObjectid - object that was classified

checkSubscriptionRemove

protected boolean checkSubscriptionRemove(PDCSubscription subscription,
                                          int axisId,
                                          List<String> oldPath,
                                          List<String> newPath)
Parameters:
subscription - PDCSubscription to check
axisId - id of the axis value of which should be removed
oldPath - 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

checkValues

protected boolean checkValues(Criteria criteria,
                              Value searchValue)
Parameters:
criteria -
searchValue -
Returns:
true if criteria provided match the searchValue provided


Copyright © 2016 Silverpeas. All Rights Reserved.