Package org.apache.hop.server
Class HopServer
- java.lang.Object
-
- org.apache.hop.metadata.api.HopMetadataBase
-
- org.apache.hop.server.HopServer
-
- All Implemented Interfaces:
Cloneable,IXml,IHopMetadata
public class HopServer extends HopMetadataBase implements Cloneable, IXml, IHopMetadata
-
-
Field Summary
Fields Modifier and Type Field Description static intHOP_SERVER_RETRIESstatic intHOP_SERVER_RETRY_BACKOFF_INCREMENTSstatic StringSSL_MODE_TAGstatic StringSTRING_HOP_SERVERstatic StringXML_TAG-
Fields inherited from class org.apache.hop.metadata.api.HopMetadataBase
metadataProviderName, name
-
-
Constructor Summary
Constructors Constructor Description HopServer()HopServer(String name, String hostname, String port, String username, String password)HopServer(String name, String hostname, String port, String username, String password, String proxyHostname, String proxyPort, String nonProxyHosts)HopServer(String name, String hostname, String port, String username, String password, String proxyHostname, String proxyPort, String nonProxyHosts, boolean sslMode)HopServer(HopServer server)HopServer(Node node)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HopServerclone()StringconstructUrl(IVariables variables, String serviceAndArguments)booleanequals(Object obj)StringexecService(IVariables variables, String service)StringexecService(IVariables variables, String service, boolean retry)StringexecService(IVariables variables, String service, Map<String,String> headerValues)static HopServerfindHopServer(List<HopServer> hopServers, String name)protected org.apache.http.client.protocol.HttpClientContextgetAuthContext(IVariables variables)static intgetBackoffIncrements()DategetChangedDate()HopServergetClient()static longgetDelay(int trial)StringgetDescription()static String[]getHopServerNames(IHopMetadataProvider metadataProvider)StringgetHostname()ILogChannelgetLogChannel()StringgetNonProxyHosts()StringgetPassword()HopServerPipelineStatusgetPipelineStatus(IVariables variables, String pipelineName, String serverObjectId, int startLogLineNr)HopServerPipelineStatusgetPipelineStatus(IVariables variables, String pipelineName, String serverObjectId, int startLogLineNr, boolean sendResultXmlWithStatus)StringgetPort()StringgetPortSpecification(IVariables variables)StringgetPropertiesMasterName()StringgetProxyHostname()StringgetProxyPort()StringgetServerAndPort(IVariables variables)SslConfigurationgetSslConfig()HopServerStatusgetStatus(IVariables variables)StringgetUsername()StringgetWebAppName()HopServerWorkflowStatusgetWorkflowStatus(IVariables variables, String workflowName, String serverObjectId, int startLogLineNr)StringgetXml(IVariables variables)inthashCode()booleanisOverrideExistingProperties()booleanisSslMode()voidmonitorRemotePipeline(IVariables variables, ILogChannel log, String serverObjectId, String pipelineName)Monitors a remote pipeline every 5 seconds.voidmonitorRemotePipeline(IVariables variables, ILogChannel log, String serverObjectId, String pipelineName, int sleepTimeSeconds)Monitors a remote pipeline at the specified interval.voidmonitorRemoteWorkflow(IVariables variables, ILogChannel log, String serverObjectId, String workflowName)Monitors a remote workflow every 5 seconds.voidmonitorRemoteWorkflow(IVariables variables, ILogChannel log, String serverObjectId, String workflowName, int sleepTimeSeconds)Monitors a remote workflow at the specified interval.WebResultpauseResumePipeline(IVariables variables, String pipelineName, String serverObjectId)WebResultremovePipeline(IVariables variables, String pipelineName, String serverObjectId)WebResultremoveWorkflow(IVariables variables, String workflowName, String serverObjectId)voidreplaceMeta(HopServer hopServer)StringsendExport(IVariables variables, String filename, String type, String load)Send an exported archive over to this hop serverStringsendJson(IVariables variables, String json, String service)StringsendXml(IVariables variables, String xml, String service)voidsetDescription(String description)voidsetHostname(String urlString)voidsetNonProxyHosts(String nonProxyHosts)voidsetOverrideExistingProperties(boolean overrideExistingProperties)voidsetPassword(String password)voidsetPort(String port)voidsetPropertiesMasterName(String propertiesMasterName)voidsetProxyHostname(String proxyHostname)voidsetProxyPort(String proxyPort)voidsetSslConfig(SslConfiguration sslConfig)voidsetSslMode(boolean sslMode)voidsetUsername(String username)voidsetWebAppName(String webAppName)StringsniffTransform(IVariables variables, String pipelineName, String transformName, String id, String copyNr, int lines, String type)Sniff rows on a the hop server, return xml containing the row metadata and data.WebResultstartPipeline(IVariables variables, String pipelineName, String serverObjectId)WebResultstartWorkflow(IVariables variables, String workflowName, String serverObjectId)WebResultstopPipeline(IVariables variables, String pipelineName, String serverObjectId)WebResultstopWorkflow(IVariables variables, String pipelineName, String serverObjectId)StringtoString()StringverifyAndModifyHopServerName(List<HopServer> hopServers, String oldname)Verify the name of the hop server and if required, change it if it already exists in the list of hop servers.-
Methods inherited from class org.apache.hop.metadata.api.HopMetadataBase
getMetadataProviderName, getName, setMetadataProviderName, setName
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.hop.metadata.api.IHopMetadata
getMetadataProviderName, getName, setMetadataProviderName, setName
-
-
-
-
Field Detail
-
STRING_HOP_SERVER
public static final String STRING_HOP_SERVER
- See Also:
- Constant Field Values
-
XML_TAG
public static final String XML_TAG
- See Also:
- Constant Field Values
-
SSL_MODE_TAG
public static final String SSL_MODE_TAG
- See Also:
- Constant Field Values
-
HOP_SERVER_RETRIES
public static final int HOP_SERVER_RETRIES
-
HOP_SERVER_RETRY_BACKOFF_INCREMENTS
public static final int HOP_SERVER_RETRY_BACKOFF_INCREMENTS
-
-
Constructor Detail
-
HopServer
public HopServer()
-
HopServer
public HopServer(String name, String hostname, String port, String username, String password)
-
HopServer
public HopServer(String name, String hostname, String port, String username, String password, String proxyHostname, String proxyPort, String nonProxyHosts)
-
HopServer
public HopServer(String name, String hostname, String port, String username, String password, String proxyHostname, String proxyPort, String nonProxyHosts, boolean sslMode)
-
HopServer
public HopServer(Node node)
-
HopServer
public HopServer(HopServer server)
-
-
Method Detail
-
getBackoffIncrements
public static int getBackoffIncrements()
-
getLogChannel
public ILogChannel getLogChannel()
-
getXml
public String getXml(IVariables variables)
-
replaceMeta
public void replaceMeta(HopServer hopServer)
-
getServerAndPort
public String getServerAndPort(IVariables variables)
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classHopMetadataBase
-
hashCode
public int hashCode()
- Overrides:
hashCodein classHopMetadataBase
-
getHostname
public String getHostname()
-
setHostname
public void setHostname(String urlString)
-
getPassword
public String getPassword()
- Returns:
- the password
-
setPassword
public void setPassword(String password)
- Parameters:
password- the password to set
-
getUsername
public String getUsername()
- Returns:
- the username
-
setUsername
public void setUsername(String username)
- Parameters:
username- the username to set
-
getWebAppName
public String getWebAppName()
- Returns:
- the username
-
setWebAppName
public void setWebAppName(String webAppName)
- Parameters:
webAppName- the web application name to set
-
getNonProxyHosts
public String getNonProxyHosts()
- Returns:
- the nonProxyHosts
-
setNonProxyHosts
public void setNonProxyHosts(String nonProxyHosts)
- Parameters:
nonProxyHosts- the nonProxyHosts to set
-
getProxyHostname
public String getProxyHostname()
- Returns:
- the proxyHostname
-
setProxyHostname
public void setProxyHostname(String proxyHostname)
- Parameters:
proxyHostname- the proxyHostname to set
-
getProxyPort
public String getProxyPort()
- Returns:
- the proxyPort
-
setProxyPort
public void setProxyPort(String proxyPort)
- Parameters:
proxyPort- the proxyPort to set
-
getPropertiesMasterName
public String getPropertiesMasterName()
- Returns:
- the Master name for read properties
-
isOverrideExistingProperties
public boolean isOverrideExistingProperties()
- Returns:
- flag for read properties from Master
-
getPort
public String getPort()
- Returns:
- the port
-
setPort
public void setPort(String port)
- Parameters:
port- the port to set
-
getPortSpecification
public String getPortSpecification(IVariables variables)
-
constructUrl
public String constructUrl(IVariables variables, String serviceAndArguments) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
sendXml
public String sendXml(IVariables variables, String xml, String service) throws Exception
- Throws:
Exception
-
sendJson
public String sendJson(IVariables variables, String json, String service) throws Exception
- Throws:
Exception
-
sendExport
public String sendExport(IVariables variables, String filename, String type, String load) throws Exception
Send an exported archive over to this hop server- Parameters:
filename- The archive to sendtype- The type of file to add to the hop server (AddExportServlet.TYPE_*)load- The filename to load in the archive (the .hwf or .hpl)- Returns:
- the XML of the web result
- Throws:
Exception- in case something goes awry
-
getAuthContext
protected org.apache.http.client.protocol.HttpClientContext getAuthContext(IVariables variables)
- Returns:
- HttpClientContext with authorization credentials
-
execService
public String execService(IVariables variables, String service, boolean retry) throws Exception
- Throws:
Exception
-
getDelay
public static long getDelay(int trial)
-
execService
public String execService(IVariables variables, String service) throws Exception
- Throws:
Exception
-
execService
public String execService(IVariables variables, String service, Map<String,String> headerValues) throws Exception
- Throws:
Exception
-
getStatus
public HopServerStatus getStatus(IVariables variables) throws Exception
- Throws:
Exception
-
getPipelineStatus
public HopServerPipelineStatus getPipelineStatus(IVariables variables, String pipelineName, String serverObjectId, int startLogLineNr) throws Exception
- Throws:
Exception
-
getPipelineStatus
public HopServerPipelineStatus getPipelineStatus(IVariables variables, String pipelineName, String serverObjectId, int startLogLineNr, boolean sendResultXmlWithStatus) throws Exception
- Throws:
Exception
-
getWorkflowStatus
public HopServerWorkflowStatus getWorkflowStatus(IVariables variables, String workflowName, String serverObjectId, int startLogLineNr) throws Exception
- Throws:
Exception
-
stopPipeline
public WebResult stopPipeline(IVariables variables, String pipelineName, String serverObjectId) throws Exception
- Throws:
Exception
-
pauseResumePipeline
public WebResult pauseResumePipeline(IVariables variables, String pipelineName, String serverObjectId) throws Exception
- Throws:
Exception
-
removePipeline
public WebResult removePipeline(IVariables variables, String pipelineName, String serverObjectId) throws Exception
- Throws:
Exception
-
removeWorkflow
public WebResult removeWorkflow(IVariables variables, String workflowName, String serverObjectId) throws Exception
- Throws:
Exception
-
stopWorkflow
public WebResult stopWorkflow(IVariables variables, String pipelineName, String serverObjectId) throws Exception
- Throws:
Exception
-
startPipeline
public WebResult startPipeline(IVariables variables, String pipelineName, String serverObjectId) throws Exception
- Throws:
Exception
-
startWorkflow
public WebResult startWorkflow(IVariables variables, String workflowName, String serverObjectId) throws Exception
- Throws:
Exception
-
getHopServerNames
public static String[] getHopServerNames(IHopMetadataProvider metadataProvider) throws HopException
- Throws:
HopException
-
getDescription
public String getDescription()
-
setDescription
public void setDescription(String description)
-
verifyAndModifyHopServerName
public String verifyAndModifyHopServerName(List<HopServer> hopServers, String oldname)
Verify the name of the hop server and if required, change it if it already exists in the list of hop servers.- Parameters:
hopServers- the hop servers to check against.oldname- the old name of the hop server- Returns:
- the new hop server name
-
sniffTransform
public String sniffTransform(IVariables variables, String pipelineName, String transformName, String id, String copyNr, int lines, String type) throws Exception
Sniff rows on a the hop server, return xml containing the row metadata and data.- Parameters:
pipelineName- pipeline nameid- the id on the servertransformName- transform namecopyNr- transform copy numberlines- lines numbertype- transform type- Returns:
- xml with row metadata and data
- Throws:
Exception
-
getClient
public HopServer getClient()
-
monitorRemotePipeline
public void monitorRemotePipeline(IVariables variables, ILogChannel log, String serverObjectId, String pipelineName)
Monitors a remote pipeline every 5 seconds.- Parameters:
log- the log channel interfaceserverObjectId- the HopServer object IDpipelineName- the pipeline name
-
monitorRemotePipeline
public void monitorRemotePipeline(IVariables variables, ILogChannel log, String serverObjectId, String pipelineName, int sleepTimeSeconds)
Monitors a remote pipeline at the specified interval.- Parameters:
log- the log channel interfaceserverObjectId- the HopServer object IDpipelineName- the pipeline namesleepTimeSeconds- the sleep time (in seconds)
-
monitorRemoteWorkflow
public void monitorRemoteWorkflow(IVariables variables, ILogChannel log, String serverObjectId, String workflowName)
Monitors a remote workflow every 5 seconds.- Parameters:
log- the log channel interfaceserverObjectId- the HopServer object IDworkflowName- the workflow name
-
monitorRemoteWorkflow
public void monitorRemoteWorkflow(IVariables variables, ILogChannel log, String serverObjectId, String workflowName, int sleepTimeSeconds)
Monitors a remote workflow at the specified interval.- Parameters:
log- the log channel interfaceserverObjectId- the HopServer object IDworkflowName- the workflow namesleepTimeSeconds- the sleep time (in seconds)
-
getChangedDate
public Date getChangedDate()
- Returns:
- the changedDate
-
setSslMode
public void setSslMode(boolean sslMode)
- Parameters:
sslMode-
-
isSslMode
public boolean isSslMode()
- Returns:
- the sslMode
-
getSslConfig
public SslConfiguration getSslConfig()
- Returns:
- the sslConfig
-
setSslConfig
public void setSslConfig(SslConfiguration sslConfig)
- Parameters:
sslConfig- The sslConfig to set
-
setOverrideExistingProperties
public void setOverrideExistingProperties(boolean overrideExistingProperties)
- Parameters:
overrideExistingProperties- The overrideExistingProperties to set
-
setPropertiesMasterName
public void setPropertiesMasterName(String propertiesMasterName)
- Parameters:
propertiesMasterName- The propertiesMasterName to set
-
-