当前位置: 首页>>代码示例>>Java>>正文


Java OServerNetworkListener类代码示例

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


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

示例1: analyzeServerConfig

import com.orientechnologies.orient.server.network.OServerNetworkListener; //导入依赖的package包/类
/**
 * Analyze started server ports.
 *
 * @param server started orient server
 * @return selected main http listener or null if nothing configured
 */
private OServerNetworkListener analyzeServerConfig(final OServer server) {
    OServerNetworkListener httpListener = null;
    for (OServerNetworkListener listener : server.getNetworkListeners()) {
        final int port = listener.getInboundAddr().getPort();
        final boolean secured = OrientConfigUtils.isSslEnabledOnPort(conf.getConfig(), port);
        if (ONetworkProtocolHttpAbstract.class.isAssignableFrom(listener.getProtocolType())) {
            serverInfo.httpPorts.put(String.valueOf(port), secured);
            if (serverInfo.httpPort == null || secured) {
                serverInfo.httpPort = String.valueOf(port);
                serverInfo.httpSecured = secured;
                httpListener = listener;
            }
        } else {
            serverInfo.binaryPorts.put(String.valueOf(port), secured);
        }
    }
    return httpListener;
}
 
开发者ID:xvik,项目名称:dropwizard-orient-server,代码行数:25,代码来源:EmbeddedOrientServer.java

示例2: startup

import com.orientechnologies.orient.server.network.OServerNetworkListener; //导入依赖的package包/类
@Override
public void startup() {
  if (!enabled)
    return;

  Orient.instance().addDbLifecycleListener(this);

  final OServerNetworkListener listener = server.getListenerByProtocol(ONetworkProtocolHttpAbstract.class);
  if (listener == null)
    throw new OConfigurationException("HTTP listener not found");

  listener.registerStatelessCommand(new OServerCommandESSync(this));
}
 
开发者ID:orientechnologies,项目名称:orientdb-elasticsearch,代码行数:14,代码来源:OElasticSearchPlugin.java

示例3: resolveOrientDBRestApiUrl

import com.orientechnologies.orient.server.network.OServerNetworkListener; //导入依赖的package包/类
/**
 * Resolve OrientDB REST API URL to be used for OrientDb REST bridge
 * @return OrientDB REST API URL
 */
public String resolveOrientDBRestApiUrl()
{
	OrientDbWebApplication app = OrientDbWebApplication.get();
	OServer server = app.getServer();
	if(server!=null)
	{
		OServerNetworkListener http = server.getListenerByProtocol(ONetworkProtocolHttpAbstract.class);
		if(http!=null)
		{
			return "http://"+http.getListeningAddress(true);
		}
	}
	return null;
}
 
开发者ID:OrienteerBAP,项目名称:wicket-orientdb,代码行数:19,代码来源:OrientDbSettings.java

示例4: installStudio

import com.orientechnologies.orient.server.network.OServerNetworkListener; //导入依赖的package包/类
/**
 * 2 http ports could be registered. One listener will be selected as main to redirect studio.
 * This will be either https or the first http listener.
 *
 * @param listener http listener to install studio on
 * @throws Exception on installation errors
 */
private void installStudio(final OServerNetworkListener listener) throws Exception {
    if (listener != null) {
        final OServerCommandGetStaticContent command = (OServerCommandGetStaticContent) listener
                .getCommand(OServerCommandGetStaticContent.class);
        if (command != null) {
            serverInfo.studioInstalled = new OrientStudioInstaller(command).install();
            listener.registerStatelessCommand(new ApiRedirectCommand());
        }
    }
}
 
开发者ID:xvik,项目名称:dropwizard-orient-server,代码行数:18,代码来源:EmbeddedOrientServer.java

示例5: findListenerByPort

import com.orientechnologies.orient.server.network.OServerNetworkListener; //导入依赖的package包/类
/**
 * @param network network configuration object
 * @param port    port to search by
 * @return listener handling provided port, otherwise exception is thrown
 */
public static OServerNetworkListenerConfiguration findListenerByPort(
        final OServerNetworkConfiguration network, final int port) {
    return network.listeners.stream()
            .filter(l -> {
                for (int rPort : OServerNetworkListener.getPorts(l.portRange)) {
                    if (rPort == port) {
                        return true;
                    }
                }
                return false;
            }).collect(onlyElement());
}
 
开发者ID:xvik,项目名称:dropwizard-orient-server,代码行数:18,代码来源:OrientConfigUtils.java


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