public class EndecaServerConfigUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ES_DATASET_NAME_PREFIX |
static java.lang.String |
ES_DATASET_PROJECTS_DELETE_ON_NO_PROJECTS |
static java.lang.String |
ES_DATASET_PROJECTS_PREFIX |
static java.lang.String |
ES_HEALTH_CHECK_TIMEOUT |
static java.lang.String |
ES_INGEST_WS_TIMEOUT |
static java.lang.String |
ES_NAMESPACE_PREFIX |
static java.lang.String |
ES_WS_TIMEOUT |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
determineEndecaServerExternalHostName()
Tries to determine an externally-resolvable, non-"localhost" hostname for this Studio host.
|
static long |
getActualProjectId(java.lang.String namespacedProjectId)
Converts namespaced project id to actual project id.
|
static java.lang.String |
getContextPath() |
static java.lang.String |
getExternalServer()
Returns the Endeca Server hostname to be used when passing configuration to external components, such as DP.
|
static int |
getHealthCheckTimeout() |
static int |
getIngestWsTimeout() |
static java.lang.String |
getPort() |
static java.lang.String |
getProjectNamespace(long projectId)
Creates a namespace string by concatenating the optional namespace prefix + _ + project Id.
|
static java.lang.String |
getProjectNamespace(javax.portlet.PortletRequest request)
Creates a namespace string based on the current project.
|
static java.lang.String |
getServer()
Returns the Endeca Server hostname to be used for direct Web Service calls.
|
static SSLConfig |
getSSLConfig() |
static int |
getWsTimeout() |
static boolean |
isDeleteOnNoProjects() |
protected static boolean |
isLocalhost(java.lang.String hostName) |
protected static boolean |
isLoopbackOrLocalhost(java.net.InetAddress addr) |
static boolean |
isProjectMatchesCurrentNamespace(java.lang.String namespacedProjectId)
Check if this project belongs to the current environment.
|
static boolean |
isSSLEnabled() |
static MDEXState |
newMdexState(long groupId,
javax.portlet.PortletRequest request)
Creates a new MDEXState object for the lone Endeca Server
|
static MDEXState |
newMdexState(javax.portlet.PortletRequest request)
Creates a new MDEXState object for the lone Endeca Server
|
static MDEXState |
newMdexState(java.lang.String[] boundDatasets,
javax.portlet.PortletRequest request)
Creates a new MDEXState object for the lone Dgraph
|
public static final java.lang.String ES_DATASET_PROJECTS_PREFIX
public static final java.lang.String ES_DATASET_PROJECTS_DELETE_ON_NO_PROJECTS
public static final java.lang.String ES_DATASET_NAME_PREFIX
public static final java.lang.String ES_NAMESPACE_PREFIX
public static final java.lang.String ES_WS_TIMEOUT
public static final java.lang.String ES_INGEST_WS_TIMEOUT
public static final java.lang.String ES_HEALTH_CHECK_TIMEOUT
public static java.lang.String getServer()
public static java.lang.String getExternalServer()
getServer()
public static java.lang.String getPort()
public static java.lang.String getContextPath()
public static SSLConfig getSSLConfig()
public static boolean isSSLEnabled()
public static int getWsTimeout()
public static int getIngestWsTimeout()
public static int getHealthCheckTimeout()
public static boolean isDeleteOnNoProjects()
public static MDEXState newMdexState(java.lang.String[] boundDatasets, javax.portlet.PortletRequest request)
groupId
- project Id for which to create an associated MDEXStaterequest
- current contextual requestpublic static MDEXState newMdexState(long groupId, javax.portlet.PortletRequest request)
groupId
- project Id for which to create an associated MDEXStaterequest
- current contextual requestpublic static MDEXState newMdexState(javax.portlet.PortletRequest request)
request
- current contextual request (provides current group Id to use for new MDEXState)public static java.lang.String getProjectNamespace(javax.portlet.PortletRequest request)
request
- Portlet request from within the context of a Studio project.getProjectNamespace(long)
public static java.lang.String getProjectNamespace(long projectId)
projectId
- explicit projectId to use when forming the namespace string.public static boolean isProjectMatchesCurrentNamespace(java.lang.String namespacedProjectId)
namespacedProjectId
- public static long getActualProjectId(java.lang.String namespacedProjectId)
namespacedProjectId
- public static java.lang.String determineEndecaServerExternalHostName()
Note that this method intentionally avoids reading anything about the HTTP host of the inbound request, which might have been put through a reverse-proxy, or be an otherwise-unsuitable user-facing hostname. Here we want the "internal" hostname, to provide to DP.
This hostname might not always be possible to guess, or guess well, since Studio might be on a multi-homed machine, in which case endeca.server.host should be set in configuration to avoid ambiguity or "localhost".
This method takes this approach:
InetAddress.getLocalHost()
. If that address is not localhost and does not represent the
local loopback interface, its hostname is returned.protected static boolean isLoopbackOrLocalhost(java.net.InetAddress addr)
protected static boolean isLocalhost(java.lang.String hostName)
Copyright 2003, 2014, Oracle and/or its affiliates. All rights reserved.