當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。