Class Platform
- java.lang.Object
-
- java.util.Observable
-
- org.hpccsystems.ws.client.utils.DataSingleton
-
- org.hpccsystems.ws.client.platform.Platform
-
public class Platform extends DataSingleton
-
-
Field Summary
Fields Modifier and Type Field Description static DataSingletonCollectionAllstatic StringAPI_IDprotected HPCCWsClientPoolhpccClientPoolprotected booleanisDisabledbooleanisTempDisabledstatic StringP_CLUSTERstatic StringP_COMPILEONLYstatic StringP_DISABLEDstatic StringP_IPstatic StringP_IP_DEFAULTstatic StringP_PASSWORDstatic StringP_PORTstatic intP_PORT_DEFAULTstatic StringP_PORT_DEFAULT_STRstatic StringP_SSLstatic booleanP_SSL_DEFAULTstatic intP_SSLPORT_DEFAULTstatic StringP_SSLPORT_DEFAULT_STRstatic StringP_USERprotected HPCCWsClientplatformHPCCClientprotected Collection<Workunit>workunits
-
Constructor Summary
Constructors Modifier Constructor Description protectedPlatform(Connection hpccconn)Instantiates a new platform.protectedPlatform(Connection hpccconn, long pooltimeoutmillis)Instantiates a new platform.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcheckInHPCCWsClient(HPCCWsClient client)Check in HPCC ws client.HPCCWsClientcheckOutHPCCWsClient()Check out HPCC ws client.voidclearTempDisabled()Clear temp disabled.protected voidconfirmDisable()Confirm disable.booleanequals(Object aThat)voidexpireHPCCWsClient(HPCCWsClient client)Expire HPCC ws client.protected voidfastRefresh()protected voidfullRefresh()static Platformget(String protocol, String ip, int port, String user, String pass)Gets the.static Platformget(String address, String user, String pass)Gets the.static Platformget(Connection conn)Gets the.protected StringgetBuild()Gets the builds the.VersiongetBuildVersion()Gets the builds the version.ClustergetCluster(String name)Gets the cluster.ClustergetCluster(org.hpccsystems.ws.client.gen.axis2.wstopology.latest.TpTargetCluster tc)Gets the cluster.Cluster[]getClusters()Gets the clusters.DataQuerySetgetDataQuerySet(String name)Gets the data query set.DataQuerySetgetDataQuerySet(org.hpccsystems.ws.client.gen.axis2.wsworkunits.latest.QuerySet qs)Gets the data query set.DataQuerySet[]getDataQuerySets()Gets the data query sets.DropZonegetDropZone(String name)Gets the drop zone.DropZonegetDropZone(org.hpccsystems.ws.client.gen.axis2.wstopology.latest.TpDropZone dz)Gets the drop zone.DropZonegetDropZone(org.hpccsystems.ws.client.wrappers.gen.wstopology.TpDropZoneWrapper dz)Gets the drop zone.DropZone[]getDropZones()Gets the drop zones.FileSprayWorkunitgetFileSprayWorkunit(String id)Gets the file spray workunit.FileSprayWorkunitgetFileSprayWorkunit(org.hpccsystems.ws.client.wrappers.gen.filespray.DFUWorkunitWrapper wu)Gets the file spray workunit.FileSprayWorkunit[]getFileSprayWorkunits()Gets the file spray workunits.FileSprayWorkunit[]getFileSprayWorkunits(String cluster)Gets the file spray workunits.StringgetIP()Gets the ip.LogicalFilegetLogicalFile(String name)Gets the logical file.LogicalFilegetLogicalFile(org.hpccsystems.ws.client.gen.axis2.wsdfu.latest.DFULogicalFile lf)Gets the logical file.LogicalFilegetLogicalFile(org.hpccsystems.ws.client.gen.axis2.wsworkunits.latest.ECLSourceFile sf)Gets the logical file.LogicalFile[]getLogicalFiles()Gets the logical files.LogicalFile[]getLogicalFiles(String cluster)Gets the logical files.static PlatformgetNoCreate(String protocol, String ip, int port, String user, String pass)Deprecated.StringgetPassword()Gets the password.intgetPort()Gets the port.StringgetProtocol()Gets the protocol.URLgetURL()Gets the url.URLgetURL(String service)Gets the url.URLgetURL(String service, String method)Gets the url.URLgetURL(String service, String method, String params)Gets the url.StringgetUser()Gets the user.VersiongetVersion()Gets the version.URLgetWidgetURL(String widget, String params)Gets the widget URL.WorkunitgetWorkunit(String wuid)Gets the workunit.WorkunitgetWorkunit(org.hpccsystems.ws.client.gen.axis2.wsworkunits.latest.ECLWorkunit wu)Gets the workunit.Collection<Workunit>getWorkunits(boolean userOnly)Gets the workunits.Collection<Workunit>getWorkunits(boolean userOnly, String cluster)Gets the workunits.Collection<Workunit>getWorkunits(boolean userOnly, String cluster, String startDate, String endDate, String jobname, String appKey, String appData)Gets the workunits.Collection<Workunit>getWorkunits(String owner, String cluster, GregorianCalendar startDate, GregorianCalendar endDate)Gets the workunits.HPCCWsClientgetWsClient()Gets the ws client.protected static StringhackUnicodeInXMLForAxisOneAndESP(String src)Hack unicode in XML for axis one and ESP.inthashCode()protected booleanisComplete()booleanisContainerized()booleanisDisabled()Checks if is disabled.booleanisEnabled()Checks if is enabled.booleanpingServer()Ping server.static voidremove(Platform p)Removes the.Workunitsubmit(String cluster, String archiveOrEcl, boolean compileOnly)Submit.Workunitsubmit(String cluster, String archiveOrEcl, String jobname, String filePath, int inlineResultLimit, boolean compileOnly)Submit.protected voidtestServer()Test server.static StringtoESPString(GregorianCalendar _calendar)To ESP string.booleanvalidateHPCCWsClient(HPCCWsClient client)Validate HPCC ws client.-
Methods inherited from class org.hpccsystems.ws.client.utils.DataSingleton
monitor
-
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
-
-
-
Field Detail
-
API_ID
public static final String API_ID
- See Also:
- Constant Field Values
-
All
public static DataSingletonCollection All
-
P_DISABLED
public static final String P_DISABLED
- See Also:
- Constant Field Values
-
P_SSL
public static final String P_SSL
- See Also:
- Constant Field Values
-
P_SSL_DEFAULT
public static final boolean P_SSL_DEFAULT
- See Also:
- Constant Field Values
-
P_IP
public static final String P_IP
- See Also:
- Constant Field Values
-
P_IP_DEFAULT
public static final String P_IP_DEFAULT
- See Also:
- Constant Field Values
-
P_PORT
public static final String P_PORT
- See Also:
- Constant Field Values
-
P_PORT_DEFAULT
public static final int P_PORT_DEFAULT
- See Also:
- Constant Field Values
-
P_SSLPORT_DEFAULT
public static final int P_SSLPORT_DEFAULT
- See Also:
- Constant Field Values
-
P_PORT_DEFAULT_STR
public static final String P_PORT_DEFAULT_STR
- See Also:
- Constant Field Values
-
P_SSLPORT_DEFAULT_STR
public static final String P_SSLPORT_DEFAULT_STR
- See Also:
- Constant Field Values
-
P_USER
public static final String P_USER
- See Also:
- Constant Field Values
-
P_PASSWORD
public static final String P_PASSWORD
- See Also:
- Constant Field Values
-
P_CLUSTER
public static final String P_CLUSTER
- See Also:
- Constant Field Values
-
P_COMPILEONLY
public static final String P_COMPILEONLY
- See Also:
- Constant Field Values
-
platformHPCCClient
protected HPCCWsClient platformHPCCClient
-
hpccClientPool
protected HPCCWsClientPool hpccClientPool
-
isDisabled
protected boolean isDisabled
-
isTempDisabled
public boolean isTempDisabled
-
workunits
protected Collection<Workunit> workunits
-
-
Constructor Detail
-
Platform
protected Platform(Connection hpccconn)
Instantiates a new platform.- Parameters:
hpccconn- the hpccconn
-
Platform
protected Platform(Connection hpccconn, long pooltimeoutmillis)
Instantiates a new platform.- Parameters:
hpccconn- the hpccconnpooltimeoutmillis- the pooltimeoutmillis
-
-
Method Detail
-
get
public static Platform get(Connection conn)
Gets the.- Parameters:
conn- the conn- Returns:
- the platform
-
get
public static Platform get(String protocol, String ip, int port, String user, String pass)
Gets the.- Parameters:
protocol- the protocolip- the ipport- the portuser- the userpass- the pass- Returns:
- the platform
-
get
public static Platform get(String address, String user, String pass)
Gets the.- Parameters:
address- the addressuser- the userpass- the pass- Returns:
- the platform
-
getNoCreate
@Deprecated public static Platform getNoCreate(String protocol, String ip, int port, String user, String pass)
Deprecated.Gets the no create.- Parameters:
protocol- the protocolip- the ipport- the portuser- the userpass- the pass- Returns:
- the no create
-
remove
public static void remove(Platform p)
Removes the.- Parameters:
p- the p
-
confirmDisable
protected void confirmDisable()
Confirm disable.
-
clearTempDisabled
public void clearTempDisabled()
Clear temp disabled.
-
isContainerized
public boolean isContainerized()
-
testServer
protected void testServer()
Test server.
-
isDisabled
public boolean isDisabled()
Checks if is disabled.- Returns:
- true, if is disabled
-
isEnabled
public boolean isEnabled()
Checks if is enabled.- Returns:
- true, if is enabled
-
getProtocol
public String getProtocol()
Gets the protocol.- Returns:
- the protocol
-
getIP
public String getIP()
Gets the ip.- Returns:
- the ip
-
getPort
public int getPort()
Gets the port.- Returns:
- the port
-
getUser
public String getUser()
Gets the user.- Returns:
- the user
-
getPassword
public String getPassword()
Gets the password.- Returns:
- the password
-
getBuild
protected String getBuild()
Gets the builds the.- Returns:
- the builds the
-
pingServer
public boolean pingServer()
Ping server.- Returns:
- true, if successful
-
getBuildVersion
public Version getBuildVersion()
Gets the builds the version.- Returns:
- the builds the version
-
getVersion
public Version getVersion()
Gets the version.- Returns:
- the version
-
hackUnicodeInXMLForAxisOneAndESP
protected static String hackUnicodeInXMLForAxisOneAndESP(String src)
Hack unicode in XML for axis one and ESP.- Parameters:
src- the src- Returns:
- the string
-
submit
public Workunit submit(String cluster, String archiveOrEcl, boolean compileOnly)
Submit.- Parameters:
cluster- the clusterarchiveOrEcl- the archive or eclcompileOnly- the compile only- Returns:
- the workunit
-
submit
public Workunit submit(String cluster, String archiveOrEcl, String jobname, String filePath, int inlineResultLimit, boolean compileOnly)
Submit.- Parameters:
cluster- the clusterarchiveOrEcl- the archive or ecljobname- the jobnamefilePath- the file pathinlineResultLimit- the inline result limitcompileOnly- the compile only- Returns:
- the workunit
-
isComplete
protected boolean isComplete()
- Specified by:
isCompletein classDataSingleton
-
fastRefresh
protected void fastRefresh()
- Specified by:
fastRefreshin classDataSingleton
-
fullRefresh
protected void fullRefresh()
- Specified by:
fullRefreshin classDataSingleton
-
getWorkunit
public Workunit getWorkunit(String wuid)
Gets the workunit.- Parameters:
wuid- the wuid- Returns:
- the workunit
-
getWorkunit
public Workunit getWorkunit(org.hpccsystems.ws.client.gen.axis2.wsworkunits.latest.ECLWorkunit wu)
Gets the workunit.- Parameters:
wu- the wu- Returns:
- the workunit
-
getWorkunits
public Collection<Workunit> getWorkunits(boolean userOnly, String cluster, String startDate, String endDate, String jobname, String appKey, String appData)
Gets the workunits.- Parameters:
userOnly- the user onlycluster- the clusterstartDate- the start dateendDate- the end datejobname- the jobnameappKey- the app keyappData- the app data- Returns:
- the workunits
-
toESPString
public static String toESPString(GregorianCalendar _calendar)
To ESP string.- Parameters:
_calendar- the calendar- Returns:
- the string
-
getWorkunits
public Collection<Workunit> getWorkunits(String owner, String cluster, GregorianCalendar startDate, GregorianCalendar endDate)
Gets the workunits.- Parameters:
owner- the ownercluster- the clusterstartDate- the start dateendDate- the end date- Returns:
- the workunits
-
getWorkunits
public Collection<Workunit> getWorkunits(boolean userOnly, String cluster)
Gets the workunits.- Parameters:
userOnly- the user onlycluster- the cluster- Returns:
- the workunits
-
getWorkunits
public Collection<Workunit> getWorkunits(boolean userOnly)
Gets the workunits.- Parameters:
userOnly- the user only- Returns:
- the workunits
-
getFileSprayWorkunit
public FileSprayWorkunit getFileSprayWorkunit(String id)
Gets the file spray workunit.- Parameters:
id- the id- Returns:
- the file spray workunit
-
getFileSprayWorkunit
public FileSprayWorkunit getFileSprayWorkunit(org.hpccsystems.ws.client.wrappers.gen.filespray.DFUWorkunitWrapper wu)
Gets the file spray workunit.- Parameters:
wu- the wu- Returns:
- the file spray workunit
-
getFileSprayWorkunits
public FileSprayWorkunit[] getFileSprayWorkunits(String cluster)
Gets the file spray workunits.- Parameters:
cluster- the cluster- Returns:
- the file spray workunits
-
getFileSprayWorkunits
public FileSprayWorkunit[] getFileSprayWorkunits()
Gets the file spray workunits.- Returns:
- the file spray workunits
-
getDataQuerySet
public DataQuerySet getDataQuerySet(String name)
Gets the data query set.- Parameters:
name- the name- Returns:
- the data query set
-
getDataQuerySet
public DataQuerySet getDataQuerySet(org.hpccsystems.ws.client.gen.axis2.wsworkunits.latest.QuerySet qs)
Gets the data query set.- Parameters:
qs- the qs- Returns:
- the data query set
-
getDataQuerySets
public DataQuerySet[] getDataQuerySets()
Gets the data query sets.- Returns:
- the data query sets
-
getLogicalFile
public LogicalFile getLogicalFile(String name)
Gets the logical file.- Parameters:
name- the name- Returns:
- the logical file
-
getLogicalFile
public LogicalFile getLogicalFile(org.hpccsystems.ws.client.gen.axis2.wsdfu.latest.DFULogicalFile lf)
Gets the logical file.- Parameters:
lf- the lf- Returns:
- the logical file
-
getLogicalFile
public LogicalFile getLogicalFile(org.hpccsystems.ws.client.gen.axis2.wsworkunits.latest.ECLSourceFile sf)
Gets the logical file.- Parameters:
sf- the sf- Returns:
- the logical file
-
getLogicalFiles
public LogicalFile[] getLogicalFiles(String cluster)
Gets the logical files.- Parameters:
cluster- the cluster- Returns:
- the logical files
-
getLogicalFiles
public LogicalFile[] getLogicalFiles()
Gets the logical files.- Returns:
- the logical files
-
getCluster
public Cluster getCluster(String name)
Gets the cluster.- Parameters:
name- the name- Returns:
- the cluster
-
getCluster
public Cluster getCluster(org.hpccsystems.ws.client.gen.axis2.wstopology.latest.TpTargetCluster tc)
Gets the cluster.- Parameters:
tc- the tc- Returns:
- the cluster
-
getClusters
public Cluster[] getClusters()
Gets the clusters.- Returns:
- the clusters
-
getDropZone
public DropZone getDropZone(String name)
Gets the drop zone.- Parameters:
name- the name- Returns:
- the drop zone
-
getDropZone
public DropZone getDropZone(org.hpccsystems.ws.client.gen.axis2.wstopology.latest.TpDropZone dz)
Gets the drop zone.- Parameters:
dz- the dz- Returns:
- the drop zone
-
getDropZone
public DropZone getDropZone(org.hpccsystems.ws.client.wrappers.gen.wstopology.TpDropZoneWrapper dz)
Gets the drop zone.- Parameters:
dz- the dz- Returns:
- the drop zone
-
getDropZones
public DropZone[] getDropZones()
Gets the drop zones.- Returns:
- the drop zones
-
getURL
public URL getURL() throws MalformedURLException
Gets the url.- Returns:
- the url
- Throws:
MalformedURLException- the malformed URL exception
-
getURL
public URL getURL(String service) throws MalformedURLException
Gets the url.- Parameters:
service- the service- Returns:
- the url
- Throws:
MalformedURLException- the malformed URL exception
-
getURL
public URL getURL(String service, String method) throws MalformedURLException
Gets the url.- Parameters:
service- the servicemethod- the method- Returns:
- the url
- Throws:
MalformedURLException- the malformed URL exception
-
getURL
public URL getURL(String service, String method, String params) throws MalformedURLException
Gets the url.- Parameters:
service- the servicemethod- the methodparams- the params- Returns:
- the url
- Throws:
MalformedURLException- the malformed URL exception
-
getWidgetURL
public URL getWidgetURL(String widget, String params) throws MalformedURLException
Gets the widget URL.- Parameters:
widget- the widgetparams- the params- Returns:
- the widget URL
- Throws:
MalformedURLException- the malformed URL exception
-
getWsClient
public HPCCWsClient getWsClient() throws Exception
Gets the ws client.- Returns:
- HPCCWsClient instance - not thread safe - Use checkoutWsClient for multi-thread use
- Throws:
Exception- the exception
-
checkOutHPCCWsClient
public HPCCWsClient checkOutHPCCWsClient() throws Exception
Check out HPCC ws client.- Returns:
- HPCCWsClient from HPCCClient pool, caller responsible for checking client back in
- Throws:
Exception- the exception
-
checkInHPCCWsClient
public void checkInHPCCWsClient(HPCCWsClient client) throws Exception
Check in HPCC ws client.- Parameters:
client- - returns hpccWsClient to pool for use by other threads- Throws:
Exception- the exception
-
validateHPCCWsClient
public boolean validateHPCCWsClient(HPCCWsClient client)
Validate HPCC ws client.- Parameters:
client- the client- Returns:
- true, if successful
-
expireHPCCWsClient
public void expireHPCCWsClient(HPCCWsClient client)
Expire HPCC ws client.- Parameters:
client- the client
-
equals
public boolean equals(Object aThat)
- Specified by:
equalsin classDataSingleton
-
hashCode
public int hashCode()
- Specified by:
hashCodein classDataSingleton
-
-