• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ConnectivityConfiguration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sap.core.connectivity.api.configuration.ConnectivityConfiguration的典型用法代码示例。如果您正苦于以下问题:Java ConnectivityConfiguration类的具体用法?Java ConnectivityConfiguration怎么用?Java ConnectivityConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ConnectivityConfiguration类属于com.sap.core.connectivity.api.configuration包,在下文中一共展示了ConnectivityConfiguration类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: retrieveConnectivityConfiguration

import com.sap.core.connectivity.api.configuration.ConnectivityConfiguration; //导入依赖的package包/类
/**
 * Initializes and returns singleton ConnectivityConfiguration.
 * 
 * @return singleton ConnectivityConfiguration.
 */
public static ConnectivityConfiguration retrieveConnectivityConfiguration() {
	if (ConnectivityConfigurationProvider.connectivityConfiguration == null) {
		synchronized (ConnectivityConfigurationProvider.class) {
			if (ConnectivityConfigurationProvider.connectivityConfiguration == null) {
				ConnectivityConfigurationProvider.connectivityConfiguration = initConnectivityConfiguration();
			}
		}
	}

	return ConnectivityConfigurationProvider.connectivityConfiguration;
}
 
开发者ID:SAP,项目名称:cloud-ariba-partner-flow-extension-ext,代码行数:17,代码来源:ConnectivityConfigurationProvider.java


示例2: lookupDestinationConfiguration

import com.sap.core.connectivity.api.configuration.ConnectivityConfiguration; //导入依赖的package包/类
private DestinationConfiguration lookupDestinationConfiguration() throws IOException {
	ConnectivityConfiguration connectivityConfiguration = lookupConnectivityConfiguration();

	DestinationConfiguration destinationConfiguration = connectivityConfiguration.getConfiguration(destinationName);
	if (destinationConfiguration == null) {
		String errorMessage = MessageFormat.format(ERROR_DESTINATION_NOT_FOUND, destinationName);
		LOGGER.error(errorMessage);
		throw new IOException(errorMessage);
	}
	return destinationConfiguration;
}
 
开发者ID:SAP,项目名称:cloud-c4c-ticket-duplicate-finder-ext,代码行数:12,代码来源:HTTPConnector.java


示例3: lookupConnectivityConfiguration

import com.sap.core.connectivity.api.configuration.ConnectivityConfiguration; //导入依赖的package包/类
private synchronized ConnectivityConfiguration lookupConnectivityConfiguration() throws IOException {
	try {
		if (this.localConnectivityConfiguration == null) {
			Context ctx = new InitialContext();
			this.localConnectivityConfiguration = (ConnectivityConfiguration) ctx.lookup(CONNECTIVITY_CONFIGURATION_LOOKUP_NAME);
		}
		return this.localConnectivityConfiguration;
	} catch (NamingException e) {
		throw new IOException(e.getMessage(), e);
	}
}
 
开发者ID:SAP,项目名称:cloud-c4c-ticket-duplicate-finder-ext,代码行数:12,代码来源:HTTPConnector.java


示例4: getDestConfiguration

import com.sap.core.connectivity.api.configuration.ConnectivityConfiguration; //导入依赖的package包/类
private DestinationConfiguration getDestConfiguration() throws NamingException {
	// Look up the connectivity configuration API
	javax.naming.Context ctx = new InitialContext();
	ConnectivityConfiguration configuration = (ConnectivityConfiguration) ctx
			.lookup("java:comp/env/connectivityConfiguration");
	// Get destination configuration for "destinationName"
	DestinationConfiguration destConfiguration = configuration.getConfiguration("onprem-plantdata-dest");
	return destConfiguration;
}
 
开发者ID:AnujMehta07,项目名称:cloud-pollutionmonitoringapp,代码行数:10,代码来源:PlantDataService.java


示例5: init

import com.sap.core.connectivity.api.configuration.ConnectivityConfiguration; //导入依赖的package包/类
@Override
public void init() throws ServletException {
	// Look up the connectivity configuration API
	try {
		Context ctx = new InitialContext();
		configuration = (ConnectivityConfiguration) ctx.lookup(CONNECTIVITY_CONFIGURATION);
	} catch (NamingException e) {
		LOGGER.error("Could not lookup Connectivity Configuration [ {} ] ", CONNECTIVITY_CONFIGURATION, e);
		throw new UnavailableException("Could not lookup Connectivity Configuration. See logs for details.");
	}

	if (configuration == null) {
		throw new UnavailableException("Looking up Conenctivity Configuration returned null.");
	}
}
 
开发者ID:SAP,项目名称:cloud-concur-expenses-ext,代码行数:16,代码来源:ExpensesServlet.java


示例6: prepareCompanyPollutionData

import com.sap.core.connectivity.api.configuration.ConnectivityConfiguration; //导入依赖的package包/类
private CompanyPollutionData prepareCompanyPollutionData(List<Plant> mfPlantList, HttpServletResponse response)
		throws Exception {
	HttpsURLConnection urlConnection = null;
	CompanyPollutionData companyPollutionData = new CompanyPollutionData();
	List<PlantPollutionDayData> plantPollutionDayDataList = new ArrayList<PlantPollutionDayData>();
	// Look up the connectivity configuration API
	javax.naming.Context ctx = new InitialContext();
	ConnectivityConfiguration configuration = (ConnectivityConfiguration) ctx
			.lookup("java:comp/env/connectivityConfiguration");
	// Get destination configuration for "destinationName"
	DestinationConfiguration destConfiguration = configuration.getConfiguration("openaq-api-dest");
	SSLSocketFactory socketFactory = null;
	// Get the destination URL
	String value = destConfiguration.getProperty("URL");
	URL baseUrl = new URL(value);
	socketFactory = establishedSSLConnection(response, baseUrl.getHost(), 443);
	for (Iterator<Plant> iterator = mfPlantList.iterator(); iterator.hasNext();) {
		Plant ogPlant = (Plant) iterator.next();
		final String destinationUrl = value + "?parameter=o3&location=" + ogPlant.getLocation() + "&date_from="
				+ ogPlant.getDateField() + "&date_to=" + ogPlant.getDateField();
		URL url = new URL(destinationUrl.replaceAll(" ", "%20"));
		urlConnection = (HttpsURLConnection) url.openConnection();
		urlConnection.setSSLSocketFactory(socketFactory);
		// Copy content from the incoming response to the outgoing response
		InputStream instream = urlConnection.getInputStream();
		String msgBody = getResponseBodyasJSONArray(instream);
		JSONObject cityO3 = new JSONObject(msgBody);
		PlantPollutionDayData plantPollutionDayData = new PlantPollutionDayData();
		plantPollutionDayData.setPlant(ogPlant);
		JSONArray jsonArray = cityO3.getJSONArray("results");
		if (!jsonArray.isNull(0) && jsonArray.get(0) != null) {
			JSONObject jsonObject = (JSONObject) jsonArray.get(0);
			if (jsonObject != null) {
				Double o3value = (Double) jsonObject.get("value");
				plantPollutionDayData.setCityOzoneLevel(o3value.toString());
			}
		} else {
			// Value is not available
			plantPollutionDayData.setCityOzoneLevel(" ");
		}
		plantPollutionDayDataList.add(plantPollutionDayData);
	}
	int size = plantPollutionDayDataList.size();
	int i = 0;
	int j = 5;
	int k = 0;
	while (size > 0) {
		companyPollutionData.getPlantsPollutionWeeklyData().put(Integer.toString(k),
				plantPollutionDayDataList.subList(i, j));
		i = i + 5;
		j = j + 5;
		size = size - 5;
		k++;
	}
	return companyPollutionData;
}
 
开发者ID:AnujMehta07,项目名称:cloud-pollutionmonitoringapp,代码行数:57,代码来源:PollutionDataService.java


示例7: getDestinationProperties

import com.sap.core.connectivity.api.configuration.ConnectivityConfiguration; //导入依赖的package包/类
/**
 * Connects to the destination by name and returns its configuration
 * properties
 * 
 * @param destinationName
 *            the destination name
 * @return map of all properties for the given destination
 */
public static Map<String, String> getDestinationProperties(String destinationName) {

	DestinationConfiguration destinationConfiguration = null;

	try {

		Context context = new InitialContext();
		ConnectivityConfiguration configuration = (ConnectivityConfiguration) context
				.lookup(CONNECTIVITY_CONFIGURATION);
		destinationConfiguration = configuration.getConfiguration(destinationName);

	} catch (NamingException e) {

		String message = MessageFormatter
				.format(ERROR_UNABLE_TO_CONNECT_TO_CONNECTIVITY_SERVICE_MESSAGE, destinationName).getMessage();
		LOGGER.error(message, e);
	}

	return destinationConfiguration.getAllProperties();

}
 
开发者ID:svilenkomitov,项目名称:Food-Calculator,代码行数:30,代码来源:HTTPUtils.java


示例8: geConnectivityConfiguration

import com.sap.core.connectivity.api.configuration.ConnectivityConfiguration; //导入依赖的package包/类
/**
 * Returns connectivity configuration object from JNDI context
 */
protected ConnectivityConfiguration geConnectivityConfiguration()
throws IOException {
	return getResource("connectivityConfiguration");
}
 
开发者ID:SAP,项目名称:iot-starterkit,代码行数:8,代码来源:AbstractDispatcherServlet.java



注:本文中的com.sap.core.connectivity.api.configuration.ConnectivityConfiguration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JXMapKit类代码示例发布时间:2022-05-22
下一篇:
Java Find类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap