Search in sources :

Example 1 with IThinServiceInformation

use of org.pentaho.di.trans.dataservice.jdbc.api.IThinServiceInformation in project pdi-dataservice-server-plugin by pentaho.

the class DataServiceClient method getServiceInformation.

@Override
public List<IThinServiceInformation> getServiceInformation() throws SQLException {
    List<IThinServiceInformation> services = Lists.newArrayList();
    for (DataServiceMeta service : resolver.getDataServices(logErrors()::apply)) {
        TransMeta transMeta = service.getServiceTrans();
        try {
            transMeta.activateParameters();
            RowMetaInterface serviceFields = transMeta.getStepFields(service.getStepname());
            IThinServiceInformation serviceInformation = new ThinServiceInformation(service.getName(), service.isStreaming(), serviceFields);
            services.add(serviceInformation);
        } catch (Exception e) {
            String message = MessageFormat.format("Unable to get fields for service {0}, transformation: {1}", service.getName(), transMeta.getName());
            log.logError(message, e);
        }
    }
    return services;
}
Also used : DataServiceMeta(org.pentaho.di.trans.dataservice.DataServiceMeta) TransMeta(org.pentaho.di.trans.TransMeta) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) IThinServiceInformation(org.pentaho.di.trans.dataservice.jdbc.api.IThinServiceInformation) ThinServiceInformation(org.pentaho.di.trans.dataservice.jdbc.ThinServiceInformation) IThinServiceInformation(org.pentaho.di.trans.dataservice.jdbc.api.IThinServiceInformation) KettleException(org.pentaho.di.core.exception.KettleException) SQLException(java.sql.SQLException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 SQLException (java.sql.SQLException)1 KettleException (org.pentaho.di.core.exception.KettleException)1 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)1 TransMeta (org.pentaho.di.trans.TransMeta)1 DataServiceMeta (org.pentaho.di.trans.dataservice.DataServiceMeta)1 ThinServiceInformation (org.pentaho.di.trans.dataservice.jdbc.ThinServiceInformation)1 IThinServiceInformation (org.pentaho.di.trans.dataservice.jdbc.api.IThinServiceInformation)1