public class TeaAgentServer
extends com.tibco.tea.agent.internal.server.BaseTeaAgentServer
TeaAgent
.
Example:
TeaAgentServer server = new TeaAgentServer("HelloWorldAgent", "1.0", "Hellow World Agent", 1234, "/helloworldagent"); server.registerInstance(new HelloWorldAgent()); server.start();If metrics are enabled in the
TeaAgentServer constructor
, metrics such as
uptime, heap memory, non-heap memory etc. would be added for the TeaAgentServer.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SERVER_PORT
Default server port on which the TeaAgentServer would listen for requests.
|
static String |
DEFAULT_SERVLET_CONTEXT_PATH
Default path for the servlet context.
|
Constructor and Description |
---|
TeaAgentServer(String name,
String version,
String agentInfo)
Constructs a TeaAgentServer.
|
TeaAgentServer(String name,
String version,
String agentInfo,
int port)
Constructs a TeaAgentServer.
|
TeaAgentServer(String name,
String version,
String agentInfo,
int port,
String contextPath)
Constructs a TeaAgentServer.
|
TeaAgentServer(String name,
String version,
String agentInfo,
int port,
String contextPath,
boolean enableMetrics)
Constructs a TeaAgentServer
|
TeaAgentServer(String name,
String version,
String agentInfo,
int port,
String contextPath,
boolean enableMetrics,
SSLContext sslContextForHttpServer,
SSLContext sslContextForHttpClient)
Constructs a TeaAgentServer
|
TeaAgentServer(String name,
String version,
String agentInfo,
String hostName,
int port,
String contextPath,
boolean enableMetrics)
Constructs a TeaAgentServer
|
TeaAgentServer(String name,
String version,
String agentInfo,
String hostName,
int port,
String contextPath,
boolean enableMetrics,
SSLContext sslContextForHttpServer,
SSLContext sslContextForHttpClient) |
TeaAgentServer(TeaAgent teaAgent)
Deprecated.
|
TeaAgentServer(TeaAgent teaAgent,
int port)
Deprecated.
|
TeaAgentServer(TeaAgent teaAgent,
int port,
String contextPath)
Deprecated.
|
TeaAgentServer(TeaAgent teaAgent,
int port,
String contextPath,
boolean enableMetrics)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
autoRegisterAgent(String agentName,
String serverURL)
Register an agent with a given agentName with the TEA server running at the given serverURL
|
void |
enableJVMInfo(boolean enable) |
void |
enableMonitor(String key,
int port)
Enable a monitoring thread which would listen on the
port for requests authenticated with the key specified. |
com.tibco.tea.agent.metrics.MetricsRegistry |
getMetricsRegistry()
Returns instance of
MetricsRegistry which can be used for managing metrics |
Map<String,List<com.tibco.tea.agent.internal.RequestDispatcherEntry>> |
getRequestDispatcherEntries() |
void |
init()
Deprecated.
From 1.0, this will be a private method
|
void |
registerAgentAutoRegisterListener(String serverURL)
Override the method in super class by adding the server started check
|
<T> void |
registerInstance(T instance)
Register an object instance of agent extender class.
|
<T> void |
registerInstances(T... instances)
Register multiple object instances of classes created by the agent extender.
|
void |
registerResourceLocation(File resourceLocation)
Register the folder where the various UI resources for customizing the agent are located.
|
void |
setAcceptors(int acceptors) |
void |
setCertAlias(String certAlias) |
void |
setExcludeProtocols(String excludeProtocols) |
void |
setHttpClientCertAlias(String certAlias) |
void |
setHttpClientKeyManagerPassword(String keyManagerPassword) |
void |
setHttpClientKeyStorePassword(String password) |
void |
setHttpClientKeyStorePath(String keyStorePath) |
void |
setHttpClientTrustStorePassword(String trustStorePassword) |
void |
setHttpClientTrustStorePath(String trustStorePath) |
void |
setIdleTimeout(int idleTimeout)
Set the maximum Idle time for a connection, which roughly translates to the Socket.setSoTimeout(int) call.
|
void |
setKeyManagerPassword(String keyManagerPassword) |
void |
setKeyStorePassword(String password) |
void |
setKeyStorePath(String keyStorePath) |
void |
setNeedClientAuth(boolean needClientAuth) |
void |
setSelectors(int selectors) |
void |
setTrustStorePassword(String trustStorePassword) |
void |
setTrustStorePath(String trustStorePath) |
void |
setWantClientAuth(boolean wantClientAuth) |
void |
setWebSocketIdleTimeout(long timeout) |
void |
setWebSocketMaxMessageSize(int size) |
void |
start()
Start the TeaAgentServer
|
void |
stop()
Stop the TeaAgentServer
|
autoRegisterAgent, getPersistence, processRequest, setAgentId, setExposePythonAPI, unregisterAgent
addEventListener, disableIndex, getAgentDispatcher, getNotificationService, getProtocol, registerSolution, registerSolutions, setEventNotificationBatchSize, setEventNotificationInterval, setProtocol, setTibcoHome, unregisterSolution, unregisterSolutions, withDocumentation, withProductExtension
public static final int DEFAULT_SERVER_PORT
public static final String DEFAULT_SERVLET_CONTEXT_PATH
@Deprecated public TeaAgentServer(TeaAgent teaAgent)
DEFAULT_SERVER_PORT
. Path for the
ServletContext would default to DEFAULT_SERVLET_CONTEXT_PATH
. Metrics for the core agent functionality would not be
enabled.teaAgent
- TeaAgent
which would be hosted by the TeaAgentServer@Deprecated public TeaAgentServer(TeaAgent teaAgent, int port)
DEFAULT_SERVLET_CONTEXT_PATH
. Metrics for the
core agent functionality would not be enabled.teaAgent
- TeaAgent
which would be hosted by the TeaAgentServerport
- port at which the TeaAgentServer would listen for requests@Deprecated public TeaAgentServer(TeaAgent teaAgent, int port, String contextPath)
teaAgent
- TeaAgent
which would be hosted by the TeaAgentServerport
- port at which the TeaAgentServer would listen for requestscontextPath
- path for ServletContext@Deprecated public TeaAgentServer(TeaAgent teaAgent, int port, String contextPath, boolean enableMetrics)
teaAgent
- TeaAgent
which would be hosted by the TeaAgentServerport
- port at which the TeaAgentServer would listen for requestscontextPath
- path for ServletContextenableMetrics
- Add metrics for the core agent functionality.public TeaAgentServer(String name, String version, String agentInfo)
DEFAULT_SERVER_PORT
. Path for the
ServletContext would default to DEFAULT_SERVLET_CONTEXT_PATH
. Metrics for the core agent functionality would not be
enabled.public TeaAgentServer(String name, String version, String agentInfo, int port)
DEFAULT_SERVLET_CONTEXT_PATH
. Metrics for the
core agent functionality would not be enabled.port
- port at which the TeaAgentServer would listen for requestspublic TeaAgentServer(String name, String version, String agentInfo, int port, String contextPath)
port
- port at which the TeaAgentServer would listen for requestscontextPath
- path for ServletContextpublic TeaAgentServer(String name, String version, String agentInfo, int port, String contextPath, boolean enableMetrics)
port
- port at which the TeaAgentServer would listen for requestscontextPath
- path for ServletContextenableMetrics
- Add metrics for the core agent functionality.public TeaAgentServer(String name, String version, String agentInfo, int port, String contextPath, boolean enableMetrics, SSLContext sslContextForHttpServer, SSLContext sslContextForHttpClient)
port
- port at which the TeaAgentServer would listen for requestscontextPath
- path for ServletContextenableMetrics
- Add metrics for the core agent functionality.public TeaAgentServer(String name, String version, String agentInfo, String hostName, int port, String contextPath, boolean enableMetrics)
hostName
- host name to bound this server toport
- port at which the TeaAgentServer would listen for requestscontextPath
- path for ServletContextenableMetrics
- Add metrics for the core agent functionality.public TeaAgentServer(String name, String version, String agentInfo, String hostName, int port, String contextPath, boolean enableMetrics, SSLContext sslContextForHttpServer, SSLContext sslContextForHttpClient)
@Deprecated public void init()
init
in class com.tibco.tea.agent.internal.server.BaseTeaAgentServer
public Map<String,List<com.tibco.tea.agent.internal.RequestDispatcherEntry>> getRequestDispatcherEntries()
getRequestDispatcherEntries
in class com.tibco.tea.agent.internal.server.BaseTeaAgentServer
public void enableMonitor(String key, int port)
port
for requests authenticated with the key
specified. This can be used
to stop the underlying jetty server.key
- key for authenticating the requestport
- port where the monitoring thread would listen for requestspublic <T> void registerInstances(T... instances)
TeaOperation
would be added as REST endpoints. To service requests
for these endpoints, method would be invoked on the instances that the user registered.registerInstances
in class com.tibco.tea.agent.internal.BaseTeaAgent
instances
- public <T> void registerInstance(T instance)
TeaOperation
would be added as REST endpoints. To service requests for these endpoints, method would
be invoked on the instance that the user registered.
IllegalStateException would be thrown if the TeaAgent is already initialized.registerInstance
in class com.tibco.tea.agent.internal.BaseTeaAgent
instance
- object instance of agent extender classpublic void registerResourceLocation(File resourceLocation)
registerResourceLocation
in class com.tibco.tea.agent.internal.BaseTeaAgent
resourceLocation
- location of the UI resourcespublic com.tibco.tea.agent.metrics.MetricsRegistry getMetricsRegistry()
MetricsRegistry
which can be used for managing metricsgetMetricsRegistry
in class com.tibco.tea.agent.internal.BaseTeaAgent
public void registerAgentAutoRegisterListener(String serverURL) throws Exception
Exception
public void autoRegisterAgent(String agentName, String serverURL) throws IllegalArgumentException
autoRegisterAgent
in class com.tibco.tea.agent.internal.server.BaseTeaAgentServer
agentName
- agentName for this agentserverURL
- URL of TEA server to register this agent withIllegalArgumentException
public void setAcceptors(int acceptors)
acceptors
- The number of acceptor threads to set.public void setSelectors(int selectors)
acceptors
- The number of selector threads to set.public void setIdleTimeout(int idleTimeout)
idleTimeout
- The maxIdleTime to set.public void setKeyStorePath(String keyStorePath)
setKeyStorePath
in class com.tibco.tea.agent.internal.server.BaseTeaAgentServer
keyStorePath
- The file or URL of the SSL Key store.public void setKeyStorePassword(String password)
setKeyStorePassword
in class com.tibco.tea.agent.internal.server.BaseTeaAgentServer
password
- The password for the key store.public void setCertAlias(String certAlias)
setCertAlias
in class com.tibco.tea.agent.internal.server.BaseTeaAgentServer
certAlias
- Alias of SSL certificate for the connector.public void setKeyManagerPassword(String keyManagerPassword)
setKeyManagerPassword
in class com.tibco.tea.agent.internal.server.BaseTeaAgentServer
keyManagerPassword
- The password (if any) for the specific key within the key store.public void setTrustStorePath(String trustStorePath)
setTrustStorePath
in class com.tibco.tea.agent.internal.server.BaseTeaAgentServer
trustStorePath
- The file name or URL of the trust store location.public void setTrustStorePassword(String trustStorePassword)
setTrustStorePassword
in class com.tibco.tea.agent.internal.server.BaseTeaAgentServer
trustStorePassword
- The password for the trust store.public void setWantClientAuth(boolean wantClientAuth)
public void setNeedClientAuth(boolean needClientAuth)
public void setExcludeProtocols(String excludeProtocols)
public void setHttpClientKeyStorePath(String keyStorePath)
keyStorePath
- The file or URL of the SSL Key store.public void setHttpClientKeyStorePassword(String password)
password
- The password for the key store.public void setHttpClientCertAlias(String certAlias)
certAlias
- Alias of SSL certificate for the connector.public void setHttpClientKeyManagerPassword(String keyManagerPassword)
keyManagerPassword
- The password (if any) for the specific key within the key store.public void setHttpClientTrustStorePath(String trustStorePath)
trustStorePath
- The file name or URL of the trust store location.public void setHttpClientTrustStorePassword(String trustStorePassword)
trustStorePassword
- The password for the trust store.public void setWebSocketIdleTimeout(long timeout)
public void setWebSocketMaxMessageSize(int size)
public void enableJVMInfo(boolean enable)
Copyright © 2015 Cloud Software Group, Inc.. All Rights Reserved.