Converts the soap model instance into a normal model instance.

@param soapModel the soap model instance to convert
@return the normal model instance
556763
public static CPMeasurementUnit toModel(CPMeasurementUnitSoap soapModel) {
		if (soapModel == null) {
			return null;
		}

		CPMeasurementUnit model = new CPMeasurementUnitImpl();

		model.setUuid(soapModel.getUuid());
		model.setCPMeasurementUnitId(soapModel.getCPMeasurementUnitId());
		model.setGroupId(soapModel.getGroupId());
		model.setCompanyId(soapModel.getCompanyId());
		model.setUserId(soapModel.getUserId());
		model.setUserName(soapModel.getUserName());
		model.setCreateDate(soapModel.getCreateDate());
		model.setModifiedDate(soapModel.getModifiedDate());
		model.setName(soapModel.getName());
		model.setKey(soapModel.getKey());
		model.setRate(soapModel.getRate());
		model.setPrimary(soapModel.isPrimary());
		model.setPriority(soapModel.getPriority());
		model.setType(soapModel.getType());
		model.setLastPublishDate(soapModel.getLastPublishDate());

		return model;
	}
479632
@Override
    public ModelService getModelService(String serviceName){
        ModelServiceClientCache cache = getCache().get(serviceName);
        ModelService lookup;
        if (cache == null) {
            // cache has not never been created, initialize an new one.
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("service has not been cached, try to cache the service {} ", serviceName);
            }
            lookup = super.getModelService(serviceName);
            if (lookup!=null) {
                getCache().putIfAbsent(serviceName, new ModelServiceClientCache(lookup));
                cache = getCache().get(serviceName);
                addInstanceChangeListener(serviceName, cache);
            }
        } else {
            // service cached has been removed
            if (cache.getData() == null) {
                if (LOGGER.isDebugEnabled()) {
                    LOGGER.debug("cached service={} is obsoleted, try to get service from server", serviceName);
                }
                lookup = super.getModelService(serviceName);
                if (lookup != null) {
                    // replace old cached service by new one
                    if (LOGGER.isDebugEnabled()) {
                        LOGGER.debug("try to replace the obsoleted cached service={} by service from server {}", serviceName,lookup.getServiceInstances());
                    }
                    removeInstanceChangeListener(serviceName, cache);
                    boolean replaced = getCache().replace(serviceName, cache, new ModelServiceClientCache(lookup));
                    if (replaced) {
                        addInstanceChangeListener(serviceName, getCache().get(serviceName));

                    } else {
                        LOGGER.error("fail to replace the obsoleted cached service={}", serviceName);
                    }
                }else{
                    LOGGER.error("fail to lookup service={} from server",serviceName);
                }
            }
            // use the use cached service
            else {
                if (LOGGER.isDebugEnabled()) {
                    LOGGER.debug("service={} has been cached, get service from cache. {}", serviceName,cache.getData().getServiceInstances());
                }
                lookup = cache.getData();
            }
        }
        return lookup;
    }
383751
public static List<CommerceCurrency> toModels(
		CommerceCurrencySoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CommerceCurrency> models = new ArrayList<CommerceCurrency>(soapModels.length);

		for (CommerceCurrencySoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
167932
public static List<CPDefinitionOptionRel> toModels(
		CPDefinitionOptionRelSoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CPDefinitionOptionRel> models = new ArrayList<CPDefinitionOptionRel>(soapModels.length);

		for (CPDefinitionOptionRelSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
720200
public static List<CPDefinitionSpecificationOptionValue> toModels(
		CPDefinitionSpecificationOptionValueSoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CPDefinitionSpecificationOptionValue> models = new ArrayList<CPDefinitionSpecificationOptionValue>(soapModels.length);

		for (CPDefinitionSpecificationOptionValueSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
236570
public static CommerceShippingMethod toModel(
		CommerceShippingMethodSoap soapModel) {
		if (soapModel == null) {
			return null;
		}

		CommerceShippingMethod model = new CommerceShippingMethodImpl();

		model.setCommerceShippingMethodId(soapModel.getCommerceShippingMethodId());
		model.setGroupId(soapModel.getGroupId());
		model.setCompanyId(soapModel.getCompanyId());
		model.setUserId(soapModel.getUserId());
		model.setUserName(soapModel.getUserName());
		model.setCreateDate(soapModel.getCreateDate());
		model.setModifiedDate(soapModel.getModifiedDate());
		model.setName(soapModel.getName());
		model.setDescription(soapModel.getDescription());
		model.setImageId(soapModel.getImageId());
		model.setEngineKey(soapModel.getEngineKey());
		model.setPriority(soapModel.getPriority());
		model.setActive(soapModel.isActive());

		return model;
	}
410792
public static List<CommerceAccountUserRel> toModels(
		CommerceAccountUserRelSoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CommerceAccountUserRel> models = new ArrayList<CommerceAccountUserRel>(soapModels.length);

		for (CommerceAccountUserRelSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
267075
public static List<CommerceAccount> toModels(
		CommerceAccountSoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CommerceAccount> models = new ArrayList<CommerceAccount>(soapModels.length);

		for (CommerceAccountSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
91162
public static List<CPInstance> toModels(CPInstanceSoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CPInstance> models = new ArrayList<CPInstance>(soapModels.length);

		for (CPInstanceSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
1213478
public static CPDefinitionOptionValueRel toModel(
		CPDefinitionOptionValueRelSoap soapModel) {
		if (soapModel == null) {
			return null;
		}

		CPDefinitionOptionValueRel model = new CPDefinitionOptionValueRelImpl();

		model.setUuid(soapModel.getUuid());
		model.setCPDefinitionOptionValueRelId(soapModel.getCPDefinitionOptionValueRelId());
		model.setGroupId(soapModel.getGroupId());
		model.setCompanyId(soapModel.getCompanyId());
		model.setUserId(soapModel.getUserId());
		model.setUserName(soapModel.getUserName());
		model.setCreateDate(soapModel.getCreateDate());
		model.setModifiedDate(soapModel.getModifiedDate());
		model.setCPDefinitionOptionRelId(soapModel.getCPDefinitionOptionRelId());
		model.setName(soapModel.getName());
		model.setPriority(soapModel.getPriority());
		model.setKey(soapModel.getKey());

		return model;
	}
94290
public static List<CommerceCountry> toModels(
		CommerceCountrySoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CommerceCountry> models = new ArrayList<CommerceCountry>(soapModels.length);

		for (CommerceCountrySoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
1038923
public static List<CPOptionCategory> toModels(
		CPOptionCategorySoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CPOptionCategory> models = new ArrayList<CPOptionCategory>(soapModels.length);

		for (CPOptionCategorySoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
515254
public static List<CPDefinitionOptionValueRel> toModels(
		CPDefinitionOptionValueRelSoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CPDefinitionOptionValueRel> models = new ArrayList<CPDefinitionOptionValueRel>(soapModels.length);

		for (CPDefinitionOptionValueRelSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
1299902
public static List<CommerceTaxMethod> toModels(
		CommerceTaxMethodSoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CommerceTaxMethod> models = new ArrayList<CommerceTaxMethod>(soapModels.length);

		for (CommerceTaxMethodSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
414652
public static List<CommercePriceListAccountRel> toModels(
		CommercePriceListAccountRelSoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<CommercePriceListAccountRel> models = new ArrayList<CommercePriceListAccountRel>(soapModels.length);

		for (CommercePriceListAccountRelSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}
727039
public static CommerceAddressRestriction toModel(
		CommerceAddressRestrictionSoap soapModel) {
		if (soapModel == null) {
			return null;
		}

		CommerceAddressRestriction model = new CommerceAddressRestrictionImpl();

		model.setCommerceAddressRestrictionId(soapModel.getCommerceAddressRestrictionId());
		model.setGroupId(soapModel.getGroupId());
		model.setCompanyId(soapModel.getCompanyId());
		model.setUserId(soapModel.getUserId());
		model.setUserName(soapModel.getUserName());
		model.setCreateDate(soapModel.getCreateDate());
		model.setModifiedDate(soapModel.getModifiedDate());
		model.setClassNameId(soapModel.getClassNameId());
		model.setClassPK(soapModel.getClassPK());
		model.setCommerceCountryId(soapModel.getCommerceCountryId());

		return model;
	}
368168
public static CommerceAccount toModel(CommerceAccountSoap soapModel) {
		if (soapModel == null) {
			return null;
		}

		CommerceAccount model = new CommerceAccountImpl();

		model.setExternalReferenceCode(soapModel.getExternalReferenceCode());
		model.setCommerceAccountId(soapModel.getCommerceAccountId());
		model.setCompanyId(soapModel.getCompanyId());
		model.setUserId(soapModel.getUserId());
		model.setUserName(soapModel.getUserName());
		model.setCreateDate(soapModel.getCreateDate());
		model.setModifiedDate(soapModel.getModifiedDate());
		model.setParentCommerceAccountId(soapModel.getParentCommerceAccountId());
		model.setName(soapModel.getName());
		model.setLogoId(soapModel.getLogoId());
		model.setEmail(soapModel.getEmail());
		model.setTaxId(soapModel.getTaxId());
		model.setType(soapModel.getType());
		model.setActive(soapModel.isActive());
		model.setDisplayDate(soapModel.getDisplayDate());
		model.setExpirationDate(soapModel.getExpirationDate());
		model.setLastPublishDate(soapModel.getLastPublishDate());
		model.setStatus(soapModel.getStatus());
		model.setStatusByUserId(soapModel.getStatusByUserId());
		model.setStatusByUserName(soapModel.getStatusByUserName());
		model.setStatusDate(soapModel.getStatusDate());

		return model;
	}