/** * Return the Oozie URL used by the client and server for WS communications. * <p/> * This URL is the original URL plus the versioning element path. * * @return the Oozie URL used by the client and server for communication. * @throws OozieClientException thrown in the client and the server are not protocol compatible. */ public String getProtocolUrl() throws OozieClientException { validateWSVersion(); return protocolUrl; }
/** * Return the Oozie URL used by the client and server for WS communications. * <p> * This URL is the original URL plus the versioning element path. * * @return the Oozie URL used by the client and server for communication. * @throws OozieClientException thrown in the client and the server are not protocol compatible. */ public String getProtocolUrl() throws OozieClientException { validateWSVersion(); return protocolUrl; }
/** * Return the Oozie URL used by the client and server for WS communications. * <p> * This URL is the original URL plus the versioning element path. * * @return the Oozie URL used by the client and server for communication. * @throws OozieClientException thrown in the client and the server are not protocol compatible. */ public String getProtocolUrl() throws OozieClientException { validateWSVersion(); return protocolUrl; }
/** * Return the Oozie URL used by the client and server for WS communications. * <p/> * This URL is the original URL plus the versioning element path. * * @return the Oozie URL used by the client and server for communication. * @throws OozieClientException thrown in the client and the server are not protocol compatible. */ public String getProtocolUrl() throws OozieClientException { validateWSVersion(); return protocolUrl; }
private void checkOozieConnection(final OozieClient client) throws OozieClientException { System.out.print("Checking Connection..."); client.validateWSVersion(); System.out.println("Done"); }
private URL createURL(String collection, String resource, Map<String, String> parameters) throws IOException, OozieClientException { validateWSVersion(); StringBuilder sb = new StringBuilder(); sb.append(protocolUrl).append(collection); if (resource != null && resource.length() > 0) { sb.append("/").append(resource); } if (parameters.size() > 0) { String separator = "?"; for (Map.Entry<String, String> param : parameters.entrySet()) { if (param.getValue() != null) { sb.append(separator).append(URLEncoder.encode(param.getKey(), "UTF-8")).append("=").append( URLEncoder.encode(param.getValue(), "UTF-8")); separator = "&"; } } } return new URL(sb.toString()); }
private URL createURL(String collection, String resource, Map<String, String> parameters) throws IOException, OozieClientException { validateWSVersion(); StringBuilder sb = new StringBuilder(); sb.append(protocolUrl).append(collection); if (resource != null && resource.length() > 0) { sb.append("/").append(resource); } if (parameters.size() > 0) { String separator = "?"; for (Map.Entry<String, String> param : parameters.entrySet()) { if (param.getValue() != null) { sb.append(separator).append(URLEncoder.encode(param.getKey(), "UTF-8")).append("=").append( URLEncoder.encode(param.getValue(), "UTF-8")); separator = "&"; } } } return new URL(sb.toString()); }
private URL createURL(Long protocolVersion, String collection, String resource, Map<String, String> parameters) throws IOException, OozieClientException { validateWSVersion(); StringBuilder sb = new StringBuilder(); if (protocolVersion == null) { sb.append(protocolUrl); } else { sb.append(getBaseURLForVersion(protocolVersion)); } sb.append(collection); if (resource != null && resource.length() > 0) { sb.append("/").append(resource); } if (parameters.size() > 0) { String separator = "?"; for (Map.Entry<String, String> param : parameters.entrySet()) { if (param.getValue() != null) { sb.append(separator).append(URLEncoder.encode(param.getKey(), Charsets.UTF_8.name())).append("=").append( URLEncoder.encode(param.getValue(), Charsets.UTF_8.name())); separator = "&"; } } } return new URL(sb.toString()); }
private URL createURL(Long protocolVersion, String collection, String resource, Map<String, String> parameters) throws IOException, OozieClientException { validateWSVersion(); StringBuilder sb = new StringBuilder(); if (protocolVersion == null) { sb.append(protocolUrl); } else { sb.append(getBaseURLForVersion(protocolVersion)); } sb.append(collection); if (resource != null && resource.length() > 0) { sb.append("/").append(resource); } if (parameters.size() > 0) { String separator = "?"; for (Map.Entry<String, String> param : parameters.entrySet()) { if (param.getValue() != null) { sb.append(separator).append(URLEncoder.encode(param.getKey(), Charsets.UTF_8.name())).append("=").append( URLEncoder.encode(param.getValue(), Charsets.UTF_8.name())); separator = "&"; } } } return new URL(sb.toString()); }
@Override public void validateWSVersion() throws OozieClientException { try { delegate.validateWSVersion(); } catch ( org.apache.oozie.client.OozieClientException e ) { throw new OozieClientException( e, e.getErrorCode() ); } }
@Override public void validateWSVersion() throws OozieClientException { try { delegate.validateWSVersion(); } catch ( org.apache.oozie.client.OozieClientException e ) { throw new OozieClientException( e, e.getErrorCode() ); } }
public Void call() throws Exception { String oozieUrl = getContextURL(); OozieClient wc = new OozieClient(oozieUrl); wc.validateWSVersion(); return null; } });
public void testValidateWSVersion() throws IOException, OozieClientException { OozieClient client = LocalOozie.getCoordClient(); client.validateWSVersion(); }
public Void call() throws Exception { HeaderTestingVersionServlet.OOZIE_HEADERS.clear(); String oozieUrl = getContextURL(); OozieClient wc = new OozieClient(oozieUrl); wc.setHeader("header", "test"); assertEquals("test", wc.getHeader("header")); assertEquals("test", wc.getHeaders().get("header")); boolean found = false; for (Iterator<String> headers = wc.getHeaderNames(); headers.hasNext();) { if ("header".equals(headers.next())) { found = true; } } assertTrue("headers does not contain header!", found); wc.validateWSVersion(); assertTrue(HeaderTestingVersionServlet.OOZIE_HEADERS.containsKey("header")); assertTrue(HeaderTestingVersionServlet.OOZIE_HEADERS.containsValue("test")); wc.removeHeader("header"); assertNull(wc.getHeader("header")); return null; } });