Table of Contents

Search

  1. Preface
  2. Introduction to Edge Data Streaming Custom Entity Types
  3. Managing Custom Entity Types
  4. Custom Entities from Maven Archetypes
  5. REST APIs
  6. HTTP Request and Response Parameters
  7. Sample JSON Requests and Responses
  8. Glossary

Developer Guide

Developer Guide

Implementing the VDSTarget Interface

Implementing the VDSTarget Interface

Implement the
VDSTarget
interface to create a custom target service type.
The following sample code shows how to implement the
VDSTarget
interface:
package ...; import java.io.IOException; import java.nio.ByteBuffer; import com.informatica.vds.api.VDSConfiguration; import com.informatica.vds.api.VDSEvent; import com.informatica.vds.api.VDSTarget; public class CustomTarget implements VDSTarget { @Override public void close() throws IOException { /* Close the connection to the target and clean up. */ ... } /* Initialize the VDSTarget object. */ @Override public void open(VDSConfiguration vdsconfiguration) throws Exception { /* The internal name of the key. */ String fieldName = "TargetURLFromUI"; /* The default value for the key. */ String defaultValue = "TargetURLDefault"; /* Retrieve the value of the key TargetURLFromUI. */ String TargetURL = vdsconfiguration.optString(fieldName, defaultValue ); /* Similarly, retrieve other keys. */ ... /* Create or initialize the target by using the configuration * information. */ ... } /* Get data and write the data to the target. */ @Override public void write(VDSEvent vdsevent) throws Exception { /* Get data and collect it in a byte array. */ ByteBuffer bytebuff = vdsevent.getBuffer(); byte[] bytearr = new byte[vdsevent.getBufferLen()]; bytebuff.get(bytearr); /* Write the data to the target. */ ... } @Override public void setRetryPolicyHandler(IPluginRetryPolicy arg0) { // TODO Auto-generated method stub } }

0 COMMENTS

We’d like to hear from you!