org.pentaho.di.cluster
Class SlaveServer

java.lang.Object
  extended by org.pentaho.di.core.changed.ChangedFlag
      extended by org.pentaho.di.cluster.SlaveServer
All Implemented Interfaces:
Cloneable, ChangedFlagInterface, org.pentaho.di.core.variables.VariableSpace, org.pentaho.di.shared.SharedObjectInterface

public class SlaveServer
extends ChangedFlag
implements Cloneable, org.pentaho.di.shared.SharedObjectInterface, org.pentaho.di.core.variables.VariableSpace


Field Summary
static String XML_TAG
           
 
Constructor Summary
SlaveServer()
           
SlaveServer(Node slaveNode)
           
SlaveServer(Repository rep, long id_slave_server)
           
SlaveServer(String name, String hostname, String port, String username, String password)
           
SlaveServer(String name, String hostname, String port, String username, String password, String proxyHostname, String proxyPort, String nonProxyHosts, boolean master)
           
 
Method Summary
 void addCredentials(org.apache.commons.httpclient.HttpClient client)
           
 int allocateServerSocket(int portRangeStart, String hostname, String transformationName, String sourceSlaveName, String sourceStepName, String sourceStepCopy, String targetSlaveName, String targetStepName, String targetStepCopy)
           
 WebResult cleanupTransformation(String transName)
           
 Object clone()
           
 String constructUrl(String serviceAndArguments)
           
 void copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space)
           
 WebResult deallocatePorts(String transName)
           
 String environmentSubstitute(String aString)
           
 String[] environmentSubstitute(String[] aString)
           
 boolean equals(Object obj)
           
 String execService(String service)
           
static SlaveServer findSlaveServer(List<SlaveServer> slaveServers, String name)
           
 boolean getBooleanValueOfVariable(String variableName, boolean defaultValue)
           
 String getContentFromServer(String service)
          Contact the server and get back the reply as a string
 String getHostname()
           
 long getId()
           
 SlaveServerJobStatus getJobStatus(String jobName)
           
 String getName()
           
 String getNonProxyHosts()
           
 org.pentaho.di.core.variables.VariableSpace getParentVariableSpace()
           
 String getPassword()
           
 String getPort()
           
 String getPortSpecification()
           
 String getProxyHostname()
           
 String getProxyPort()
           
 org.apache.commons.httpclient.methods.PutMethod getSendByteArrayMethod(byte[] content, String service)
           
 String getServerAndPort()
           
 List<SlaveServerDetection> getSlaveServerDetections()
           
static String[] getSlaveServerNames(List<SlaveServer> slaveServers)
           
 SlaveServerStatus getStatus()
           
 SlaveServerTransStatus getTransStatus(String transName)
           
 String getUsername()
           
 String getVariable(String variableName)
           
 String getVariable(String variableName, String defaultValue)
           
 String getXML()
           
 int hashCode()
           
 void initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent)
           
 void injectVariables(Map<String,String> prop)
           
 boolean isMaster()
           
 boolean isShared()
           
 String[] listVariables()
           
 void replaceMeta(SlaveServer slaveServer)
           
 void saveRep(Repository rep)
           
 void saveRep(Repository rep, long id_transformation, boolean isUsedByTransformation)
           
 String sendExport(String filename, String type, String load)
          Send an exported archive over to this slave server
 String sendXML(String xml, String service)
           
 void setHostname(String urlString)
           
 void setId(long id)
           
 void setMaster(boolean master)
           
 void setName(String name)
           
 void setNonProxyHosts(String nonProxyHosts)
           
 void setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent)
           
 void setPassword(String password)
           
 void setPort(String port)
           
 void setProxyHostname(String proxyHostname)
           
 void setProxyPort(String proxyPort)
           
 void setShared(boolean shared)
           
 void setUsername(String username)
           
 void setVariable(String variableName, String variableValue)
           
 void shareVariablesWith(org.pentaho.di.core.variables.VariableSpace space)
           
 WebResult startJob(String transName)
           
 WebResult startTransformation(String transName)
           
 WebResult stopJob(String transName)
           
 WebResult stopTransformation(String transName)
           
 String toString()
           
 
Methods inherited from class org.pentaho.di.core.changed.ChangedFlag
addObserver, clearChanged, deleteObserver, hasChanged, notifyObservers, setChanged, setChanged
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

XML_TAG

public static final String XML_TAG
See Also:
Constant Field Values
Constructor Detail

SlaveServer

public SlaveServer()

SlaveServer

public SlaveServer(String name,
                   String hostname,
                   String port,
                   String username,
                   String password)

SlaveServer

public SlaveServer(String name,
                   String hostname,
                   String port,
                   String username,
                   String password,
                   String proxyHostname,
                   String proxyPort,
                   String nonProxyHosts,
                   boolean master)

SlaveServer

public SlaveServer(Node slaveNode)

SlaveServer

public SlaveServer(Repository rep,
                   long id_slave_server)
            throws org.pentaho.di.core.exception.KettleException
Throws:
org.pentaho.di.core.exception.KettleException
Method Detail

getXML

public String getXML()
Specified by:
getXML in interface org.pentaho.di.shared.SharedObjectInterface

saveRep

public void saveRep(Repository rep)
             throws org.pentaho.di.core.exception.KettleException
Throws:
org.pentaho.di.core.exception.KettleException

saveRep

public void saveRep(Repository rep,
                    long id_transformation,
                    boolean isUsedByTransformation)
             throws org.pentaho.di.core.exception.KettleException
Throws:
org.pentaho.di.core.exception.KettleException

clone

public Object clone()
Overrides:
clone in class Object

replaceMeta

public void replaceMeta(SlaveServer slaveServer)

toString

public String toString()
Overrides:
toString in class Object

getServerAndPort

public String getServerAndPort()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

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

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

getPortSpecification

public String getPortSpecification()

constructUrl

public String constructUrl(String serviceAndArguments)
                    throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

getPort

public String getPort()
Returns:
the port

setPort

public void setPort(String port)
Parameters:
port - the port to set

getSendByteArrayMethod

public org.apache.commons.httpclient.methods.PutMethod getSendByteArrayMethod(byte[] content,
                                                                              String service)
                                                                       throws Exception
Throws:
Exception

sendXML

public String sendXML(String xml,
                      String service)
               throws Exception
Throws:
Exception

sendExport

public String sendExport(String filename,
                         String type,
                         String load)
                  throws Exception
Send an exported archive over to this slave server

Parameters:
filename - The archive to send
type - The type of file to add to the slave server (AddExportServlet.TYPE_*)
load - The filename to load in the archive (the .kjb or .ktr)
Returns:
the XML of the web result
Throws:
Exception - in case something goes awry

addCredentials

public void addCredentials(org.apache.commons.httpclient.HttpClient client)

isMaster

public boolean isMaster()
Returns:
the master

setMaster

public void setMaster(boolean master)
Parameters:
master - the master to set

execService

public String execService(String service)
                   throws Exception
Throws:
Exception

getContentFromServer

public String getContentFromServer(String service)
                            throws Exception
Contact the server and get back the reply as a string

Returns:
the requested information
Throws:
Exception - in case something goes awry

getStatus

public SlaveServerStatus getStatus()
                            throws Exception
Throws:
Exception

getSlaveServerDetections

public List<SlaveServerDetection> getSlaveServerDetections()
                                                    throws Exception
Throws:
Exception

getTransStatus

public SlaveServerTransStatus getTransStatus(String transName)
                                      throws Exception
Throws:
Exception

getJobStatus

public SlaveServerJobStatus getJobStatus(String jobName)
                                  throws Exception
Throws:
Exception

stopTransformation

public WebResult stopTransformation(String transName)
                             throws Exception
Throws:
Exception

stopJob

public WebResult stopJob(String transName)
                  throws Exception
Throws:
Exception

startTransformation

public WebResult startTransformation(String transName)
                              throws Exception
Throws:
Exception

startJob

public WebResult startJob(String transName)
                   throws Exception
Throws:
Exception

cleanupTransformation

public WebResult cleanupTransformation(String transName)
                                throws Exception
Throws:
Exception

deallocatePorts

public WebResult deallocatePorts(String transName)
                          throws Exception
Throws:
Exception

findSlaveServer

public static SlaveServer findSlaveServer(List<SlaveServer> slaveServers,
                                          String name)

getSlaveServerNames

public static String[] getSlaveServerNames(List<SlaveServer> slaveServers)

allocateServerSocket

public int allocateServerSocket(int portRangeStart,
                                String hostname,
                                String transformationName,
                                String sourceSlaveName,
                                String sourceStepName,
                                String sourceStepCopy,
                                String targetSlaveName,
                                String targetStepName,
                                String targetStepCopy)
                         throws Exception
Throws:
Exception

getName

public String getName()
Specified by:
getName in interface org.pentaho.di.shared.SharedObjectInterface

setName

public void setName(String name)

isShared

public boolean isShared()
Specified by:
isShared in interface org.pentaho.di.shared.SharedObjectInterface

setShared

public void setShared(boolean shared)
Specified by:
setShared in interface org.pentaho.di.shared.SharedObjectInterface

getId

public long getId()

setId

public void setId(long id)

copyVariablesFrom

public void copyVariablesFrom(org.pentaho.di.core.variables.VariableSpace space)
Specified by:
copyVariablesFrom in interface org.pentaho.di.core.variables.VariableSpace

environmentSubstitute

public String environmentSubstitute(String aString)
Specified by:
environmentSubstitute in interface org.pentaho.di.core.variables.VariableSpace

environmentSubstitute

public String[] environmentSubstitute(String[] aString)
Specified by:
environmentSubstitute in interface org.pentaho.di.core.variables.VariableSpace

getParentVariableSpace

public org.pentaho.di.core.variables.VariableSpace getParentVariableSpace()
Specified by:
getParentVariableSpace in interface org.pentaho.di.core.variables.VariableSpace

setParentVariableSpace

public void setParentVariableSpace(org.pentaho.di.core.variables.VariableSpace parent)
Specified by:
setParentVariableSpace in interface org.pentaho.di.core.variables.VariableSpace

getVariable

public String getVariable(String variableName,
                          String defaultValue)
Specified by:
getVariable in interface org.pentaho.di.core.variables.VariableSpace

getVariable

public String getVariable(String variableName)
Specified by:
getVariable in interface org.pentaho.di.core.variables.VariableSpace

getBooleanValueOfVariable

public boolean getBooleanValueOfVariable(String variableName,
                                         boolean defaultValue)
Specified by:
getBooleanValueOfVariable in interface org.pentaho.di.core.variables.VariableSpace

initializeVariablesFrom

public void initializeVariablesFrom(org.pentaho.di.core.variables.VariableSpace parent)
Specified by:
initializeVariablesFrom in interface org.pentaho.di.core.variables.VariableSpace

listVariables

public String[] listVariables()
Specified by:
listVariables in interface org.pentaho.di.core.variables.VariableSpace

setVariable

public void setVariable(String variableName,
                        String variableValue)
Specified by:
setVariable in interface org.pentaho.di.core.variables.VariableSpace

shareVariablesWith

public void shareVariablesWith(org.pentaho.di.core.variables.VariableSpace space)
Specified by:
shareVariablesWith in interface org.pentaho.di.core.variables.VariableSpace

injectVariables

public void injectVariables(Map<String,String> prop)
Specified by:
injectVariables in interface org.pentaho.di.core.variables.VariableSpace