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 DataSingletonCollection
All
static String
API_ID
protected HPCCWsClientPool
hpccClientPool
protected boolean
isDisabled
boolean
isTempDisabled
static String
P_CLUSTER
static String
P_COMPILEONLY
static String
P_DISABLED
static String
P_IP
static String
P_IP_DEFAULT
static String
P_PASSWORD
static String
P_PORT
static int
P_PORT_DEFAULT
static String
P_PORT_DEFAULT_STR
static String
P_SSL
static boolean
P_SSL_DEFAULT
static int
P_SSLPORT_DEFAULT
static String
P_SSLPORT_DEFAULT_STR
static String
P_USER
protected HPCCWsClient
platformHPCCClient
protected Collection<Workunit>
workunits
-
Constructor Summary
Constructors Modifier Constructor Description protected
Platform(Connection hpccconn)
Instantiates a new platform.protected
Platform(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 void
checkInHPCCWsClient(HPCCWsClient client)
Check in HPCC ws client.HPCCWsClient
checkOutHPCCWsClient()
Check out HPCC ws client.void
clearTempDisabled()
Clear temp disabled.protected void
confirmDisable()
Confirm disable.boolean
equals(Object aThat)
void
expireHPCCWsClient(HPCCWsClient client)
Expire HPCC ws client.protected void
fastRefresh()
protected void
fullRefresh()
static Platform
get(String protocol, String ip, int port, String user, String pass)
Gets the.static Platform
get(String address, String user, String pass)
Gets the.static Platform
get(Connection conn)
Gets the.protected String
getBuild()
Gets the builds the.Version
getBuildVersion()
Gets the builds the version.Cluster
getCluster(String name)
Gets the cluster.Cluster
getCluster(org.hpccsystems.ws.client.gen.axis2.wstopology.latest.TpTargetCluster tc)
Gets the cluster.Cluster[]
getClusters()
Gets the clusters.DataQuerySet
getDataQuerySet(String name)
Gets the data query set.DataQuerySet
getDataQuerySet(org.hpccsystems.ws.client.gen.axis2.wsworkunits.latest.QuerySet qs)
Gets the data query set.DataQuerySet[]
getDataQuerySets()
Gets the data query sets.DropZone
getDropZone(String name)
Gets the drop zone.DropZone
getDropZone(org.hpccsystems.ws.client.gen.axis2.wstopology.latest.TpDropZone dz)
Gets the drop zone.DropZone
getDropZone(org.hpccsystems.ws.client.wrappers.gen.wstopology.TpDropZoneWrapper dz)
Gets the drop zone.DropZone[]
getDropZones()
Gets the drop zones.FileSprayWorkunit
getFileSprayWorkunit(String id)
Gets the file spray workunit.FileSprayWorkunit
getFileSprayWorkunit(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.String
getIP()
Gets the ip.LogicalFile
getLogicalFile(String name)
Gets the logical file.LogicalFile
getLogicalFile(org.hpccsystems.ws.client.gen.axis2.wsdfu.latest.DFULogicalFile lf)
Gets the logical file.LogicalFile
getLogicalFile(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 Platform
getNoCreate(String protocol, String ip, int port, String user, String pass)
Deprecated.String
getPassword()
Gets the password.int
getPort()
Gets the port.String
getProtocol()
Gets the protocol.URL
getURL()
Gets the url.URL
getURL(String service)
Gets the url.URL
getURL(String service, String method)
Gets the url.URL
getURL(String service, String method, String params)
Gets the url.String
getUser()
Gets the user.Version
getVersion()
Gets the version.URL
getWidgetURL(String widget, String params)
Gets the widget URL.Workunit
getWorkunit(String wuid)
Gets the workunit.Workunit
getWorkunit(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.HPCCWsClient
getWsClient()
Gets the ws client.protected static String
hackUnicodeInXMLForAxisOneAndESP(String src)
Hack unicode in XML for axis one and ESP.int
hashCode()
protected boolean
isComplete()
boolean
isContainerized()
boolean
isDisabled()
Checks if is disabled.boolean
isEnabled()
Checks if is enabled.boolean
pingServer()
Ping server.static void
remove(Platform p)
Removes the.Workunit
submit(String cluster, String archiveOrEcl, boolean compileOnly)
Submit.Workunit
submit(String cluster, String archiveOrEcl, String jobname, String filePath, int inlineResultLimit, boolean compileOnly)
Submit.protected void
testServer()
Test server.static String
toESPString(GregorianCalendar _calendar)
To ESP string.boolean
validateHPCCWsClient(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:
isComplete
in classDataSingleton
-
fastRefresh
protected void fastRefresh()
- Specified by:
fastRefresh
in classDataSingleton
-
fullRefresh
protected void fullRefresh()
- Specified by:
fullRefresh
in 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:
equals
in classDataSingleton
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classDataSingleton
-
-