Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ProcessManagement.CommonScripts.TUK.HLR_Subscription;
- import com.comarch.oss.sf.model.api.IOrderItem ;
- import com.comarch.oss.sf.model.api.order.IOrderItemExt;
- import com.comarch.oss.sf.model.ServiceState;
- log.debug "############################";
- log.debug "ENTERED mtas_binding"
- foi = binder.getOrderItem();
- Map<String, String> attr = foi.getService().getProductSpecCharacteristic();
- String useCase = foi.getOrder().getOrderAdditionalParameter().get("useCase");
- Map<String, String> orderItemAdditionalParameter = foi.getOrderItemAdditionalParameter();
- excludedOIAsyncUseCaseList = ["CREATE_LDAP_ENTRY_ASYNC", "UPDATE_LDAP_ENTRY_ASYNC"];
- String oIAsyncUseCase = foi.getOrderItemAdditionalParameter().get("oIAsyncUseCase")
- def imsSubOrderItem = foi.getService().getProductSpecCharacteristic();
- String actionType = foi.getAction();
- def mapAttr = [
- "service-profile-identity" :""];
- String VOLTE_ORIGINATING_SYSTEM = "VOLTE";
- def isVolte = { IOrderItemExt oi ->
- return oi.getOrder().getSystemUser().getOriginatingSystem().equals(VOLTE_ORIGINATING_SYSTEM)};
- if (isVolte(foi) ) {
- log.debug "Binding mtas script for VoLTE STARTED";
- if(actionType.equals("PROVISION")){
- if(!attr.get("profile").equals(null)&&!attr.get("profile").equals(" ")&&!attr.get("profile").equals("")){
- int profile = attr.get("profile").toInteger();
- if(profile>=30 && profile<=36){
- def bindEntry = binder.createBinder();
- bindEntry.bindCharacteristic("service-profile-identity", "sip:profile"+attr.get("profile")+"@o2.co.uk");
- }
- }
- log.debug "Binding mtas PROVISION FINISHED";
- } else if (actionType.equals("MODIFY") && !excludedOIAsyncUseCaseList.contains(oIAsyncUseCase) && !"SET:LDAPSUB".equals(useCase)){
- Map<String, String> attrOrgin = foi.getService().getOrigin().getProductSpecCharacteristic();
- if (useCase.equals("SET")){
- def rootService = foi.getService();
- def type = rootService.getProductSpecCharacteristic().get("subscription-type");
- if(!attr.get("profile").equals(null)&&!attr.get("profile").equals(" ")&&!attr.get("profile").equals("")){
- int prof = attr.get("profile").toInteger();
- if(prof<30 || prof>36){
- if(binder.getBindingService()!=null){
- if(binder.getBindingService().getState() != ServiceState.RESERVED ) {
- def bindEntry = binder.createBinder();
- bindEntry.bindOrderItemAttribute("Action","reserve");
- def rfsAttr = binder.getBindingService().getProductSpecCharacteristic();
- rfsAttr.each{
- bindEntry.bindCharacteristic(it.key, it.value);
- }
- }
- }
- }
- if( !attrOrgin.get("profile").equals(attr.get("profile")) && !attr.get("profile")?.trim().equals("") || binder.getBindingService().getState() == ServiceState.RESERVED ){
- def profOrginProfile = attrOrgin.get("profile");
- if(prof>=30 && prof<=36){
- def bindEntry = binder.createBinder();
- if (binder.getBindingService() == null || binder.getBindingService().getState() == ServiceState.RESERVED){
- bindEntry.bindOrderItemAttribute("Action","provision");
- } else if (profOrginProfile!=null){
- if(profOrginProfile.toInteger()<30||profOrginProfile.toInteger()>36){
- bindEntry.bindOrderItemAttribute("Action","provision");
- }
- }
- bindEntry.bindCharacteristic("service-profile-identity", "sip:profile"+attr.get("profile")+"@o2.co.uk");
- }
- }
- }
- }
- if( useCase.equals("DOWNGRADE3G") || useCase.equals("DOWNGRADE4G")) {
- if (binder.getBindingService() != null){
- def bindEntry = binder.createBinder();
- bindEntry.bindOrderItemAttribute("Action","reserve");
- mapAttr.each{
- bindEntry.bindCharacteristic(it.key, "");
- }
- }
- }
- if((useCase.equals("UPGRADE3G") || useCase.equals("UPGRADE4G"))&&(orderItemAdditionalParameter.containsKey("profile"))) {
- if(!orderItemAdditionalParameter.get("profile").equals("")){
- int profile = orderItemAdditionalParameter.get("profile").toInteger();
- if(profile>=30 && profile<=36){
- def bindEntry = binder.createBinder();
- bindEntry.bindOrderItemAttribute("Action","provision");
- bindEntry.bindCharacteristic("service-profile-identity", "sip:profile"+attr.get("profile")+"@o2.co.uk");
- }
- }
- }
- log.debug "Binding mtas MODIFY FINISHED";
- } else if (actionType.equals("TERMINATE")){
- if (binder.getBindingService() != null){
- def bindEntry = binder.createBinder();
- }
- log.debug "Binding mtas TERMIANATE FINISHED";
- }else {
- log.debug "Binding mtas UNDONE";
- }
- log.debug "############################";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement