public class NutchServer
extends javax.ws.rs.core.Application
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NUTCH_SERVER |
Constructor and Description |
---|
NutchServer()
Public constructor which accepts the port we wish to run the server on as
well as the logging granularity.
|
NutchServer(RAMConfManager ramConfManager)
Public constructor which accepts
RAMConfManager RAM configuration manager and the port we wish to run the server on as
well as the logging granularity. |
NutchServer(RAMConfManager ramConfManager,
java.lang.String confId)
Public constructor which accepts
RAMConfManager RAM configuration manager, a configuration id to use from
RAM configuration manager and the port we wish to run the server on as
well as the logging granularity. |
Modifier and Type | Method and Description |
---|---|
boolean |
canStop(boolean force)
Safety and convenience method to determine whether or not it is safe to
shut down the server.
|
java.lang.String |
getActiveConfId()
Get id of active configuration.
|
java.util.Set<java.lang.Class<?>> |
getClasses()
Get a set of root resource and provider classes.
|
ConfManager |
getConfMgr()
Get configuration manager.
|
JobManager |
getJobMgr()
Get job manager.
|
long |
getStarted() |
boolean |
isRunning()
Convenience method to determine whether a Nutch server is running.
|
static void |
main(java.lang.String[] args)
Main method for NutchServer to run via command line.
|
void |
start()
Starts the Nutch server printing some logging to the log file.
|
boolean |
stop(boolean force)
Stop the Nutch server.
|
public static final java.lang.String NUTCH_SERVER
public NutchServer()
main(String[])
then it defaults to
'INFO' however best attempts should always be made to specify a logging
level.<br>
NutchServer
can be run as secure. restapi.auth property
should be set to BASIC, DIGEST or SSL at nutch-site.xml
to enable HTTP basic authentication,
digest authentication or SSL when communicating with RESTAPI.
Set restapi.auth.username and restapi.auth.password properties at nutch-site.xml
to configure
credentials when BASIC or DIGEST authentication is used.
Set restapi.auth.ssl.storepath, restapi.auth.ssl.storepass and restapi.auth.ssl.keypass when SSL is used.AuthenticationTypeEnum
public NutchServer(RAMConfManager ramConfManager)
RAMConfManager
RAM configuration manager and the port we wish to run the server on as
well as the logging granularity. If the latter option is not provided via
main(String[])
then it defaults to
'INFO' however best attempts should always be made to specify a logging
level.<br>
NutchServer
can be run as secure. restapi.auth property
should be set to BASIC, DIGEST or SSL at nutch-site.xml
to enable HTTP basic authentication,
digest authentication or SSL when communicating with RESTAPI.
Set restapi.auth.username and restapi.auth.password properties at nutch-site.xml
to configure
credentials when BASIC or DIGEST authentication is used.
Set restapi.auth.ssl.storepath, restapi.auth.ssl.storepass and restapi.auth.ssl.keypass when SSL is used.ramConfManager
- RAMConfManager
AuthenticationTypeEnum
public NutchServer(RAMConfManager ramConfManager, java.lang.String confId)
RAMConfManager
RAM configuration manager, a configuration id to use from
RAM configuration manager and the port we wish to run the server on as
well as the logging granularity. If the latter option is not provided via
main(String[])
then it defaults to
'INFO' however best attempts should always be made to specify a logging
level.<br>
NutchServer
can be run as secure. restapi.auth property
should be set to BASIC, DIGEST or SSL at nutch-site.xml
to enable HTTP basic authentication,
digest authentication or SSL when communicating with RESTAPI.
Set restapi.auth.username and restapi.auth.password properties at nutch-site.xml
to configure
credentials when BASIC or DIGEST authentication is used.
Set restapi.auth.ssl.storepath, restapi.auth.ssl.storepass and restapi.auth.ssl.keypass when SSL is used.ramConfManager
- RAMConfManager
confId
- active configuration idAuthenticationTypeEnum
public java.util.Set<java.lang.Class<?>> getClasses()
getClasses
in class javax.ws.rs.core.Application
public ConfManager getConfMgr()
public JobManager getJobMgr()
public java.lang.String getActiveConfId()
public long getStarted()
public boolean isRunning()
public void start()
public boolean canStop(boolean force)
getJobMgr()
for a list of jobs with
JobInfo.state
equal to
'RUNNING'.force
- ignore running taskspublic boolean stop(boolean force)
force
- boolean method to effectively kill jobs regardless of state.public static void main(java.lang.String[] args) throws java.lang.Exception
args
- arguments for log level, stopping the Server and port.java.lang.Exception
- exceptionCopyright © 2019 The Apache Software Foundation