Class CmsPsuService


  • @Service
    public class CmsPsuService
    extends Object
    • Constructor Detail

      • CmsPsuService

        public CmsPsuService()
    • Method Detail

      • definePsuDataForAuthorisation

        public Optional<PsuData> definePsuDataForAuthorisation​(PsuData psuDataForCheck,
                                                               List<PsuData> psuDataList)
        Checks if the specified psuData is in the psu list, if it is true then returns an element from the list. If psuData is absent then returns this psu
        Parameters:
        psuDataForCheck - psu which will search in the list
        psuDataList - list where will search psuData
        Returns:
        if the psuData is not in the psuDataList then will return this psuData otherwise return element form list
      • enrichPsuData

        public List<PsuData> enrichPsuData​(PsuData psuData,
                                           List<PsuData> psuDataList)
        Adds psuData to psuDataList if it is not there
        Parameters:
        psuData - psu which will search in the list
        psuDataList - list where will search psuData
        Returns:
        List with psuData
      • isPsuDataNew

        public boolean isPsuDataNew​(PsuData psuData,
                                    List<PsuData> psuDataList)
        Checks if the specified psuData is in the psu list
        Parameters:
        psuData - psu which will search in the list
        psuDataList - list where will search psuData
        Returns:
        if the psuData is not in the psuDataList then will return true otherwise return false
      • isPsuDataListEqual

        public boolean isPsuDataListEqual​(@NotNull
                                          @NotNull List<PsuData> psuDataList,
                                          @NotNull
                                          @NotNull List<PsuData> anotherPsuDataList)
        Checks whether two specified lists of PSU Data are equals

        This method ignores internal entity identifier of PsuData when comparing lists.

        Parameters:
        psuDataList - the first list to be compared, must not be null
        anotherPsuDataList - the second list to be compared, must not be null
        Returns:
        true if two lists are equal, false otherwise
      • isPsuDataRequestCorrect

        public boolean isPsuDataRequestCorrect​(PsuData psuRequest,
                                               PsuData psuAuth)
        Checks if the specified psu in request equals psu in authorisation
        Parameters:
        psuRequest - psu in request
        psuAuth - psu in authorisation
        Returns:
        true if psu in authorisation is null or equals psu in request