com.endeca.portal.dataenrichment.util
Class EnrichmentPipelineUtil

java.lang.Object
  extended by com.endeca.portal.dataenrichment.util.EnrichmentPipelineUtil

public final class EnrichmentPipelineUtil
extends java.lang.Object


Nested Class Summary
static class EnrichmentPipelineUtil.Status
           
 
Constructor Summary
EnrichmentPipelineUtil(java.lang.String ds, java.lang.String dataDomainName, java.lang.String host, int port, SSLConfig sslConfig)
           
 
Method Summary
 void addResource(java.io.File file, java.lang.String plugin, java.lang.String locale)
          Add a resource for a plugin from a file
 void addResource(java.lang.String name, java.lang.String res, java.lang.String plugin, java.lang.String locale)
          Add a resource for a plugin from a string
 void cancelPipeline(java.lang.String requestId, java.lang.String locale)
          Cancel a pipeline
 void cancelPipelineByName(java.lang.String pipelineName, java.lang.String locale)
           
 boolean containsResource(java.lang.String name, java.lang.String locale)
          Check for the existence of a resource by name
 void createPipeline(com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.types.Pipeline pipeline, java.lang.String txId, java.lang.String locale)
          Create a pipeline
 void createPlugin(java.lang.String fileName, java.lang.String locale)
          Upload a plugin
 void deleteAllPipelines(java.lang.String datasetName, java.lang.String txId, java.lang.String locale)
          Delete all pipelines associated with a data set.
 void deletePipeline(java.lang.String pipelineName, java.lang.String txId, java.lang.String locale)
          Delete a pipeline
 void deleteResoure(java.lang.String name, java.lang.String locale)
           
 com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.types.Pipeline exportPipeline(java.lang.String pipelineName, java.lang.String txId, java.lang.String locale)
          Retrieve the pipeline object
 com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.types.Resource exportResource(java.lang.String resourceName, boolean includeContent, java.lang.String locale)
           
 java.util.List<com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.types.Pipeline> getAllPipelinesByDatasetName(java.lang.String datasetName, java.lang.String locale)
          Gets all pipelines for a given data set.
 CollectionBaseView getCollection(javax.portlet.PortletRequest request, java.lang.String viewKey, java.lang.String locale)
           
 EnrichmentPipelineUtil.Status getEnrichmentsStatus(java.lang.String datasetName, java.lang.String locale)
          Get the Enrichment Status for a given data set.
 org.json.JSONObject getPipelineStatus(javax.portlet.PortletRequest request, java.util.List<java.lang.String> pipelineNames, java.lang.String locale)
          Returns a JSONObject will the status of the most recent run of all pipelines passed in.
 com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.types.RequestDetail getRequestDetails(java.lang.String taskID, java.lang.String locale)
           
 java.util.List<java.lang.String> getRequestIdsByPipeline(java.lang.String pipelineName, java.lang.String locale)
          Get all request IDs for a pipeline
 boolean hasValidInputAttribute(javax.portlet.PortletRequest request, com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.types.Pipeline p, java.lang.String locale)
           
 boolean hasValidInputAttribute(javax.portlet.PortletRequest request, java.lang.String pipelineName, java.lang.String locale)
           
 boolean isAssociatedResourceToPlugin(java.lang.String name, java.lang.String plugin, java.lang.String txId, java.lang.String locale)
          Check to see what plugin a resource is associated with.
 boolean isInputAttributeSet(javax.portlet.PortletRequest request, java.lang.String collectionName, java.lang.String attrName, java.lang.String locale)
           
 java.util.Collection<java.lang.String> listAllPipelines(java.lang.String txId, java.lang.String locale)
          Get all pipeline names
 com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.types.RequestDetail submitTask(java.lang.String pipelineName, java.lang.String locale)
          Run a pipeline
 void updatePipeline(com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.types.Pipeline pipeline, java.lang.String txId, java.lang.String locale)
          Create a pipeline
 void updateResource(java.io.File file, java.lang.String plugin, java.lang.String locale)
          Update an existing resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnrichmentPipelineUtil

public EnrichmentPipelineUtil(java.lang.String ds,
                              java.lang.String dataDomainName,
                              java.lang.String host,
                              int port,
                              SSLConfig sslConfig)
Method Detail

addResource

public void addResource(java.io.File file,
                        java.lang.String plugin,
                        java.lang.String locale)
                 throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception,
                        java.net.MalformedURLException
Add a resource for a plugin from a file

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
java.net.MalformedURLException

addResource

public void addResource(java.lang.String name,
                        java.lang.String res,
                        java.lang.String plugin,
                        java.lang.String locale)
                 throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception,
                        java.net.MalformedURLException,
                        java.io.UnsupportedEncodingException
Add a resource for a plugin from a string

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
java.net.MalformedURLException
java.io.UnsupportedEncodingException

exportResource

public com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.types.Resource exportResource(java.lang.String resourceName,
                                                                                             boolean includeContent,
                                                                                             java.lang.String locale)
                                                                                      throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception

updateResource

public void updateResource(java.io.File file,
                           java.lang.String plugin,
                           java.lang.String locale)
                    throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
Update an existing resource

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception

containsResource

public boolean containsResource(java.lang.String name,
                                java.lang.String locale)
                         throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
Check for the existence of a resource by name

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception

isAssociatedResourceToPlugin

public boolean isAssociatedResourceToPlugin(java.lang.String name,
                                            java.lang.String plugin,
                                            java.lang.String txId,
                                            java.lang.String locale)
                                     throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
Check to see what plugin a resource is associated with. For Studio's purposes, resources will only ever belong to one plugin and one pipeline

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception

deletePipeline

public void deletePipeline(java.lang.String pipelineName,
                           java.lang.String txId,
                           java.lang.String locale)
                    throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception,
                           com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception
Delete a pipeline

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception

deleteResoure

public void deleteResoure(java.lang.String name,
                          java.lang.String locale)
                   throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception

createPipeline

public void createPipeline(com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.types.Pipeline pipeline,
                           java.lang.String txId,
                           java.lang.String locale)
                    throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
Create a pipeline

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception

updatePipeline

public void updatePipeline(com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.types.Pipeline pipeline,
                           java.lang.String txId,
                           java.lang.String locale)
                    throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
Create a pipeline

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception

exportPipeline

public com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.types.Pipeline exportPipeline(java.lang.String pipelineName,
                                                                                             java.lang.String txId,
                                                                                             java.lang.String locale)
                                                                                      throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
Retrieve the pipeline object

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception

cancelPipeline

public void cancelPipeline(java.lang.String requestId,
                           java.lang.String locale)
                    throws com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception
Cancel a pipeline

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception

cancelPipelineByName

public void cancelPipelineByName(java.lang.String pipelineName,
                                 java.lang.String locale)
                          throws com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception
Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception

getRequestIdsByPipeline

public java.util.List<java.lang.String> getRequestIdsByPipeline(java.lang.String pipelineName,
                                                                java.lang.String locale)
                                                         throws com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception
Get all request IDs for a pipeline

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception

createPlugin

public void createPlugin(java.lang.String fileName,
                         java.lang.String locale)
                  throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
Upload a plugin

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception

submitTask

public com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.types.RequestDetail submitTask(java.lang.String pipelineName,
                                                                                            java.lang.String locale)
                                                                                     throws com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception
Run a pipeline

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception

listAllPipelines

public java.util.Collection<java.lang.String> listAllPipelines(java.lang.String txId,
                                                               java.lang.String locale)
                                                        throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
Get all pipeline names

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception

getRequestDetails

public com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.types.RequestDetail getRequestDetails(java.lang.String taskID,
                                                                                                   java.lang.String locale)
                                                                                            throws com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception
Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception

deleteAllPipelines

public void deleteAllPipelines(java.lang.String datasetName,
                               java.lang.String txId,
                               java.lang.String locale)
                        throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception,
                               com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception
Delete all pipelines associated with a data set. Used for clean up when deleting a data set.

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception

getEnrichmentsStatus

public EnrichmentPipelineUtil.Status getEnrichmentsStatus(java.lang.String datasetName,
                                                          java.lang.String locale)
                                                   throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception,
                                                          com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception
Get the Enrichment Status for a given data set. This in effect returns the "worst" state that a data set's pipelines are in. The order is treated as follows: FAILED > FAILING > EXECUTING > LAUNCHING > CANCELLING > CANCELLED/COMPLETED

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception

getPipelineStatus

public org.json.JSONObject getPipelineStatus(javax.portlet.PortletRequest request,
                                             java.util.List<java.lang.String> pipelineNames,
                                             java.lang.String locale)
                                      throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception,
                                             com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception,
                                             org.json.JSONException,
                                             DataSourceException,
                                             KeyNotFoundException
Returns a JSONObject will the status of the most recent run of all pipelines passed in.

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception
org.json.JSONException
DataSourceException
KeyNotFoundException

getAllPipelinesByDatasetName

public java.util.List<com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.types.Pipeline> getAllPipelinesByDatasetName(java.lang.String datasetName,
                                                                                                                           java.lang.String locale)
                                                                                                                    throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception,
                                                                                                                           com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception
Gets all pipelines for a given data set. As pipelines are a data domain level entity, but Studio treats it as a data set level entity, this utility method will pull out all pipelines for a given data set.

Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
com.oracle.endeca.pdi.bindings.cxf.enrichment.task._1.TaskFault_Exception

hasValidInputAttribute

public boolean hasValidInputAttribute(javax.portlet.PortletRequest request,
                                      java.lang.String pipelineName,
                                      java.lang.String locale)
                               throws com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception,
                                      DataSourceException,
                                      KeyNotFoundException
Throws:
com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.ConfigurationFault_Exception
DataSourceException
KeyNotFoundException

hasValidInputAttribute

public boolean hasValidInputAttribute(javax.portlet.PortletRequest request,
                                      com.oracle.endeca.pdi.bindings.cxf.enrichment.config._1.types.Pipeline p,
                                      java.lang.String locale)
                               throws DataSourceException,
                                      KeyNotFoundException
Throws:
DataSourceException
KeyNotFoundException

isInputAttributeSet

public boolean isInputAttributeSet(javax.portlet.PortletRequest request,
                                   java.lang.String collectionName,
                                   java.lang.String attrName,
                                   java.lang.String locale)
                            throws DataSourceException,
                                   KeyNotFoundException
Throws:
DataSourceException
KeyNotFoundException

getCollection

public CollectionBaseView getCollection(javax.portlet.PortletRequest request,
                                        java.lang.String viewKey,
                                        java.lang.String locale)
                                 throws DataSourceException,
                                        KeyNotFoundException
Throws:
DataSourceException
KeyNotFoundException