public class ApiSparkService extends Service
loadConfiguration()
method.Modifier and Type | Field and Description |
---|---|
static String |
CONFIGURATION_FILE_SYSTEM_PROPERTY_KEY
The system property key for agent configuration file.
|
static String |
DEFAULT_AGENT_SERVICE_URL
The URL of the remote service used by default.
|
protected static Logger |
LOGGER
Internal logger.
|
Constructor and Description |
---|
ApiSparkService()
Default constructor.
|
ApiSparkService(String agentLogin,
char[] agentPassword,
Integer agentCellId,
Integer agentCellVersion,
boolean reverseProxyEnabled,
String reverseProxyTargetUrl)
Constructor using the default APISpark service url.
|
ApiSparkService(String agentServiceUrl,
String agentLogin,
char[] agentPassword,
Integer agentCellId,
Integer agentCellVersion,
boolean reverseProxyEnabled,
String reverseProxyTargetUrl)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Filter |
createInboundFilter(Context context) |
Filter |
createOutboundFilter(Context context) |
int |
getAgentAnalyticsBufferSize()
Returns the agent Analytics module buffer size.
|
long |
getAgentAnalyticsPostPeriodInSecond()
Returns the agent Analytics module post period.
|
Integer |
getAgentCellId()
Returns the identifier of the cell configured on the APISpark platform
for your application.
|
Integer |
getAgentCellVersion()
Returns the identifier of the cell version configured on the APISpark
platform for your application.
|
String |
getAgentLogin()
Returns the login used to connect to the APISpark platform.
|
String |
getAgentPassword()
Returns the password used to connect to the APISpark platform.
|
long |
getAgentRefreshPeriodInSecond()
Returns the agent refresh period in seconds
|
String |
getAgentServiceUrl()
Returns the url of the APISpark service.
|
FirewallConfig |
getFirewallConfig() |
String |
getReverseProxyTargetUrl()
Returns the redirection URL.
|
boolean |
isAgentEnabled()
Indicates if the APISpark agent is enabled.
|
boolean |
isFirewallEnabled()
Indicates if the firewall is enabled.
|
boolean |
isReverseProxyEnabled()
Indicates if the request redirection is enabled.
|
void |
loadConfiguration()
Load the agent configuration from the file set by the system property
'apiSparkServiceConfig'.
|
void |
loadConfiguration(File configurationFile)
Load the agent configuration from the file.
|
void |
loadConfiguration(InputStream inputStream)
Load the agent configuration from the input stream.
|
void |
setAgentAnalyticsBufferSize(int agentAnalyticsBufferSize)
Sets the agent Analytics module buffer size.
|
void |
setAgentAnalyticsPostPeriodInSecond(long agentAnalyticsPostPeriodInSecond)
Sets the agent Analytics module post period.
|
void |
setAgentCellId(Integer agentCellId)
Sets the identifier of the cell configured on the APISpark platform for
your application.
|
void |
setAgentCellVersion(Integer agentCellVersion)
Sets the identifier of the cell version configured on the APISpark
platform for your application.
|
void |
setAgentEnabled(boolean agentEnabled)
Indicates if the APISpark agent is enabled.
|
void |
setAgentLogin(String agentLogin)
Sets the login used to connect to the APISpark platform.
|
void |
setAgentPassword(String agentPassword)
Sets the password used to connect to the APISpark platform.
|
void |
setAgentRefreshPeriodInSecond(long agentRefreshPeriodInSecond)
Sets the agent refresh period
|
void |
setAgentServiceUrl(String agentServiceUrl)
Sets the url of the APISpark agent service.
|
void |
setFirewallEnabled(boolean firewallEnabled)
Indicates if the firewall is enabled.
|
void |
setReverseProxyEnabled(boolean reverseProxyEnabled)
Indicates if the reverse proxy is enabled.
|
void |
setReverseProxyTargetUrl(String reverseProxyTargetUrl)
Set the target URL of the reverse proxy.
|
void |
stop()
Stops the service and its timer
|
getContext, isEnabled, isStarted, isStopped, setContext, setEnabled, start
protected static Logger LOGGER
public static final String DEFAULT_AGENT_SERVICE_URL
public static final String CONFIGURATION_FILE_SYSTEM_PROPERTY_KEY
public ApiSparkService()
public ApiSparkService(String agentLogin, char[] agentPassword, Integer agentCellId, Integer agentCellVersion, boolean reverseProxyEnabled, String reverseProxyTargetUrl)
agentLogin
- The login used to connect to the APISpark platform.agentPassword
- The password used to connect to the APISpark platform.agentCellId
- The identifier of the cell configured on the APISpark platform
for your application.agentCellVersion
- The identifier of the cell version configured on the APISpark
platform for your application.reverseProxyEnabled
- Indicates if the request redirection is enabled.reverseProxyTargetUrl
- The redirection URL.public ApiSparkService(String agentServiceUrl, String agentLogin, char[] agentPassword, Integer agentCellId, Integer agentCellVersion, boolean reverseProxyEnabled, String reverseProxyTargetUrl)
agentServiceUrl
- The url of the APISpark service.agentLogin
- The login used to connect to the APISpark platform.agentPassword
- The password used to connect to the APISpark platform.agentCellId
- The identifier of the cell configured on the APISpark platform
for your application.agentCellVersion
- The identifier of the cell version configured on the APISpark
platform for your application.reverseProxyEnabled
- Indicates if the request redirection is enabled.reverseProxyTargetUrl
- The redirection URL.public Filter createInboundFilter(Context context)
createInboundFilter
in class Service
public Filter createOutboundFilter(Context context)
createOutboundFilter
in class Service
public int getAgentAnalyticsBufferSize()
public long getAgentAnalyticsPostPeriodInSecond()
public String getAgentPassword()
public String getAgentServiceUrl()
public long getAgentRefreshPeriodInSecond()
public String getAgentLogin()
public Integer getAgentCellId()
public Integer getAgentCellVersion()
public FirewallConfig getFirewallConfig()
public String getReverseProxyTargetUrl()
isReverseProxyEnabled()
returns true.public boolean isAgentEnabled()
public boolean isFirewallEnabled()
firewallConfig
.public boolean isReverseProxyEnabled()
setReverseProxyTargetUrl(String)
.public void loadConfiguration()
public void loadConfiguration(File configurationFile)
configurationFile
- The configuration file.public void loadConfiguration(InputStream inputStream)
inputStream
- The input stream of the configuration file.public void setAgentAnalyticsBufferSize(int agentAnalyticsBufferSize)
agentAnalyticsBufferSize
- The agent Analytics module buffer size.public void setAgentAnalyticsPostPeriodInSecond(long agentAnalyticsPostPeriodInSecond)
agentAnalyticsPostPeriodInSecond
- The agent Analytics module post period.public void setAgentPassword(String agentPassword)
agentPassword
- The password used to connect to the APISpark platform.public void setAgentServiceUrl(String agentServiceUrl)
agentServiceUrl
- The url of the APISpark agent service.public void setAgentRefreshPeriodInSecond(long agentRefreshPeriodInSecond)
agentRefreshPeriodInSecond
- The agent refresh period in secondspublic void setAgentLogin(String agentLogin)
agentLogin
- The login used to connect to the APISpark platform.public void setAgentCellId(Integer agentCellId)
agentCellId
- The identifier of the cell configured on the APISpark platform
for your application.public void setAgentCellVersion(Integer agentCellVersion)
agentCellVersion
- The version of the cell configured on the APISpark platform
for your application.public void setAgentEnabled(boolean agentEnabled)
agentEnabled
- True if the APISpark agent is enabled.public void setFirewallEnabled(boolean firewallEnabled)
firewallEnabled
- True if the firewall is enabled.public void setReverseProxyEnabled(boolean reverseProxyEnabled)
setReverseProxyTargetUrl(String)
.reverseProxyEnabled
- True if the reverse proxy is enabled.public void setReverseProxyTargetUrl(String reverseProxyTargetUrl)
isReverseProxyEnabled()
is true.reverseProxyTargetUrl
- The target URL.Copyright © 2005-2017 Restlet.