public WorkflowManagerUtils(URL url) { this.client = RpcCommunicationFactory.createClient(url); this.wmUrl = url; }
public static WorkflowManager createServer(int port) { try { WorkflowManagerFactory workflowManagerFactory = (WorkflowManagerFactory) Class.forName(getRpcServerClassName()).newInstance(); workflowManagerFactory.setPort(port); logger.debug("Using workflow manager server factory : {}", workflowManagerFactory.getClass()); return workflowManagerFactory.createServer(); } catch (Exception e) { logger.error("Error creating server", e); throw new IllegalStateException("Unable to create server", e); } }
public static WorkflowManagerClient createClient(URL url) { try { WorkflowManagerFactory workflowManagerFactory = (WorkflowManagerFactory) Class.forName(getRpcClientClassName()).newInstance(); workflowManagerFactory.setUrl(url); logger.debug("Using workflow manager client factory : {}", workflowManagerFactory.getClass()); return workflowManagerFactory.createClient(); } catch (Exception e) { logger.error("Unable to create client", e); throw new IllegalStateException("Unable to create client", e); } } }
final WorkflowManager manager = RpcCommunicationFactory.createServer(portNum);
public InstanceRepoCleaner(String wmUrlStr) throws MalformedURLException { this.wm = RpcCommunicationFactory.createClient(new URL(wmUrlStr)); }
public WorkflowMgrConn(String wmUrlStr) { try { this.wm = RpcCommunicationFactory.createClient(new URL(wmUrlStr)); } catch (MalformedURLException e) { LOG.log(Level.SEVERE, "Unable to contact Workflow Manager at URL: [" + wmUrlStr + "]: Message: " + e.getMessage()); this.wm = null; } }
protected WorkflowManagerClient getWorkflowManagerClient() throws MalformedURLException { if (this.wmClient == null) { String url = pgeMetadata.getMetadata(WORKFLOW_MANAGER_URL); logger.info("Creating WorkflowManager client for url [" + url + "]"); Validate.notNull(url, "Must specify " + WORKFLOW_MANAGER_URL); this.wmClient = RpcCommunicationFactory.createClient(new URL(url)); } return this.wmClient; }
private WorkflowManagerClient createWorkflowMangerClient(Metadata metadata) { URL url; try { url = new URL(metadata.getMetadata(CoreMetKeys.WORKFLOW_MANAGER_URL)); return RpcCommunicationFactory.createClient(url); } catch (MalformedURLException e) { e.printStackTrace(); } return null; }
private void setWorkflowMgrUrl(String wmUrlStr) { System.out.println("Connecting to workflow mgr: ["+wmUrlStr+"]"); this.client = RpcCommunicationFactory.createClient(safeGetUrl(wmUrlStr)); }
protected synchronized WorkflowManagerClient getClient() throws MalformedURLException { Validate.notNull(getUrl()); if (client == null) { client = RpcCommunicationFactory.createClient(new URL(getUrl())); } return client; }
private WorkflowManagerClient getWmClientFromMetadata(Metadata met) { String workflowMgrUrlStr = met.getMetadata(WORKFLOW_MANAGER_URL); if (workflowMgrUrlStr == null || (workflowMgrUrlStr.equals(""))) { // try to default to a workflow mgr on localhost // most likely won't work, but worth trying workflowMgrUrlStr = "http://localhost:9001"; } return RpcCommunicationFactory.createClient(safeGetUrlFromString(workflowMgrUrlStr)); }
public boolean performAction(File product, Metadata productMetadata) throws CrawlerActionException { try { WorkflowManagerClient wClient = RpcCommunicationFactory.createClient(new URL(this.workflowMgrUrl)); String ingestSuffix = this.ingestSuffix; return wClient.sendEvent(productMetadata.getMetadata(PRODUCT_TYPE) + ingestSuffix, productMetadata); } catch (Exception e) { throw new CrawlerActionException( "Failed to update workflow manager : " + e.getMessage(), e); } }
@Override public void run(Metadata metadata, WorkflowTaskConfiguration config) throws WorkflowTaskInstanceException { try (WorkflowManagerClient wm = RpcCommunicationFactory .createClient(new URL(metadata.getMetadata(CoreMetKeys.WORKFLOW_MANAGER_URL)))) { wm.sendEvent(config.getProperty("eventName"), metadata); } catch (Exception e) { throw new WorkflowTaskInstanceException(e.getMessage()); } } }
client = RpcCommunicationFactory.createClient(url); context.setAttribute(ATTR_NAME_CLIENT, client); } catch (MalformedURLException e) {