Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WsResourcesClient methods and junit cases #698

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion wsclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
<unpackClasses>true</unpackClasses>
<databindingName>adb</databindingName>
<packageName>org.hpccsystems.ws.client.gen.axis2.filespray.latest</packageName>
<wsdlFile>src/main/resources/WSDLs/WsFileSpray.wsdl</wsdlFile>
<wsdlFile>src/main/resources/WSDLs/FileSpray.wsdl</wsdlFile>
<wsdlVersion>1.23</wsdlVersion>
<syncMode>sync</syncMode>
<namespaceURIs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,19 @@ HPCC SYSTEMS software Copyright (C) 2021 HPCC Systems®.
import org.apache.logging.log4j.Logger;
import org.hpccsystems.ws.client.gen.axis2.wsresources.latest.ArrayOfEspException;
import org.hpccsystems.ws.client.gen.axis2.wsresources.latest.ServiceQueryResponse;
import org.hpccsystems.ws.client.gen.axis2.wsresources.latest.TargetQueryResponse;
import org.hpccsystems.ws.client.gen.axis2.wsresources.latest.WsResourcesPingRequest;
import org.hpccsystems.ws.client.gen.axis2.wsresources.latest.WsResourcesStub;
import org.hpccsystems.ws.client.gen.axis2.wsresources.latest.WebLinksQueryResponse;
import org.hpccsystems.ws.client.utils.Connection;
import org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper;
import org.hpccsystems.ws.client.wrappers.gen.wsresources.ServiceQueryRequestWrapper;
import org.hpccsystems.ws.client.wrappers.gen.wsresources.ServiceQueryResponseWrapper;
import org.hpccsystems.ws.client.wrappers.gen.wsresources.TargetQueryRequestWrapper;
import org.hpccsystems.ws.client.wrappers.gen.wsresources.TargetQueryResponseWrapper;
import org.hpccsystems.ws.client.wrappers.gen.wsresources.WebLinksQueryRequestWrapper;
import org.hpccsystems.ws.client.wrappers.gen.wsresources.WebLinksQueryResponseWrapper;


/**
* Facilitates discovery of containerized HPCC Systems resources.
Expand All @@ -48,7 +55,7 @@ public class HPCCWsResourcesClient extends BaseHPCCWsClient

/**
* Load WSDLURL.
*/
*/
private static void loadWSDLURL()
{
try
Expand All @@ -67,7 +74,7 @@ private static void loadWSDLURL()
* Gets the service URI.
*
* @return the service URI
*/
*/
public String getServiceURI()
{
return WSRESOURCESURI;
Expand Down Expand Up @@ -116,10 +123,10 @@ public Stub getDefaultStub() throws AxisFault
}

/**
* Gets the.
* Gets the Ws Resources client
*
* @param connection
* the connection
* the connection
* @return the HPCC HPCCWsResources client
*/
public static HPCCWsResourcesClient get(Connection connection)
Expand All @@ -128,7 +135,7 @@ public static HPCCWsResourcesClient get(Connection connection)
}

/**
* Gets the.
* Gets the Ws Resources client
*
* @param protocol
* the protocol
Expand All @@ -150,7 +157,7 @@ public static HPCCWsResourcesClient get(String protocol, String targetHost, Stri
}

/**
* Gets the.
* Gets the Ws Resources client
*
* @param protocol
* the protocol
Expand Down Expand Up @@ -188,7 +195,8 @@ protected HPCCWsResourcesClient(Connection baseConnection)
}

/**
* Initializes the service's underlying stub Should only be used by constructors.
* Initializes the service's underlying stub Should only be used by
* constructors.
*
* @param conn
* -- All connection settings included
Expand Down Expand Up @@ -219,14 +227,19 @@ protected void initWsResourcesClientStub(Connection conn)
/**
* Submit service query request
*
* @param req a {@link org.hpccsystems.ws.client.wrappers.gen.wsresources.ServiceQueryRequestWrapper} object.
* @param req a
* {@link org.hpccsystems.ws.client.wrappers.gen.wsresources.ServiceQueryRequestWrapper}
* object.
* @throws Exception a {@link java.lang.Exception} object.
* @return a {@link org.hpccsystems.ws.client.wrappers.gen.wsresources.ServiceQueryResponseWrapper} object.
* @return a
* {@link org.hpccsystems.ws.client.wrappers.gen.wsresources.ServiceQueryResponseWrapper}
* object.
*/
public ServiceQueryResponseWrapper serviceQuery(ServiceQueryRequestWrapper req) throws Exception
{
if (req == null)
throw new Exception("");
throw new Exception("ServiceQueryRequestWrapper must be provided!");

verifyStub();

ServiceQueryResponse resp = null;
Expand All @@ -249,6 +262,82 @@ public ServiceQueryResponseWrapper serviceQuery(ServiceQueryRequestWrapper req)
return new ServiceQueryResponseWrapper(resp);
}

/**
* Submit target query request
*
* @param req a
* {@link org.hpccsystems.ws.client.wrappers.gen.wsresources.TargetQueryRequestWrapper}
* object.
* @throws Exception a {@link java.lang.Exception} object.
* @return a
* {@link org.hpccsystems.ws.client.wrappers.gen.wsresources.TargetQueryResponseWrapper}
* object.
*/
public TargetQueryResponseWrapper targetQuery(TargetQueryRequestWrapper req) throws Exception
{
if (req == null)
throw new Exception("TargetQueryRequestWrapper must be provided!");

verifyStub();

TargetQueryResponse resp = null;

try
{
resp = ((WsResourcesStub) stub).targetQuery(req.getRaw());
}
catch (RemoteException e)
{
throw new Exception("HPCCWSRESOURCESClient.targetQuery(TargetQueryRequestWrapper) encountered RemoteException.", e);
}

if (resp.getExceptions() != null)
{
ArrayOfEspException exceptions = resp.getExceptions();
handleEspExceptions(new ArrayOfEspExceptionWrapper(exceptions), "Error processing service query");
}

return new TargetQueryResponseWrapper(resp);
}

/**
* Submit WebLinks query request
*
* @param req a
* {@link org.hpccsystems.ws.client.wrappers.gen.wsresources.WebLinksRequestWrapper}
* object.
* @throws Exception a {@link java.lang.Exception} object.
* @return a
* {@link org.hpccsystems.ws.client.wrappers.gen.wsresources.WebLinksResponseWrapper}
* object.
*/
public WebLinksQueryResponseWrapper webLinks(WebLinksQueryRequestWrapper req) throws Exception
{
if (req == null)
throw new Exception("WebLinksQueryRequestWrapper must be provided!");

verifyStub();

WebLinksQueryResponse resp = null;

try
{
resp = ((WsResourcesStub) stub).webLinksQuery(req.getRaw());
}
catch (RemoteException e)
{
throw new Exception("HPCCWSRESOURCESClient.webLinksQuery(WebLinksQueryRequestWrapper) encountered RemoteException.", e);
}

if (resp.getExceptions() != null)
{
ArrayOfEspException exceptions = resp.getExceptions();
handleEspExceptions(new ArrayOfEspExceptionWrapper(exceptions), "Error processing service query");
}

return new WebLinksQueryResponseWrapper(resp);
}

/**
* Ping.
*
Expand Down
Loading
Loading