@startuml
title ** __DSPA Selfcare PCF: getBanMsisdnsWithStatusForBan__ **\n

actor Client #Magenta

participant SelfCareServiceWSController
participant SelfCareService as "<b><color:white>SelfCareService" #Magenta
participant SelfCareUtil
participant IAMManager
participant IAMDao
participant LDAPService
participant IAM_LDAP #DarkSeaGreen
queue PUBLISH_TOPIC #Magenta

skinparam sequenceGroupBorderColor blue 
group#Magenta <b><color:white> getBanMsisdnsWithStatusForBan 

Client -> SelfCareServiceWSController: <font color=blue><b> getBanMsisdnsWithStatusForBan [[https://servicecatalog.internal.t-mobile.com/servicecat/dspa/2016-10-14/wsdl_api/wsdl/SelfCareService.wsdl WSDL]]\n (JAX-RPC XML Request over Http)

note left
URI: /webservice/SelfCareService
Client : TIBCO_ESOA
endnote

SelfCareServiceWSController->SelfCareService: getBanMsisdnsWithStatusForBan(ban)
SelfCareService-> SelfCareUtil : validateRequest(ban)
alt ban doesnot match banPattern
	SelfCareUtil->SelfCareService: throws InvalidRequestException
	SelfCareService -> SelfCareServiceWSController : throws InvalidRequestException
	SelfCareServiceWSController -> Client : throws InvalidRequestException
end
SelfCareService-> IAMManager : getBanMsisdnsWithStatus(ban)
IAMManager-> IAMDao : getBanMsisdnsWithStatus(ban)
IAMDao-> LDAPService : ldapSearch(searchCriteria, filterAttributes, searchControls)
note left : with ban in searchCriteria
LDAPService -> IAM_LDAP : search(rootSuffix, searchCriteria, searchControls, handler)
IAM_LDAP -> LDAPService : SearchResult List
LDAPService-> IAMDao : SearchResult List
alt Search Result is empty or doesnot return any attributes
	IAMDao-> IAMManager : throws CustomerNotFoundException, NoSuchBanException
	IAMManager-> SelfCareService : throws CustomerNotFoundException, NoSuchBanException
	SelfCareService -> SelfCareServiceWSController : throws NoSuchBanException
	SelfCareServiceWSController -> Client : throws NoSuchBanException
end
IAMDao->IAMManager : CustomerStatus
IAMManager -> SelfCareService : CustomerStatus
alt Account type and subtype is not GMP
	alt Multiline customerType is null
	note left : Repeat this for all the indexes in CustomerStatus array
		SelfCareService-> IAMManager : getProfile(msisdn)
		IAMManager->IAMDao : getProfile(msisdn)
		IAMDao-> LDAPService : ldapSearch(searchCriteria, filterAttributes, searchControls)
		note left : with msisdn in searchCriteria
		LDAPService -> IAM_LDAP : search(rootSuffix, searchCriteria, searchControls, handler)
		IAM_LDAP -> LDAPService : SearchResult List
		LDAPService-> IAMDao : SearchResult
		IAMDao-> IAMManager : CustomerProfile
		IAMManager-> SelfCareService : CustomerProfile
		alt Search Result is empty or doesnot return any attributes
			IAMDao-> IAMManager : throws CustomerNotFoundException, NoSuchMsisdnException
			IAMManager-> SelfCareService : throws CustomerNotFoundException, NoSuchMsisdnException
			SelfCareService -> SelfCareServiceWSController : throws NoSuchMsisdnException
			SelfCareServiceWSController-> Client : throws NoSuchMsisdnException, SelfCareSystemException
		end
	end
	alt multilineCustomerType is NULL for Customer
		SelfCareService -> SelfCareUtil: getMLCustomerTypeForBlank(profile)
                group#DarkSeaGreen <b>Topic: TMOBILE.<env>.DSPA.TOPIC.PUBLISH, event: 'setMLType' and MsgType: 'Publish' 
  		  SelfCareService[#blue]-->PUBLISH_TOPIC : [[../../provisioningems/ce.dsg.dice.prov.ems.pcf.publishtopic.setmltype.svg Provisioning_AsncFlow_setMLType]]	
                end

		alt error during posting event
			SelfCareService -> SelfCareServiceWSController : throws Exception
			SelfCareServiceWSController -> Client : throws Exception
		end
	end
end
SelfCareService -> SelfCareServiceWSController : CustomerStatus
SelfCareServiceWSController -[#green]> Client : CustomerStatus
end
@enduml
