Informatica Connector Toolkit Developer Guide

Informatica Development Platform
(Version 9.6.1)
Informatica Connector Toolkit
Developer Guide
Informatica Development Platform Informatica Connector Toolkit Developer Guide
Version 9.6.1
June 2014
Copyright (c) 2014 Informatica Corporation. All rights reserved.
This software and documentation contain proprietary information of Informatica Corporation and are provided under a license agreement containing restrictions on use
and disclosure and are also protected by copyright law. Reverse engineering of the software is prohibited. No part of this document may be reproduced or transmitted in
any form, by any means (electronic, photocopying, recording or otherwise) without prior consent of Informatica Corporation. This Software may be protected by U.S.
and/or international Patents and other Patents Pending.
Use, duplication, or disclosure of the Software by the U.S. Government is subject to the restrictions set forth in the applicable software license agreement and as
provided in DFARS 227.7202-1(a) and 227.7702-3(a) (1995), DFARS 252.227-7013©(1)(ii) (OCT 1988), FAR 12.212(a) (1995), FAR 52.227-19, or FAR 52.227-14
(ALT III), as applicable.
The information in this product or documentation is subject to change without notice. If you find any problems in this product or documentation, please report them to us
in writing.
Informatica, Informatica Platform, Informatica Data Services, PowerCenter, PowerCenterRT, PowerCenter Connect, PowerCenter Data Analyzer, PowerExchange,
PowerMart, Metadata Manager, Informatica Data Quality, Informatica Data Explorer, Informatica B2B Data Transformation, Informatica B2B Data Exchange Informatica
On Demand, Informatica Identity Resolution, Informatica Application Information Lifecycle Management, Informatica Complex Event Processing, Ultra Messaging and
Informatica Master Data Management are trademarks or registered trademarks of Informatica Corporation in the United States and in jurisdictions throughout the world.
All other company and product names may be trade names or trademarks of their respective owners.
Portions of this software and/or documentation are subject to copyright held by third parties, including without limitation: Copyright DataDirect Technologies. All rights
reserved. Copyright © Sun Microsystems. All rights reserved. Copyright © RSA Security Inc. All Rights Reserved. Copyright © Ordinal Technology Corp. All rights
reserved.Copyright © Aandacht c.v. All rights reserved. Copyright Genivia, Inc. All rights reserved. Copyright Isomorphic Software. All rights reserved. Copyright © Meta
Integration Technology, Inc. All rights reserved. Copyright © Intalio. All rights reserved. Copyright © Oracle. All rights reserved. Copyright © Adobe Systems
Incorporated. All rights reserved. Copyright © DataArt, Inc. All rights reserved. Copyright © ComponentSource. All rights reserved. Copyright © Microsoft Corporation. All
rights reserved. Copyright © Rogue Wave Software, Inc. All rights reserved. Copyright © Teradata Corporation. All rights reserved. Copyright © Yahoo! Inc. All rights
reserved. Copyright © Glyph & Cog, LLC. All rights reserved. Copyright © Thinkmap, Inc. All rights reserved. Copyright © Clearpace Software Limited. All rights
reserved. Copyright © Information Builders, Inc. All rights reserved. Copyright © OSS Nokalva, Inc. All rights reserved. Copyright Edifecs, Inc. All rights reserved.
Copyright Cleo Communications, Inc. All rights reserved. Copyright © International Organization for Standardization 1986. All rights reserved. Copyright © ejtechnologies GmbH. All rights reserved. Copyright © Jaspersoft Corporation. All rights reserved. Copyright © is International Business Machines Corporation. All rights
reserved. Copyright © yWorks GmbH. All rights reserved. Copyright © Lucent Technologies. All rights reserved. Copyright (c) University of Toronto. All rights reserved.
Copyright © Daniel Veillard. All rights reserved. Copyright © Unicode, Inc. Copyright IBM Corp. All rights reserved. Copyright © MicroQuill Software Publishing, Inc. All
rights reserved. Copyright © PassMark Software Pty Ltd. All rights reserved. Copyright © LogiXML, Inc. All rights reserved. Copyright © 2003-2010 Lorenzi Davide, All
rights reserved. Copyright © Red Hat, Inc. All rights reserved. Copyright © The Board of Trustees of the Leland Stanford Junior University. All rights reserved. Copyright
© EMC Corporation. All rights reserved. Copyright © Flexera Software. All rights reserved. Copyright © Jinfonet Software. All rights reserved. Copyright © Apple Inc. All
rights reserved. Copyright © Telerik Inc. All rights reserved. Copyright © BEA Systems. All rights reserved. Copyright © PDFlib GmbH. All rights reserved. Copyright ©
Orientation in Objects GmbH. All rights reserved. Copyright © Tanuki Software, Ltd. All rights reserved. Copyright © Ricebridge. All rights reserved. Copyright © Sencha,
Inc. All rights reserved.
This product includes software developed by the Apache Software Foundation (http://www.apache.org/), and/or other software which is licensed under various versions
of the Apache License (the "License"). You may obtain a copy of these Licenses at http://www.apache.org/licenses/. Unless required by applicable law or agreed to in
writing, software distributed under these Licenses is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the Licenses for the specific language governing permissions and limitations under the Licenses.
This product includes software which was developed by Mozilla (http://www.mozilla.org/), software copyright The JBoss Group, LLC, all rights reserved; software
copyright © 1999-2006 by Bruno Lowagie and Paulo Soares and other software which is licensed under various versions of the GNU Lesser General Public License
Agreement, which may be found at http:// www.gnu.org/licenses/lgpl.html. The materials are provided free of charge by Informatica, "as-is", without warranty of any
kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose.
The product includes ACE(TM) and TAO(TM) software copyrighted by Douglas C. Schmidt and his research group at Washington University, University of California,
Irvine, and Vanderbilt University, Copyright (©) 1993-2006, all rights reserved.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (copyright The OpenSSL Project. All Rights Reserved) and
redistribution of this software is subject to terms available at http://www.openssl.org and http://www.openssl.org/source/license.html.
This product includes Curl software which is Copyright 1996-2013, Daniel Stenberg, <daniel@haxx.se>. All Rights Reserved. Permissions and limitations regarding this
software are subject to terms available at http://curl.haxx.se/docs/copyright.html. Permission to use, copy, modify, and distribute this software for any purpose with or
without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
The product includes software copyright 2001-2005 (©) MetaStuff, Ltd. All Rights Reserved. Permissions and limitations regarding this software are subject to terms
available at http://www.dom4j.org/ license.html.
The product includes software copyright © 2004-2007, The Dojo Foundation. All Rights Reserved. Permissions and limitations regarding this software are subject to
terms available at http://dojotoolkit.org/license.
This product includes ICU software which is copyright International Business Machines Corporation and others. All rights reserved. Permissions and limitations
regarding this software are subject to terms available at http://source.icu-project.org/repos/icu/icu/trunk/license.html.
This product includes software copyright © 1996-2006 Per Bothner. All rights reserved. Your right to use such materials is set forth in the license which may be found at
http:// www.gnu.org/software/ kawa/Software-License.html.
This product includes OSSP UUID software which is Copyright © 2002 Ralf S. Engelschall, Copyright © 2002 The OSSP Project Copyright © 2002 Cable & Wireless
Deutschland. Permissions and limitations regarding this software are subject to terms available at http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by Boost (http://www.boost.org/) or under the Boost software license. Permissions and limitations regarding this software are
subject to terms available at http:/ /www.boost.org/LICENSE_1_0.txt.
This product includes software copyright © 1997-2007 University of Cambridge. Permissions and limitations regarding this software are subject to terms available at
http:// www.pcre.org/license.txt.
This product includes software copyright © 2007 The Eclipse Foundation. All Rights Reserved. Permissions and limitations regarding this software are subject to terms
available at http:// www.eclipse.org/org/documents/epl-v10.php and at http://www.eclipse.org/org/documents/edl-v10.php.
This product includes software licensed under the terms at http://www.tcl.tk/software/tcltk/license.html, http://www.bosrup.com/web/overlib/?License, http://
www.stlport.org/doc/ license.html, http:// asm.ow2.org/license.html, http://www.cryptix.org/LICENSE.TXT, http://hsqldb.org/web/hsqlLicense.html, http://
httpunit.sourceforge.net/doc/ license.html, http://jung.sourceforge.net/license.txt , http://www.gzip.org/zlib/zlib_license.html, http://www.openldap.org/software/release/
license.html, http://www.libssh2.org, http://slf4j.org/license.html, http://www.sente.ch/software/OpenSourceLicense.html, http://fusesource.com/downloads/licenseagreements/fuse-message-broker-v-5-3- license-agreement; http://antlr.org/license.html; http://aopalliance.sourceforge.net/; http://www.bouncycastle.org/licence.html;
http://www.jgraph.com/jgraphdownload.html; http://www.jcraft.com/jsch/LICENSE.txt; http://jotm.objectweb.org/bsd_license.html; . http://www.w3.org/Consortium/Legal/
2002/copyright-software-20021231; http://www.slf4j.org/license.html; http://nanoxml.sourceforge.net/orig/copyright.html; http://www.json.org/license.html; http://
forge.ow2.org/projects/javaservice/, http://www.postgresql.org/about/licence.html, http://www.sqlite.org/copyright.html, http://www.tcl.tk/software/tcltk/license.html, http://
www.jaxen.org/faq.html, http://www.jdom.org/docs/faq.html, http://www.slf4j.org/license.html; http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/License; http://
www.keplerproject.org/md5/license.html; http://www.toedter.com/en/jcalendar/license.html; http://www.edankert.com/bounce/index.html; http://www.net-snmp.org/about/
license.html; http://www.openmdx.org/#FAQ; http://www.php.net/license/3_01.txt; http://srp.stanford.edu/license.txt; http://www.schneier.com/blowfish.html; http://
www.jmock.org/license.html; http://xsom.java.net; http://benalman.com/about/license/; https://github.com/CreateJS/EaselJS/blob/master/src/easeljs/display/Bitmap.js;
http://www.h2database.com/html/license.html#summary; http://jsoncpp.sourceforge.net/LICENSE; http://jdbc.postgresql.org/license.html; http://
protobuf.googlecode.com/svn/trunk/src/google/protobuf/descriptor.proto; https://github.com/rantav/hector/blob/master/LICENSE; http://web.mit.edu/Kerberos/krb5current/doc/mitK5license.html; http://jibx.sourceforge.net/jibx-license.html; and https://github.com/lyokato/libgeohash/blob/master/LICENSE.
This product includes software licensed under the Academic Free License (http://www.opensource.org/licenses/afl-3.0.php), the Common Development and Distribution
License (http://www.opensource.org/licenses/cddl1.php) the Common Public License (http://www.opensource.org/licenses/cpl1.0.php), the Sun Binary Code License
Agreement Supplemental License Terms, the BSD License (http:// www.opensource.org/licenses/bsd-license.php), the new BSD License (http://opensource.org/
licenses/BSD-3-Clause), the MIT License (http://www.opensource.org/licenses/mit-license.php), the Artistic License (http://www.opensource.org/licenses/artisticlicense-1.0) and the Initial Developer’s Public License Version 1.0 (http://www.firebirdsql.org/en/initial-developer-s-public-license-version-1-0/).
This product includes software copyright © 2003-2006 Joe WaInes, 2006-2007 XStream Committers. All rights reserved. Permissions and limitations regarding this
software are subject to terms available at http://xstream.codehaus.org/license.html. This product includes software developed by the Indiana University Extreme! Lab.
For further information please visit http://www.extreme.indiana.edu/.
This product includes software Copyright (c) 2013 Frank Balluffi and Markus Moeller. All rights reserved. Permissions and limitations regarding this software are subject
to terms of the MIT license.
This Software is protected by U.S. Patent Numbers 5,794,246; 6,014,670; 6,016,501; 6,029,178; 6,032,158; 6,035,307; 6,044,374; 6,092,086; 6,208,990; 6,339,775;
6,640,226; 6,789,096; 6,823,373; 6,850,947; 6,895,471; 7,117,215; 7,162,643; 7,243,110; 7,254,590; 7,281,001; 7,421,458; 7,496,588; 7,523,121; 7,584,422;
7,676,516; 7,720,842; 7,721,270; 7,774,791; 8,065,266; 8,150,803; 8,166,048; 8,166,071; 8,200,622; 8,224,873; 8,271,477; 8,327,419; 8,386,435; 8,392,460;
8,453,159; 8,458,230; and RE44,478, International Patents and other Patents Pending.
DISCLAIMER: Informatica Corporation provides this documentation "as is" without warranty of any kind, either express or implied, including, but not limited to, the
implied warranties of noninfringement, merchantability, or use for a particular purpose. Informatica Corporation does not warrant that this software or documentation is
error free. The information provided in this software or documentation may include technical inaccuracies or typographical errors. The information in this software and
documentation is subject to change at any time without notice.
NOTICES
This Informatica product (the "Software") includes certain drivers (the "DataDirect Drivers") from DataDirect Technologies, an operating company of Progress Software
Corporation ("DataDirect") which are subject to the following terms and conditions:
1. THE DATADIRECT DRIVERS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
2. IN NO EVENT WILL DATADIRECT OR ITS THIRD PARTY SUPPLIERS BE LIABLE TO THE END-USER CUSTOMER FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, CONSEQUENTIAL OR OTHER DAMAGES ARISING OUT OF THE USE OF THE ODBC DRIVERS, WHETHER OR NOT
INFORMED OF THE POSSIBILITIES OF DAMAGES IN ADVANCE. THESE LIMITATIONS APPLY TO ALL CAUSES OF ACTION, INCLUDING, WITHOUT
LIMITATION, BREACH OF CONTRACT, BREACH OF WARRANTY, NEGLIGENCE, STRICT LIABILITY, MISREPRESENTATION AND OTHER TORTS.
Part Number: DP-DAG-96100-0001
Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
Informatica Resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
Informatica My Support Portal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
Informatica Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
Informatica Web Site. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
Informatica How-To Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
Informatica Knowledge Base. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Informatica Support YouTube Channel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Informatica Marketplace. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Informatica Velocity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Informatica Global Customer Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Chapter 1: Introduction to the Informatica Connector Toolkit. . . . . . . . . . . . . . . . . . . 1
Overview of the Informatica Connector Toolkit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Informatica Connector Perspective. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Connector Navigator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Connector Progress. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Chapter 2: Installing the Informatica Connector Toolkit. . . . . . . . . . . . . . . . . . . . . . . . . 4
Installing the Informatica Connector Toolkit Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Before You Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Install Required Software. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Step 1. Install Eclipse IDE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Step 2. Install the Informatica Connector Toolkit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Installed Informatica Connector Toolkit Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Step 3. Set Up the Eclipse Plug-in. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Chapter 3: Building an Adapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Building an Adapter Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Step 1. Define the Adapter Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Step 2. Define the Connection Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Test and Debug the Connection to the Data Source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Step 3. Define the Type System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Step 4. Define the Adapter Metadata. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Test Metadata from the Data Source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Step 5. Implement the Adapter Run-time Behavior. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Test the Read and Write Capabilities of the Adapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Test the Read Capability of the Adapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Test the Write Capability of the Adapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Table of Contents
i
Step 6. Publish or Deploy the Adapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Manually Install the Adapter (Optional). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Naming Convention. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Chapter 4: Connection Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Connection Attributes Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Connection Attribute Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Chapter 5: Type System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Type System Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Native Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Native Type Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Informatica Platform Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Chapter 6: Metadata Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Metadata Objects Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Metadata Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Import Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Chapter 7: Run-time Behavior. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Run-time Behavior Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Run-time Java Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Chapter 8: Adapter Example: MySQL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
MySQL Adapter Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
MySQL Adapter Requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
MySQL Adapter Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Building the Sample Adapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Chapter 9: Adapter Example: YouTube. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
YouTube Adapter Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
YouTube Adapter Requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
YouTube Adapter Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Building the Sample Adapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Appendix A: Metadata Models. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Metadata Model Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Metadata Model Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Metadata Patterns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Features of Type A Metadata Template. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Appendix B: ASO Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
ASO Model Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
ii
Table of Contents
ASO Model Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
ASO Projections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Table of Contents
iii
Preface
The Informatica Connector Toolkit Developer Guide is written for independent software vendors, consulting
organizations, and developers who want to develop adapters for the Informatica platform.
This guide assumes you have a working knowledge of Informatica services and are familiar with data
sources, ODBC, JDBC, and APIs.
Informatica Resources
Informatica My Support Portal
As an Informatica customer, you can access the Informatica My Support Portal at
http://mysupport.informatica.com.
The site contains product information, user group information, newsletters, access to the Informatica
customer support case management system (ATLAS), the Informatica How-To Library, the Informatica
Knowledge Base, Informatica Product Documentation, and access to the Informatica user community.
Informatica Documentation
The Informatica Documentation team takes every effort to create accurate, usable documentation. If you
have questions, comments, or ideas about this documentation, contact the Informatica Documentation team
through email at infa_documentation@informatica.com. We will use your feedback to improve our
documentation. Let us know if we can contact you regarding your comments.
The Documentation team updates documentation as needed. To get the latest documentation for your
product, navigate to Product Documentation from http://mysupport.informatica.com.
Informatica Web Site
You can access the Informatica corporate web site at http://www.informatica.com. The site contains
information about Informatica, its background, upcoming events, and sales offices. You will also find product
and partner information. The services area of the site includes important information about technical support,
training and education, and implementation services.
Informatica How-To Library
As an Informatica customer, you can access the Informatica How-To Library at
http://mysupport.informatica.com. The How-To Library is a collection of resources to help you learn more
about Informatica products and features. It includes articles and interactive demonstrations that provide
iv
solutions to common problems, compare features and behaviors, and guide you through performing specific
real-world tasks.
Informatica Knowledge Base
As an Informatica customer, you can access the Informatica Knowledge Base at
http://mysupport.informatica.com. Use the Knowledge Base to search for documented solutions to known
technical issues about Informatica products. You can also find answers to frequently asked questions,
technical white papers, and technical tips. If you have questions, comments, or ideas about the Knowledge
Base, contact the Informatica Knowledge Base team through email at KB_Feedback@informatica.com.
Informatica Support YouTube Channel
You can access the Informatica Support YouTube channel at http://www.youtube.com/user/INFASupport. The
Informatica Support YouTube channel includes videos about solutions that guide you through performing
specific tasks. If you have questions, comments, or ideas about the Informatica Support YouTube channel,
contact the Support YouTube team through email at supportvideos@informatica.com or send a tweet to
@INFASupport.
Informatica Marketplace
The Informatica Marketplace is a forum where developers and partners can share solutions that augment,
extend, or enhance data integration implementations. By leveraging any of the hundreds of solutions
available on the Marketplace, you can improve your productivity and speed up time to implementation on
your projects. You can access Informatica Marketplace at http://www.informaticamarketplace.com.
Informatica Velocity
You can access Informatica Velocity at http://mysupport.informatica.com. Developed from the real-world
experience of hundreds of data management projects, Informatica Velocity represents the collective
knowledge of our consultants who have worked with organizations from around the world to plan, develop,
deploy, and maintain successful data management solutions. If you have questions, comments, or ideas
about Informatica Velocity, contact Informatica Professional Services at ips@informatica.com.
Informatica Global Customer Support
You can contact a Customer Support Center by telephone or through the Online Support.
Online Support requires a user name and password. You can request a user name and password at
http://mysupport.informatica.com.
The telephone numbers for Informatica Global Customer Support are available from the Informatica web site
at http://www.informatica.com/us/services-and-training/support-services/global-support-centers/.
Preface
v
CHAPTER 1
Introduction to the Informatica
Connector Toolkit
This chapter includes the following topics:
•
Overview of the Informatica Connector Toolkit, 1
•
Informatica Connector Perspective, 2
•
Architecture, 3
Overview of the Informatica Connector Toolkit
Use the Informatica Connector Toolkit to build an adapter that provides connectivity between a data source
and the Informatica platform.
Although Informatica supports generic ODBC connectivity and allows access to any data source that has a
standards-compliant ODBC driver, there are advantages to building an adapter using the Informatica
Connector Toolkit. In cases where there is no ODBC driver available, building an adapter using the
Informatica Connector Toolkit may be the only solution.
When you use the Informatica Connector Toolkit to create an adapter, you can build functionality related to
the data source. You can preserve data type integrity and metadata lineage of the data source when you
retain the type system of the data source and perform optimal data type conversions.
The Informatica Connector Toolkit consists of the libraries, plug-ins, and sample code to assist you in
developing an adapter for the Informatica platform. You can use the Informatica Connector perspective in the
Eclipse IDE to quickly develop an adapter in an Eclipse environment.
The Informatica Connector Toolkit simplifies the following processes:
•
Development. You can use the easy-to-use wizards in the Informatica Connector perspective to rapidly
develop an adapter. The wizards abstract internal components and dependencies when you develop an
adapter.
•
Testing. After you define the adapter components, you can test the connection, metadata, and run-time
components of the adapter.
•
Deployment. You can publish the adapter or deploy the adapter. You can publish the adapter and
manually install the adapter later. You can deploy the adapter on local Informatica services and clients
and register the adapter on local Informatica services.
The Informatica Connector Toolkit API is written in a Java. The connection definition, metadata definition, and
run-time connectivity interfaces are available in Java.
1
Informatica Connector Perspective
The views in the Informatica Connector perspective enable you to develop an adapter for the Informatica
platform.
When you click the Create New Connector icon in the Eclipse Workbench toolbar, you can choose to switch
to the Informatica Connector perspective. You can also open the Informatica Connector perspective from the
Window menu in the Eclipse IDE.
The Informatica Connector perspective consists of the Connector Navigator view and the Connector Progress
view in the Eclipse Workbench window. You can use the Connector Navigator view to define, edit, or test the
adapter components. You can use the Connector Progress view to define, edit, or test the adapter
components and view the progress of the adapter project.
Connector Navigator
You can use the Connector Navigator view to add, define, edit, or test adapter components such as
connection, metadata, and run time.
After you create an Informatica connector project, you can right-click on folders in the Connector Navigator
view to define, edit, or test adapter components. You can also right-click on the source files and edit them in
the Eclipse Workbench editor or any other editor.
Connector Progress
You can use the Connector Progress to view the completeness of the connector project and to define or edit
the connector project components in each phase.
The Connector Progress view consists of the following phases:
Connectivity
You can define, edit, or test the connection component of an adapter in the Connectivity phase.
Metadata
You can define and edit type system and native metadata object components of an adapter in the
Metadata phase. You can also test the adapter metadata components in the Metadata phase.
Runtime
You can define, edit, and test the adapter run-time components in the Runtime phase.
Export/Publish
You can publish the adapter to a location or deploy the adapter on local Informatica services and client
directories in the Export/Publish phase.
2
Chapter 1: Introduction to the Informatica Connector Toolkit
Architecture
The following diagram illustrates how an adapter works with the services and tools in the Informatica domain:
The following Informatica application services and tools in the Informatica domain work with the adapter plugin and client plug-in components of the adapter.
Data Integration Service
Uses the adapter plug-in at run time to read data from or write data to the data source.
Developer tool
Uses the client plug-in to create and update connections, import metadata, and perform type system
conversions.
Administrator tool
Uses the adapter plug-in to create and update the connection management properties.
Domain repository
Stores the connection objects that an end user creates using the adapter plug-in.
Model Repository Service
Stores the data source metadata and data source operation that an end user creates using the adapter
plug-in.
Architecture
3
CHAPTER 2
Installing the Informatica
Connector Toolkit
This chapter includes the following topics:
•
Installing the Informatica Connector Toolkit Overview, 4
•
Before You Begin , 5
•
Step 1. Install Eclipse IDE, 5
•
Step 2. Install the Informatica Connector Toolkit, 5
•
Step 3. Set Up the Eclipse Plug-in, 6
Installing the Informatica Connector Toolkit Overview
Install the Informatica Connector Toolkit and set up the Informatica Connector Toolkit Eclipse plug-in. To set
up the Informatica Connector Toolkit Eclipse plug-in, you install the required software on the machine where
you plan to develop the adapter.
The Informatica Connector Toolkit is part of the Informatica Development Platform (IDP). You can use the
Informatica Connector Toolkit installer to install the Informatica Connector Toolkit on the machine in which
you plan to develop an adapter.
You can get the Informatica Connector Toolkit installer from the following sources:
•
Informatica Development Platform installation DVD.
Informatica ships the Informatica SDKs on a separate DVD. Run the Informatica Connector Toolkit
installer to install the Informatica Connector Toolkit on the machine where you plan to do your
development.
•
Informatica electronic software download site.
When you purchase an Informatica product and choose to download the software, you receive a site link,
user ID, and password to access the Informatica electronic software download site. Follow the instructions
on the download site to download the Informatica Connector Toolkit installation file.
•
Informatica Technology Network.
If you are a registered user of the Informatica Technology Network, you can download the Informatica
Connector Toolkit installation file from the Informatica Development Platform page. When you download
the file, the Informatica Development Network provides you with a password. Use this password when you
extract the files from the download file.
When you run the Informatica Connector Toolkit installer, the installer installs the Informatica Connector
Toolkit Eclipse plug-in in the Eclipse IDE.
4
Before You Begin
Before you develop an adapter with the Informatica Connector Toolkit, you need to install the required
software and analyze the data source.
Run the Informatica Connector Toolkit installer to install the Informatica Connector Toolkit on the machine
where you plan to develop the adapter. The Informatica Connector Toolkit contains the binaries, tools,
samples, and documents that you require to build an adapter.
Install Required Software
Install the following software on the machine where you plan to develop the adapter:
•
Eclipse version 4.2.2 or later with support for Plug-in Development Environment (PDE).
•
JDK version 1.7 or later.
•
MySQL Connector/J JDBC driver version 5.1.26 or later if you use the MySQL sample adapter.
•
Informatica services version 9.6 and clients to validate and use the adapter.
Step 1. Install Eclipse IDE
You can install Eclipse IDE on the machine in which you plan to develop the adapter. Use the Eclipse IDE
package to install Eclipse IDE.
You must install Eclipse version 4.2.2 or later for the Informatica Connector Toolkit plug-in to work with the
Eclipse IDE.
You can download the Eclipse IDE package from the following location:
http://www.eclipse.org/downloads/
Step 2. Install the Informatica Connector Toolkit
Install the Informatica Connector Toolkit to install the Informatica Connector Toolkit Eclipse plug-in and other
components that you require to build an adapter.
1.
Close all other applications.
2.
Run the install.bat file from the root directory.
3.
In the Welcome page, click Next.
The Installation Directory page appears.
4.
Select the installation directory in which you want to install the Informatica Connector Toolkit.
5.
Select the installation directory in which you installed Eclipse IDE.
6.
Select Install Apache log4j to install the log4j plug-in version that Informatica Connector Toolkit
requires. The installer installs the required Apache log4j plug-in by default. If you have log4j plug-in
installed and do not want to install a different version of the library, clear the Install Apache log4j
option.
Before You Begin
5
7.
Click Next.
The Pre-Installation Summary page appears.
8.
Click Install.
The Installing page appears and displays the installation progress.
9.
Click Done to complete the installation procedure and then exit the installer.
Installed Informatica Connector Toolkit Components
After you install the Informatica SDKs, you can find the Informatica Connector Toolkit in the following
directory:
<IDPInstallationDir>/ICT
The Informatica Connector Toolkit installation includes the following components to assist you in developing
an adapter for the Informatica platform:
•
Informatica Connector Toolkit API files. Library files of the Informatica Connector Toolkit API.
•
Informatica Connector Toolkit Eclipse plug-in. You can use the wizards and menus that the Informatica
Connector Toolkit plug-in adds to the Eclipse IDE to develop, test, and deploy an adapter.
•
Sample MySQL and YouTube adapters. The sample MySQL and YouTube adapters include source code
that you can use as a model to build an adapter.
Note: The sample MySQL and YouTube adapters are for illustration purposes only.
•
Informatica Connector Toolkit API Reference. Online documentation for the Informatica Connector Toolkit
API specification.
Step 3. Set Up the Eclipse Plug-in
After you install the Informatica Connector Toolkit, set up the Informatica Connector Toolkit Eclipse plug-in on
the Eclipse platform.
Complete the following tasks to set up the active target platform in the Eclipse IDE:
6
1.
Launch Eclipse and navigate to Window > Preferences > Plug-in Development > Target Platform.
2.
Select the Running Platform (Active) target definition and click Edit.
3.
On the Locations tab, click Add.
4.
In the Add Content page, select Directory and click Next.
5.
Add the following Informatica Connector Toolkit installation directory and click Finish.
<ICT_Installation_Directory>\Applications\plugins
Chapter 2: Installing the Informatica Connector Toolkit
CHAPTER 3
Building an Adapter
This chapter includes the following topics:
•
Building an Adapter Overview, 7
•
Step 1. Define the Adapter Properties, 8
•
Step 2. Define the Connection Attributes, 8
•
Step 3. Define the Type System, 10
•
Step 4. Define the Adapter Metadata, 11
•
Step 5. Implement the Adapter Run-time Behavior, 13
•
Test the Read and Write Capabilities of the Adapter, 14
•
Step 6. Publish or Deploy the Adapter, 17
•
Manually Install the Adapter (Optional), 18
•
Naming Convention, 18
Building an Adapter Overview
The Informatica Connector Toolkit consists of the libraries, plug-ins, and sample code to assist you in
developing an adapter for the Informatica platform.
To build an adapter, use the Informatica Connector Toolkit and complete the following tasks:
1.
Create an adapter project and define the basic properties of the adapter such as name, ID, and vendor
name.
2.
Define the connection attributes to connect to the data source. Implement the methods to open
connection or close connection to the data source, validate connection, and specify attribute
dependencies. Before you define the type system for the adapter, you can test and debug the connection
components of the adapter.
3.
Define the type system for the adapter. Specify the data types supported by the data source and the
corresponding data types supported by Informatica.
4.
Define the adapter metadata, create native metadata object (NMO), and operations for the NMO.
Implement the methods to fetch metadata from the data source. You can also test and debug the
metadata components of the adapter.
5.
Define the adapter run-time behavior that defines how the adapter reads from and writes to the data
source. Before you deploy the adapter, you can test and debug the read capability and write capability of
the adapter.
7
6.
Deploy the adapter to the Informatica server and client directories and register the adapter with the
Informatica domain.
Step 1. Define the Adapter Properties
The adapter properties describe and identify the adapter in the Informatica domain. Use the Informatica
Connector Toolkit to create an adapter project and define the adapter properties.
1.
2.
3.
From the Eclipse IDE, click the Connector button (
).
The Create Informatica Connector Project dialog box appears.
Enter the following adapter project details:
Property
Description
Connector ID
An identifier that uniquely identifies the adapter. For example:
mysql.
Connector Name
Name of the adapter. The adapter name is an alphanumeric
string. The first character of the name must be a letter. For
example: PowerExchange for MySQL.
Vendor Name
Name of the vendor building the adapter.
Vendor ID
A unique identifier for the vendor.
Version
The version number of the adapter must have the format x.x.x
and must include numeric characters. For example: 1.0.0.
Click Finish.
The adapter project appears in the Connector Navigator view of the Eclipse IDE.
Step 2. Define the Connection Attributes
The connection attributes of an adapter determine how the adapter connects to the data source. Use the
Informatica Connector Toolkit to define the connection attributes and specify the libraries required to connect
to the data source.
8
1.
In the Connector Navigator view, right-click the project and select Add Connection.
The Add Connection dialog box appears.
2.
Enter the connection type name.
3.
Select Add New and enter the category name.
The category name that you configure corresponds to the connection object category.
4.
Click Next.
The Connection Attributes page appears.
5.
Click Add to enter each connection attribute.
Chapter 3: Building an Adapter
The attributes that you configure correspond to the connection object properties. The Add Attribute
dialog box appears.
6.
Enter the following properties for the connection attribute:
Attribute Property
Description
Name
Name of the connection attribute.
Display Name
Display name for the connection attribute.
Description
Description of the connection attribute.
Data Type
Data type of the connection attribute.
Default Value
Default value for the attribute.
Min Length
Minimum length for the value of the attribute.
Max Length
Maximum length for the value of the attribute.
Encrypted
Indicates whether you can encrypt the attribute.
Mandatory
Indicates whether a connection attribute requires a value.
If you set the Mandatory property to true but you do not display the attribute
on the connection management user interface, you must set a default value
for the attribute.
Hidden
Indicates whether you can hide the attribute.
Has Dependent Fields
Indicates whether the attribute has dependent fields.
Allowed Values
List of values allowed for the attribute.
7.
Click Next.
The Configure Libraries page appears.
8.
Click Add to select each library that the adapter requires to connect to the data source.
9.
Click Generate Code.
After you define the connection attributes, the Informatica Connector Toolkit generates the following
Java files:
•
<AdapterName>ConnectInfoAdapter.java
•
<AdapterName>Connection.java
Update the ConnectInfoAdapter.java file to implement connection validation and attribute dependancies.
Update the Connection.java file to implement the methods that open and close connection to the data
source.
Note: If you regenerate code for the connection project, the Informatica Connector Toolkit does not
regenerate code for the user-exposed source code visible in the Informatica perspective. You have to
manually edit the source code and make changes if you add, remove, or modify connection attributes.
Test and Debug the Connection to the Data Source
After you define the connection attributes, you can test and debug the connection to the data source.
Step 2. Define the Connection Attributes
9
Create a debug configuration in Eclipse IDE from the Run menu. Select the adapter connection project to
debug and provide the connection type and connection properties. You can also set breakpoints in the code
that you want to debug.
After you create a debug configuration, you can launch the Test Connection dialog box to test and debug
the connection definition.
1.
In the Connector Progress view, select Test Connection.
The Test Connection dialog box appears with the default Java Virtual Machine (JVM) environment
settings. The Informatica Connector Toolkit uses the JVM settings to run the debug configuration.
2.
Edit the JVM environment settings, if required. Ensure that you use the same port number that appears
in JVM settings for the connection properties in the debug configuration.
3.
Click Next.
The Connection Details page appears with the connection attributes that you defined for the adapter.
4.
Enter values for the connection attributes.
5.
Click Test Connection.
A success message appears if the connection to the data source is successful.
Note: You cannot use the Informatica Connector Toolkit to test the connection validation and attribute
dependencies.
Step 3. Define the Type System
Categorize each data type in the data source into one of the semantic types defined in the Informatica
Connector Toolkit API. In addition to assigning semantic categories to native types, map each native type
with an Informatica platform data type.
Use the Informatica Connector Toolkit to define how native data types map to the Informatica platform data
types.
10
1.
In the Connector Navigator view, right-click the project and select Define Typesystem.
The Define Type System dialog box appears.
2.
Click Add to configure each type system attribute.
The Add Type dialog box appears.
3.
Enter the following properties for the type system attribute:
Property
Value
Type Name
Name for the native type system attribute.
Comments
Comments for the native type system attribute.
Chapter 3: Building an Adapter
Property
Value
Platform Type
Platform type to which you map the native type.
Attributes
Based on the semantic category, you must set one
or more of the following native type properties:
- Precision properties such as max precision and
default precision.
- Scale properties such as max scale, default scale,
and min scale.
- Length properties such as max length and default
length.
- Unit of length such as characters, bytes, and bits.
- Date properties such as hour, minute, second, year,
month, day, and time zone.
4.
Click Generate Code.
Step 4. Define the Adapter Metadata
The adapter metadata represents the metadata in the data source for which you build the adapter.
Use the Informatica Connector Toolkit to define the adapter metadata. Define the following to specify the
adapter metadata:
•
Native metadata definition for the adapter. You can define multiple native metadata definitions for an
adapter.
•
Record extensions and field extensions. You can define record extensions and field extensions to define
additional metadata for records and fields.
•
Read and write capability for the adapter. You can add attributes that you can use to read from or write to
the data source.
•
Import dialog box settings. You can define import options that appear in the Developer tool when an
adapter consumer creates a data object.
1.
In the Connector Navigator view, right-click the project and select Add Native Metadata Definition.
The Add Native Metadata Definition dialog box appears.
2.
Enter the native metadata details.
The following table describes the values to enter:
Property
Value
Name
Name for the native metadata.
Display Name
Display name for the native metadata.
Description
Description of the native metadata.
Step 4. Define the Adapter Metadata
11
3.
To add additional metadata information for records, select Add Record Extension and add the following
properties for the attribute:
Attribute Property
Description
Name
Name of the attribute.
Display Name
Display name for the connection attribute.
Description
Description of the connection attribute.
Data Type
Data type of the connection attribute.
Default Value
Default value for the attribute.
Min Length
Minimum length for the value of the attribute.
Max Length
Maximum length for the value of the attribute.
Encrypted
Indicates whether you can encrypt the attribute.
Mandatory
Indicates whether a connection attribute requires a value.
If you set the Mandatory property to true but you do not display the attribute
on the connection management user interface, you must set a default value
for the attribute.
12
Hidden
Indicates whether you can hide the attribute.
Allowed Values
List of values allowed for the attribute.
4.
Click Next.
The Native Metadata Field page displays.
5.
To add additional metadata information for fields, select Add Field Extension and add the attribute
properties.
6.
Click Next.
The Native Metadata Read Capability page appears.
7.
To define read capability for the native metadata object, select Enable Read Capability.
8.
Select whether the adapter supports look up of data when the adapter reads from the data source.
9.
Select whether the adapter supports join and filter operations when the adapter reads from the data
source.
•
To specify operators and expression syntax recognized by the Informatica platform for the join or filter
operation, select Platform Expression.
•
To specify an expression for the join or filter operation that is specific to the data source for which you
build the adapter, select Native Expression.
10.
To add read capability attributes, click Add and add the attribute properties.
11.
Click Next.
The Native Metadata Write Capability page appears.
12.
To define write capability for the native metadata object, select Enable Write Capability and add the
attribute properties.
13.
Click Next.
Chapter 3: Building an Adapter
The Import Dialog Box Settings page appears.
14.
Select the import options that appear in the Developer tool when an adapter consumer creates a data
object and click Save.
15.
Click Generate Code.
After you define the adapter metadata, the Informatica Connector Toolkit generates the
MetadataAdapter.java file. Implement the following methods in the MetadataAdapter.java file to import
metadata.
populateObjectCatalog()
Populates metadata details in the import wizard for the adapter consumer.
populateObjectDetails()
Gets metadata from the data source based on the import dialog options settings.
Note: If you regenerate code for the native metadata definition project, the Informatica Connector Toolkit
does not regenerate code for the user-exposed source code visible in the Informatica perspective. You have
to manually edit the source code and make changes if you add, remove, or modify native metadata attributes.
Test Metadata from the Data Source
After you define the native metadata object, you can test metadata that you import from the data source.
To debug when you test metadata from the data source, use the same debug configuration that you used to
test the connection to the data source. You can also set breakpoints in the code that you want to debug.
After you define the debug configuration, you can launch the Test Metadata dialog box to test the connection
definition and test the metadata of the data source.
1.
In the Connector Progress view, select Test Metadata.
The Test Metadata dialog box appears with the connection attributes that you defined for the adapter.
2.
Enter values for the connection attributes to connect to the data source.
3.
Click Connect.
The adapter imports the metadata from the data source and the metadata appears in the Test Metadata
page.
4.
Browse and verify the imported metadata.
5.
Click Close.
Step 5. Implement the Adapter Run-time Behavior
Use the Informatica Connector Toolkit to implement the adapter run-time behavior. The adapter run-time
behavior defines how the adapter performs operations such as establishing or closing a connection to the
data source, and preparing and running SQL statements.
The Informatica Connector Toolkit API is written in Java, you can use the run-time interfaces available in
Java to implement the adapter run-time behavior. After you define the adapter metadata, the Informatica
Connector Toolkit generates the DataAdapter.java file.
Implement the following methods in the DataAdapter.java file to implement the adapter run-time behavior:
•
initDataSession()
Step 5. Implement the Adapter Run-time Behavior
13
•
beginDataSession()
•
read()
•
write()
•
endDataSession()
•
deinitDataSession()
Test the Read and Write Capabilities of the Adapter
Before you deploy the adapter in the Informatica domain, you can test the read and write capabilities of the
adapter.
After you define the adapter run-time components, you can use the Test Read and Test Write wizards to test
the read and write capabilities of the adapter. After you debug and fix issues in the read and write capabilities
of the adapter, you can deploy the adapter in the Informatica domain.
Test the Read Capability of the Adapter
When you test the read capability of the adapter, you test the connection definition, metadata of the data
source, and operations that the adapter supports. After you specify the test settings and run the test, you can
view the result of the read operation, read operation statistics, and the log file.
To debug the code, use the same debug configuration that you used to test the connection and metadata
components of the adapter. You can also set breakpoints in the code that you want to debug.
After you define the debug configuration, you can launch the Test Read dialog box to test the read
capabilities of the adapter.
1.
In the Connector Progress view, select the native metadata object that appears under Test Read.
The Test Read dialog box appears with the default JVM environment settings and tracing level. The
Informatica Connector Toolkit uses the JVM settings to run the debug configuration.
2.
If required, edit the JVM environment settings. Ensure that you use the same port number that appears
in JVM settings for the connection properties in the debug configuration.
3.
Select the required tracing level. The default is normal. Based on the amount of detail that you require in
the log file, you can override the default tracing level.
You can set the following types of tracing level:
None
Does not override the default tracing level.
Terse
Logs initialization information and error messages and notification of rejected data.
Normal
Logs initialization and status information, errors encountered, and skipped rows due to
transformation row errors. Summarizes mapping results, but not at the level of individual rows. This
is the default tracing level.
14
Chapter 3: Building an Adapter
Verbose Initialization
In addition to normal tracing, logs additional initialization details, names of index and data files used,
and detailed statistics.
Verbose Data
In addition to verbose initialization tracing, logs each row. You can also get detailed statistics on
where string data was truncated to fit the precision of a column.
4.
Click Next.
The connection attributes that you defined for the adapter appears.
5.
Enter values for the connection attributes to test the connection to the data source.
6.
Click Connect.
The Test Metadata page appears with the metadata imported from the data source.
7.
Select the native metadata objects and the corresponding native metadata fields to test the read
operation.
8.
Click Next.
Based on whether the selected native metadata object supports join and filter operations, the Join
Condition page or Filter Condition page appears.
9.
If the native metadata object supports join operation, specify an expression in the Join Condition page.
•
•
10.
1.
In the Definition section, select the native metadata object for which you want to specify the join
condition.
2.
To change the join order, click Move Up or Move Down.
3.
Specify the join type in Join condition.
4.
To define a join condition, select values in the Left Field, Operator, and Right Field columns.
5.
To add additional join conditions, click Add.
6.
To remove a join condition, select the join condition and click Remove.
To specify a native expression for the join operation, enter the expression in the Definition section.
If the native metadata object supports filter operation, select the Configure Filter option in the Filter
Condition page and specify the filter condition.
•
•
11.
To specify an Informatica platform expression for the join operation, perform the following steps:
To specify an Informatica platform expression for the filter operation, perform the following steps:
1.
In the Definition section, click Add to add an Informatica platform expression.
2.
In the Field column, select the field to use in the expression.
3.
In the Operation column, select a conditional operator to use in the expression.
4.
In the Value column, enter a value for the conditional expression.
To specify a native expression for the filter operation, enter the expression in the Definition section.
After you specify expressions for the native metadata object, click Next.
The Read Capability page appears.
12.
Specify values for the read capability attributes and then click Run.
The Result page appears. You can view the result of the read operation, read operation statistics, and
the log file in the Result page.
13.
Click Close.
Test the Read and Write Capabilities of the Adapter
15
Test the Write Capability of the Adapter
When you test the write capability of the adapter, you test the components of the adapter and write sample
data to the data source. After you specify the test settings and run the test, you can view the result of the
write operation, write operation statistics, and the log file.
To debug the code, use the same debug configuration that you used to test the connection and metadata
components of the adapter. You can also set breakpoints in the code that you want to debug.
After you define the debug configuration, you can launch the Test Write dialog box to test the write
capabilities of the adapter.
1.
In the Connector Progress view, select the native metadata object that appears under Test Write.
The Test Write dialog box appears with the default JVM environment settings and tracing level. The
Informatica Connector Toolkit uses the JVM settings to run the debug configuration.
2.
If required, edit the JVM environment settings. Ensure that you use the same port number that appears
in JVM settings for the connection properties in the debug configuration.
3.
Select the required tracing level. The default is normal. Based on the amount of detail that you require in
the log file, you can override the default tracing level.
You can set the following types of tracing level:
None
Does not override the default tracing level.
Terse
Logs initialization information and error messages and notification of rejected data.
Normal
Logs initialization and status information, errors encountered, and skipped rows due to
transformation row errors. Summarizes mapping results, but not at the level of individual rows. This
is the default tracing level.
Verbose Initialization
In addition to normal tracing, logs additional initialization details, names of index and data files used,
and detailed statistics.
Verbose Data
In addition to verbose initialization tracing, logs each row. You can also get detailed statistics on
where string data was truncated to fit the precision of a column.
4.
Click Next.
The connection attributes that you defined for the adapter appears.
5.
Enter values for the connection attributes to test the connection to the data source.
6.
Click Connect.
The Test Metadata page appears with the metadata imported from the data source.
7.
Select a native metadata object to test the write operation.
The metadata of the native metadata object along with the data type, scale, and precision appears in the
Test Write page.
8.
Select the columns to which you want to write data.
9.
Click Next.
The Test Data page appears.
16
Chapter 3: Building an Adapter
10.
In the Test Data page, you can load test data from a file or you can generate test data.
•
To load the test data from a file, perform the following steps:
1.
Select the Load from a File option. You must load a comma-delimited TXT file or CSV file.
Note: The date and time data types in the file must have the following timestamp format: MM/DD/
YYYY hh24:mm:ss
2.
•
11.
Click Browse and select the file that contains the test data.
To generate test data, perform the following steps:
1.
Select the Auto generate data option.
2.
Enter the number of rows to generate. You can specify a maximum of 1000 rows.
3.
Click Generate. The test data appears in the Data Preview section.
4.
If required, you can edit the test data that appears in the Data Preview section.
After you load a test data file or generate test data, click Next.
The Write Capability page appears.
12.
Specify values for the write capability attributes and then click Run.
The Result page appears. You can view the result of the write operation, write operation statistics, and
the log file in the Result page.
13.
Click Close.
Step 6. Publish or Deploy the Adapter
Use the Informatica Connector Toolkit to publish or deploy the adapter. You can publish the adapter files to a
location or deploy the adapter on local Informatica services and client directory.
1.
In the Connector Navigator view, right-click the project and select Publish.
The Publish Informatica Connector dialog box appears.
2.
If you want to publish the adapter, click Browse to configure a location to publish the adapter.
The Publish Location defaults to the adapter project workspace.
3.
If you want to use the Informatica Connector Toolkit to install the adapter on a local Informatica services
and client machine, select Deploy connector on local Informatica services and client and complete
the following steps: .
4.
a.
Click Browse to configure the local Informatica server and client installation directories.
b.
To reinstall the adapter or install a newer version of the adapter, select Upgrade.
Click Finish.
If you publish the adapter, the Informatica Connector Toolkit bundles the client and service artifacts and
generates batch files that you can use to install the adapter. If you encounter any error or fail to publish the
adapter, refer to the <adapter_name>_codebuilder.log file for more information. The
<adapter_name>_codebuilder.log file is available in the <Eclipse workspace>/<adapter project> folder.
If you deploy the adapter, the Informatica Connector Toolkit restarts the Informatica domain and registers the
adapter with the Informatica services. The Data Integration Service can connect to the data source and you
can create connections to the data source in the Developer tool and Administrator tool. If you fail to deploy
the adapter, install the adapter manually.
Note: If the Informatica domain is not available after you deploy the adapter, ensure that no Informatica
services are running in the domain and then redeploy the adapter.
Step 6. Publish or Deploy the Adapter
17
Manually Install the Adapter (Optional)
To install the adapter, you deploy it to the Informatica services and client installation directories. You also
register it to the Informatica services installation directory. If you use the Deploy connector on local
Informatica services and client option to deploy the adapter, you do not need to complete these steps.
After you use the Informatica Connector Toolkit to publish the adapter, complete the following steps to
manually install the adapter:
1.
Shut down the Informatica domain and Informatica Developer tool applications on which you plan to
deploy the adapter files.
2.
Perform the following steps to deploy and register the adapter to the server installation directory:
a.
Copy the installServer.bat file and the server folder from the publish location to the machine in
which you have installed Informatica services.
Note: If you install the adapter on PowerCenter Express, you must start the PowerCenter Express
database before you install the adapter. To start the PowerCenter Express database, run the
dbmanager startup command from the following location: <INFA_PCExpress_Installed_Location>
\h2\bin\
b.
Launch a command window and navigate to the location of the installServer.bat file.
c.
Run following command in the command window: installServer.bat
[InformaticaInstallationDir]
For example, installServer.bat C:\Informatica\9.6.1
d.
3.
If you need to reinstall the adapter or install a newer version of the adapter, run the following
command in the command window: installServer.bat [InformaticaInstallationDir] true
Perform the following steps to deploy the adapter files to the client installation directory:
a.
Copy the installClient.bat file and the client folder from the publish location to the machine in
which you have installed Informatica client.
b.
Launch a command window and navigate to the location of the installClient.bat file.
c.
Run following command in the command window: installClient.bat
[InformaticaClientInstallationDir]
For example, installClient.bat C:\Informatica\9.6.1\clients
4.
Start the Informatica domain.
The Data Integration Service can connect to the MySQL database and you can create MySQL
connections in the Developer tool and Administrator tool. The MySQL connection appears when you
display the list of available connection types in the Administrator tool, the Developer tool, and the
command line.
Naming Convention
A naming convention makes it easy to identify the files that belong to an adapter and the usage of those files.
Use the following guidelines when you name the adapter files:
•
18
Determine a name for the adapter. Use the adapter name as a prefix for the adapter file names. The
adapter name is an alphanumeric string that can include the uppercase and lowercase letters A to Z and
the numbers 0 to 9. The first character of the name must be a letter.
Chapter 3: Building an Adapter
•
Determine a unique name to identify the company building the adapter. The company name is included in
the package name for the adapter classes.
•
Use the adapter name when you create a directory for the adapter in the Informatica directory:
INFA_HOME\plugins\dynamic\AdapterName
The following table lists the recommended naming convention for adapter files:
Component
Naming Format
Package for the adapter definition and type
system classes
com.vendorname.adaptername.connection
Adapter definition class
AdapterNameDefn
Type system class
AdapterNameTypeSystem
Resource file for the connection management
user interface
AdapterNameBundle.properties or
AdapterNameBundle_lang.properties
Naming Convention
19
CHAPTER 4
Connection Attributes
This chapter includes the following topics:
•
Connection Attributes Overview, 20
•
Connection Attribute Properties, 20
Connection Attributes Overview
The adapter connection attributes determine the behavior and functionality of the adapter when it connects to
a data source. You can configure connection attributes such as connection-level encryption, connection pool
settings, database user credentials, and other database-specific attributes.
Define the connection attributes that are specific for the data source. You can set the default value of a
connection attribute or mark a connection attribute as a required attribute.
Connection Attribute Properties
You can configure properties for each connection attribute that you define for an adapter. You can specify
whether an attribute is required, provide the default, maximum, and minimum values for the attribute, or
specify a list of possible values for the attribute.
All connection management user interfaces, including command line programs, validate the values set for the
properties of a connection attribute.
The following table describes the properties that you can set for a connection attribute:
20
Attribute Property
Description
Name
Name of the connection attribute.
Display Name
Display name for the connection attribute.
Description
Description of the connection attribute.
Data Type
Data type of the connection attribute.
Default Value
Default value for the attribute.
Attribute Property
Description
Min Length
Minimum length for the value of the attribute.
Max Length
Maximum length for the value of the attribute.
Encrypted
Indicates whether the attribute is encrypted.
Mandatory
Indicates whether a connection attribute requires a value.
If you set the Mandatory property to true but you do not display the attribute on
the connection management user interface, you must set a default value for the
attribute.
Hidden
Indicates whether the attribute can be hidden.
Has Dependent Fields
Indicates whether the attribute has dependent fields.
Allowed Values
List of values allowed for the attribute.
Connection Attribute Properties
21
CHAPTER 5
Type System
This chapter includes the following topics:
•
Type System Overview, 22
•
Native Types, 22
•
Informatica Platform Types, 24
Type System Overview
A type system is a framework that specifies characteristics of data types. The adapter must provide
information about the data types supported by the data source and how they map to the data types supported
by the Informatica platform.
The type system you define for an adapter consists of the following sets of data types:
•
Native types. Data types supported by the data source for which the adapter is built.
•
Informatica platform types. Data types supported by the Informatica platform. The Informatica Connector
Toolkit API uses ODBC as a model for describing Informatica platform data types.
Native Types
The native types included in the type system are all possible data types in the data source for which the
adapter is built.
You must define the semantic category of each data type in the data source. The Informatica Connector
Toolkit API defines each semantic category. Check the data source documentation to verify the data types
that are available in the data source.
Use the Informatica Connector Toolkit to associate native data types with semantic categories. The data type
name must match the character string that corresponds to the type name returned during the metadata import
process, such as Integer, Varchar2, or Blob.
When you define the semantic category for a data type, you can modify the precision and scale returned by
the import process so that the data type matches the requirements of the type system.
Use the following semantic categories to classify the native types:
22
Length semantics
Use this category for native types where length is the principal characteristic. This category can include
data types such as Char, Varchar2, Binary, Varbinary, Blob, and Clob.
Integer semantics
Use this category for native types that can contain signed integers. The length of the data type is the
number of decimal digits specified in the data type precision. This category can include data types such
as Integer, Smallint, Bigint, and Tinyint.
Machine integer semantics
Use this category for native types that can contain signed or unsigned integers. The length of this data
type is measured in bytes. The precision of a machine integer type is the maximum number of decimal
digits that fits within the length of the data type, regardless of whether all possible values can be stored.
For example, a 32-bit (4 byte) machine integer can store up to 10 digits but if the value of each digit is 9,
then the value of the integer can result in an overflow.
Decimal semantics
Use this category for native types that can contain an exact real number where precision is the total
number of digits and scale is the number of digits to the right of the decimal point. The precision for this
semantic category must be greater than or equal to the scale. This category can include data types such
as Decimal and Numeric.
Scientific decimal semantics
Use this category for native types that can contain an exact real number where precision is the number
of digits stored rather than the total number of digits represented by the number. The total number of
digits represented by the number can exceed the precision. The scale of the data type can exceed
precision and can be positive or negative. A positive scale represents digits to the right of the decimal
point. A negative scale represents the rounding position to the left of the decimal point. This category
can include data types such as the Number data type in Oracle with precision and scale specified.
Float semantics
Use this category for binary or decimal floating point data types. An example of a binary floating point
type is the binary_float type in Oracle. An example of a decimal floating point number is the Number data
type in Oracle with precision and scale not specified.
Gregorian date semantics
Use this category for date types that the adapter can expose as Gregorian dates, times, and timestamps.
Native Type Properties
Depending on the semantic category, you must set one or more of the following native type properties:
•
Maximum precision
•
Minimum precision
•
Default precision
•
Support for changes to precision
•
Maximum scale
•
Minimum scale
•
Default scale
•
Support for changes to scale
•
Unit of length, such as characters, bytes, and bits
Native Types
23
•
For Gregorian date semantics, support for hour, minute, second, year, month, day, or time zone
•
For float semantics, radix of the precision and exponent
Set the maximum and minimum values for precision and scale to validate the following:
•
Imported database metadata
•
Data type of a column that an end user adds to a table in a mapping
The default precision, default scale, and the specification of whether the precision and scale can be modified
apply to metadata that is manually defined by the user. If the precision or scale cannot be modified, then the
default value and the maximum value must be set to the same value.
Informatica Platform Types
Informatica platform types include all the data types that are recognized by Informatica. The Informatica
Connector Toolkit API uses ODBC as a model to describe the Informatica platform data types. In this section,
the term ODBC type refers to the Informatica platform type.
In addition to assigning semantic categories to native types, you must map each native type with an ODBC
type. The Informatica platform uses ODBC types to determine what type of data buffers to bind to the runtime adapter for data access. In some cases, the match between a native type and an ODBC type is not
exact. For example, the Informatica platform always binds a timestamp buffer if the native type is mapped to
an ODBC date, time, or timestamp.
In many cases, a native data type matches one of the available ODBC types. In cases where there is no
exact match between types, select the best possible match.
Use the Informatica Connector Toolkit to define native-to-ODBC type mappings. You can indicate whether the
mapping is the exact match or whether the mapping can result in a lossy data conversion due to a match that
is not exact.
In addition to defining the best mappings to convert native types to ODBC types, you can specify alternate
mappings. An alternate mapping allows the end user to select alternate transformation data types to
associate with the input and output ports of a data source used in a mapping.
Note: ODBC types are not the same as the transformation data types that appear in a transformation that you
add to a mapping. ODBC types are internal data types used only within the adapter type system. Informatica
can convert ODBC types to transformation data types.
24
Chapter 5: Type System
CHAPTER 6
Metadata Objects
This chapter includes the following topics:
•
Metadata Objects Overview, 25
•
Metadata Components, 25
•
Import Options, 26
Metadata Objects Overview
Define the adapter metadata components to represent the metadata of the data source. After you define the
metadata components, you can fetch and display the metadata in the Developer tool with information on the
native data type, precision, and scale.
Use the Informatica Connector Toolkit to define a native metadata definition for the adapter to read from and
write to the data source. The Informatica Connector Toolkit internally uses a metadata model that represents
the metadata. The pattern classes in the metadata model describe the metadata structure. When the
Informatica Connector Toolkit publishes the adapter, it registers the metadata model in the Model repository.
After the Informatica Connector Toolkit registers the metadata model in the Model repository, you can use the
Developer tool to import metadata from the data source.
Metadata Components
The metadata components in the Informatica Connector Toolkit represent the metadata of the data source
and the associated operations to read from and write to the data source.
Use the Informatica Connector Toolkit to define the following metadata components:
Native metadata
Define a native metadata object that represents the metadata of the native source and associate the
native metadata object with operations to read metadata from a data source, look up metadata from a
data source, or write metadata to a data source.
Record extensions
You can define record extensions to define additional metadata for records. For example, you can add
the attribute query hint as a record extension.
25
Field extensions
You can define field extensions to define additional metadata for fields. For example, you can add the
attribute isNullable as a field extension to indicate that the field can contain a null value.
Read capability
Define attributes that you can read from the data source. You can also define whether the adapter
supports look up of data, join operations, and filter operations when the adapter reads from the data
source.
Write capability
Define attributes that you can write to the data source.
Import Options
Use the Informatica Connector Toolkit to define the import options that appear in the Developer tool when an
adapter consumer creates a data object.
The following tables describes the import options:
26
Option
Description
Allow Multi Select
Allows selection of multiple importable objects. Default
is false.
Display Filter By Name
Displays the filter by name option. Default is true.
Display Filter By Description
Displays the filter by description option. Default is true.
Display Filter By Path
Displays the filter by path option. Default is true.
Display Skip Description
Displays the skip descriptions check box. Default is
true.
Show Entity
Shows entity details. Default is true.
Show Hierarchy
Shows metadata hierarchy. Default is true.
Show Related Records
Shows related records. Default is true.
Chapter 6: Metadata Objects
CHAPTER 7
Run-time Behavior
This chapter includes the following topics:
•
Run-time Behavior Overview, 27
•
Run-time Java Functions, 27
Run-time Behavior Overview
Use the functions in the Informatica Connector Toolkit API to specify the run-time behavior of the adapter.
You must write the code to define how the adapter connects, disconnects, reads from and writes to the data
source.
The run-time functions are available in Java. Within the run-time functions, you can use any API that is
appropriate for communicating with the data source. You must implement all the run-time functions.
The run-time functions use character string arguments and character data buffers in UCS-2 format. If the
database API communicates with the data source through the UCS-2 character set, then pass the character
strings and data buffers directly to the database API. If the database API does not use the UCS-2 character
set, you must convert the data to UCS-2 format before you pass the data to the database API.
To reduce complexity, design the adapter so that it does not require the end user to specify any character set
information. Use the Unicode mode if the database client API provides a Unicode mode. Or, query the
database to determine the correct character set to use when reading or writing data to the database.
If you require input from the end user about the correct character set, define a custom connection attribute to
store this information.
Run-time Java Functions
The run-time functions in the Informatica Connector Toolkit are available in Java. Implement the run-time
behavior of the adapter in Java.
Extend the following classes to define the adapter run-time behavior with Java functions:
DataConnection
Implement the methods in this class to connect and disconnect from the data source.
27
DataAdapter
Implement the methods in this class to initialize the data session, deinitialize the data session, begin the
data session, end the data session, read data from the data source, and write data to the data source.
28
Chapter 7: Run-time Behavior
CHAPTER 8
Adapter Example: MySQL
This chapter includes the following topics:
•
MySQL Adapter Overview, 29
•
MySQL Adapter Requirements, 29
•
MySQL Adapter Components, 29
•
Building the Sample Adapter, 31
MySQL Adapter Overview
The Informatica Connector Toolkit includes sample source code of the MySQL adapter. You can use the
MySQL adapter sample source code as a model to develop an adapter for a data source. The MySQL sample
was developed with the Informatica Connector Toolkit.
Note: The sample MySQL adapter is for illustration purposes only.
MySQL Adapter Requirements
To run the sample adapter, you must install the MySQL JDBC driver on your development machine. Use the
MySQL JDBC driver to access the metadata and perform read and write operations on the MySQL database.
Download MySQL JDBC driver version 5.1.26 or later from the following URL:
http://dev.mysql.com/downloads/connector/j
MySQL Adapter Components
The sample MySQL adapter includes the following components:
Contribution
Use the contribution plug-in project to get information on plug-ins contributing to the MySQL adapter
project. The name of the MySQL contribution plug-in is
com.infa.adapter.mysql.adapter.contribution.
29
Connection model
Use the connection model Java project to represent the connection model for the MySQL adapter. The
name of the MySQL connection model Java project is
com.infa.products.adapters.mysql.models.connection.annotatedjava.
Connection adapter
Use the connection adapter plug-in project to provide connection attribute information and consumer
information for the MySQL adapter. The name of the MySQL connection attributes plug-in is
com.infa.products.adapter.mysql.connection.adapter.
Seed provider
Use the seed provider Java project to map native data types to Informatica data types. The name of the
MySQL seed provider Java project is com.infa.adapter.mysql.seedprovider.
Type system
Use the type system plug-in project to contribute the seed provider of the adapter to the Informatica
platform. The name of the MySQL type system plug-in project is
com.infa.products.adapter.mysql.typesystem.
Metadata model
Use the metadata model Java project to represent the metadata model for the MySQL adapter. The
name of the MySQL metadata model Java project is
com.infa.products.adapters.mysql.models.metadata.annotatedjava.
Metadata adapter
Use the metadata adapter Java project to provide the functionality to open and close connections to the
MySQL adapter. The name of the MySQL metadata adapter Java project is
com.infa.products.adapter.mysql.metadata.adapter.
Run-time model
Use the run-time model Java project to represent the run-time model for the MySQL adapter. The name
of the MySQL run-time model java project is
com.infa.products.adapters.mysql.models.runtime.annotatedjava.
Run-time adapter
Use the run-time adapter plug-in project to implement run-time adapter for the MySQL adapter in Java.
The name of the MySQL run-time adapter plug-in project is
com.infa.products.adapter.mysql.runtime.adapter.
Metamodel bundle
Use the MySQL metamodel bundle plug-in project to list the metaclasses for adapter packages such as
connection, metadata, run-time ASO, and run-time capability. The name of the MySQL metamodel
bundle plug-in project is com.infa.products.adapter.mysql.metamodel.
Model attributes
Use the model attributes plug-in project to define the presentation labels for the field, record, and runtime extensions. The name of the MySQL model attributes plug-in project is
com.infa.products.adapter.mysql.modelAttributes.
Library information
Use the library info plug-in project to define the run-time adapter based on the programming language in
which you implement the run-time adapter. Currently, you can use only Java interfaces to implement the
run-time adapter. The name of the MySQL library Info plug-in project is
com.infa.products.adapter.mysql.libraryInfo.
30
Chapter 8: Adapter Example: MySQL
License
Use the license Java project to perform license checks for the MySQL adapter. The name of the MySQL
license Java project is com.infa.products.adapter.mysql.license.
UI wizard
Use the UI wizard project to define the icons for the Import wizard. The UI wizard project is a Java
project. The Developer tool uses the import options to display UI components when an adapter
consumer creates a data object. The name of the UI wizard project is
com.infa.products.adapter.mysql.wizard.
Feature
Use the feature plug-in project, which is an Eclipse feature, to define an adapter plug-in. The name of
the MySQL feature plug-in project is com.infa.products.adapter.mysql.feature.
Building the Sample Adapter
You can use the sample adapter source code to develop an adapter for a data source. Import the sample
adapter project in to the Eclipse IDE and use the Informatica Connector Toolkit to publish or deploy the
sample adapter.
To use the sample source code and develop an adapter, complete the following tasks:
1.
From the Eclipse IDE, click File > Import. The Import dialog box appears.
2.
Select Existing Projects into Workspace and then click Next. The Import Projects page appears.
3.
Select Select root directory and browse to the directory of the sample adapter that you want to import
into Eclipse.
4.
Click Finish.
The sample adapter project appears in the package explorer.
5.
Change to the Informatica Connector perspective.
6.
Edit the connection, types system, metadata, and run-time components, if required.
7.
Publish the sample adapter or deploy the sample adapter on local Informatica services and client.
Building the Sample Adapter
31
CHAPTER 9
Adapter Example: YouTube
This chapter includes the following topics:
•
YouTube Adapter Overview, 32
•
YouTube Adapter Requirements, 32
•
YouTube Adapter Components, 32
•
Building the Sample Adapter, 34
YouTube Adapter Overview
The Informatica Connector Toolkit includes sample source code of the YouTube adapter. You can use the
YouTube adapter sample source code as a model to develop an adapter for a data source. The YouTube
sample was developed with the Informatica Connector Toolkit.
Note: The sample YouTube adapter is for illustration purposes only.
YouTube Adapter Requirements
To run the sample adapter, you must install the following software on your development machine:
Json-smart library
Use the json-smart library to parse data from YouTube.
Download JSON-smart version 1.1.1 from the following URL: http://code.google.com/p/json-smart/
GData client library
Use the GData client library for to read and write data from YouTube. Download GData client library from
the following URL: https://developers.google.com/gdata/articles/java_client_lib
YouTube Adapter Components
The sample YouTube adapter includes the following components:
32
Contribution
Use the contribution plug-in project to get information on plug-ins contributing to the YouTube adapter
project. The name of the YouTube contribution plug-in is
com.infa.adapter.youtube.adapter.contribution.
Connection model
Use the connection model Java project to represent the connection model for the YouTube adapter. The
name of the YouTube connection model Java project is
com.infa.products.adapters.youtube.models.connection.annotatedjava.
Connection adapter
Use the connection adapter plug-in project to provide connection attribute information and consumer
information for the YouTube adapter. The name of the YouTube connection attributes plug-in is
com.infa.products.adapter.youtube.connection.adapter.
Seed provider
Use the seed provider Java project to map native data types to Informatica data types. The name of the
YouTube seed provider Java project is com.infa.adapter.youtube.seedprovider.
Type system
Use the type system plug-in project to contribute the seed provider of the adapter to the Informatica
platform. The name of the YouTube type system plug-in project is
com.infa.products.adapter.youtube.typesystem.
Metadata model
Use the metadata model Java project to represent the metadata model for the YouTube adapter. The
name of the YouTube metadata model Java project is
com.infa.products.adapters.youtube.models.metadata.annotatedjava.
Metadata adapter
Use the metadata adapter Java project to provide the functionality to open and close connections to the
YouTube adapter. The name of the YouTube metadata adapter Java project is
com.infa.products.adapter.youtube.metadata.adapter.
Run-time model
Use the run-time model Java project to represent the run-time model for the YouTube adapter. The
name of the YouTube run-time model java project is
com.infa.products.adapters.youtube.models.runtime.annotatedjava.
Run-time adapter
Use the run-time adapter plug-in project to implement run-time adapter for the YouTube adapter in Java.
The name of the YouTube run-time adapter plug-in project is
com.infa.products.adapter.youtube.runtime.adapter.
Metamodel bundle
Use the YouTube metamodel bundle plug-in project to list the metaclasses for adapter packages such as
connection, metadata, run-time ASO, and run-time capability. The name of the YouTube metamodel
bundle plug-in project is com.infa.products.adapter.youtube.metamodel.
Model attributes
Use the model attributes plug-in project to define the presentation labels for the field, record, and runtime extensions. The name of the YouTube model attributes plug-in project is
com.infa.products.adapter.youtube.modelAttributes.
YouTube Adapter Components
33
Library information
Use the library info plug-in project to define the run-time adapter based on the programming language in
which you implement the run-time adapter. Currently, you can use only Java interfaces to implement the
run-time adapter. The name of the YouTube library Info plug-in project is
com.infa.products.adapter.youtube.libraryInfo.
License
Use the license Java project to perform license checks for the YouTube adapter. The name of the
YouTube license Java project is com.infa.products.adapter.youtube.license.
UI wizard
Use the UI wizard project to define the icons for the Import wizard. The UI wizard project is a Java
project. The Developer tool uses the import options to display UI components when an adapter
consumer creates a data object. The name of the UI wizard project is
com.infa.products.adapter.youtube.wizard.
Feature
Use the feature plug-in project, which is an Eclipse feature, to define an adapter plug-in. The name of
the YouTube feature plug-in project is com.infa.products.adapter.youtube.feature.
Building the Sample Adapter
You can use the sample adapter source code to develop an adapter for a data source. Import the sample
adapter project in to the Eclipse IDE and use the Informatica Connector Toolkit to publish or deploy the
sample adapter.
To use the sample source code and develop an adapter, complete the following tasks:
34
1.
From the Eclipse IDE, click File > Import. The Import dialog box appears.
2.
Select Existing Projects into Workspace and then click Next. The Import Projects page appears.
3.
Select Select root directory and browse to the directory of the sample adapter that you want to import
into Eclipse.
4.
Click Finish.
The sample adapter project appears in the package explorer.
5.
Change to the Informatica Connector perspective.
6.
Edit the connection, types system, metadata, and run-time components, if required.
7.
Publish the sample adapter or deploy the sample adapter on local Informatica services and client.
Chapter 9: Adapter Example: YouTube
APPENDIX A
Metadata Models
This appendix includes the following topics:
•
Metadata Model Overview, 35
•
Metadata Model Components, 35
•
Metadata Patterns, 36
•
Features of Type A Metadata Template, 37
Metadata Model Overview
The Informatica Connector Toolkit internally uses metadata models to define native metadata objects for the
adapter to read from and write to the data source. The metadata model contains components that represent
the metadata of the data source.
The Informatica Connector Toolkit uses pattern classes in the metadata model to describe the metadata
structure of the data source. The metadata model uses a pattern template to define the metadata pattern of
an adapter.
After the Informatica Connector Toolkit registers the metadata model of the data source in the Model
Repository Service, you can use the Developer tool to import metadata from the data source.
Note: Do not use the metadata models directly to define the native metadata objects for the adapter. Use the
Informatica Connector Toolkit to define native metadata objects.
Metadata Model Components
The metadata model contains components that represent the metadata of the data source.
The metadata model consists of the following components:
Flat Record
A flat record represents a structure that contains columns, unique keys, and primary keys. The structure
of a flat record is similar to a database table that contains columns and keys.
A flat record contains attributes that store the following information:
•
Name of the native metadata object
•
Type of native metadata object
35
•
Related records for the flat record
•
Primary key for the flat record
•
Unique keys for the flat record
•
Indexes for the flat record
•
Any additional record attributes specific to the data source
Field
A field is a data structure for a single unit of data in a data source.
A field contains attributes that store the following information:
•
Name of the field
•
Default value of the field
•
Precision of the field
•
Scale of the field
•
Boolean value that indicates whether the field can contain a null value
•
Any additional field attributes specific to the data source
Constraints
Constraints represent the primary key and unique keys for a flat record.
The primary key and unique key contain attributes that store the following information:
•
Name of the key
•
Native name of the key defined in the native metadata
•
List of fields that form the key
Index
Index represents a native index that orders the flat records or uniquely identifies a row in the flat record.
An index contains attributes that store the following information:
•
Name of the index
•
Native name of the index
•
Boolean value that indicates whether the index is unique
•
List of index fields
•
Index order to retrieve the data
The Informatica Connector Toolkit internally uses the metadata model components to represent the data
source metadata and persists the metadata in the Model repository.
Metadata Patterns
The metadata pattern of an adapter describes the metadata structure of the native data source. You can
choose a metadata pattern template to define the metadata pattern of an adapter.
A metadata pattern template is a set of packages such as catalog, container, flat record, and so on. Sets of
related classes that define the metadata pattern are organized as packages.
36
Appendix A: Metadata Models
Though an adapter can have more than one metadata pattern, the Informatica Connector Toolkit currently
supports only Type A template. The type A template provides the metadata patterns for flat records. You can
use the metadata catalog that the Type A template provides to describe the metadata structure of the data
source.
Features of Type A Metadata Template
The Informatica Connector Toolkit uses the Type A metadata pattern template to define the metadata pattern
for flat records.
The Type A metadata pattern template supports the following features:
Catalog
A catalog is a container for metadata objects that you can import.
Container
A container is a collection of packages.
Package
A package contains flat records. A package may also contain other packages.
Flat record
A flat record represents the structure of the native metadata object that you can import. The flat record
structure contains fields, relationships, index, and constraints.
Field
A field is a data structure for a single piece of data in a data source.
Record relationship
A record relationship represents the relationship between flat records.
Index
An index represents a native index that orders the flat records or uniquely identifies a flat record.
Constraints
A constraint represents the unique key and primary key for a flat record.
Features of Type A Metadata Template
37
APPENDIX B
ASO Model
This appendix includes the following topics:
•
ASO Model Overview, 38
•
ASO Model Components, 38
•
ASO Projections, 39
ASO Model Overview
The Informatica Connector Toolkit internally uses an Adapter Specific Object (ASO) model to represent
operations on native metadata objects.
The ASO model serves as a container for native metadata objects and associates operations such as read,
write, or lookup with the native metadata objects. A native metadata object represents the native importable
metadata of a data source such as a flat file, relational data source, and nonrelational data source. An ASO
model contains references to multiple native metadata objects and operations.
Note: Do not use the ASO models directly to define operations on native metadata objects. Use the
Informatica Connector Toolkit to define operations on native metadata objects.
ASO Model Components
Use the Informatica Connector Toolkit to define the components that comprise the application specific object.
The ASO model consists of the following components:
ASO
The ASO object represents the generic adapter specific object. The ASO object contains references to
the following components that comprise the ASO object.
•
ASO Operation
•
Catalog
•
Projection
ASO Operation
The ASO operation object contains references to capabilities, capability attributes, and complex types
that you associate with an operation.
38
Catalog
The catalog object represents the native metadata object. The native metadata object is the native
importable metadata of a data source. The catalog object contains references to components of native
metadata objects such as columns, unique keys, and primary keys.
Projection
The projection object represents the operations that you can perform when you read or write data. The
projection object contains references to the list of operations, projection type, and basic projection view.
ASO Projections
An ASO projection is a sequence of operations that you perform on data when you read data from a data
source or write data to a data source.
Use the Informatica Connector Toolkit to define a basic ASO projection model or an advanced projection
model according to your requirements. The basic ASO projection model provides a simple view of the
advanced projection model. The Informatica Connector Toolkit uses the BasicProjectionView interface to
provide a simple and basic model to the adapter developer. Use the get methods in the BasicProjectionView
interface to get information on native metadata object, platform types, scale, precision, and conditions like
filter and join.
To define the advanced ASO projection model, define the following projection operation interfaces as
required.
Sink operation
There are two types of sink operations: native sink operation and platform sink operation. The native sink
operation gets data from the platform operation when you write to a data source. The platform sink
operation gets data from the native source operation when you read from a data source.
Source operation
There are two types of source operations: native source operation and platform source operation. The
native source operation inputs the native data to the platform sink operation in a read projection
operation. The platform source operation inputs the platform data to the native sink operation in a write
projection operation.
Join operation
Use the join operation to join data from two related sources or from the same source.
Filter operation
Use the filter operation to filter data based on one or more conditions.
Projection operation
Use the projection operation to select a subset of attributes to rename or to drop fields.
For more information about interfaces that define the ASO projection model, see the Informatica Connector
Toolkit API reference documentation.
ASO Projections
39
INDEX
A
M
adapter
build 7
deploy 17
metadata
components 25
define 11
MySQL adapter
components 29
requirements 29
C
connection
test 10
connection attribute
properties 20
connection attributes
define 8
create
adapter 7
D
define
connection attributes 8
metadata 11
type system 10
E
Eclipse
install 5
Eclipse plug-in
set up 6
I
Informatica Connector Toolkit
install 4, 5
overview 1
install
Eclipse 5
Informatica Connector Toolkit 4, 5
40
P
publish
adapter 17
R
run time
overview 27
S
set up
Eclipse plug-in 6
T
test
connection 10
metadata 13
read capability 14
write capability 16
type system
define 10
Y
YouTube adapter
components 32
requirements 32