[prev in list] [next in list] [prev in thread] [next in thread] 

List:       forgerock-openicf-commit
Subject:    [Commitopenicf] [6509] trunk/connectors/java/scriptedcommon: CR-3333 / OPENICF-185 ?\226? \128?\147 
From:       anonymous () forgerock ! org
Date:       2014-04-15 9:47:57
Message-ID: 20140415094757.EF6D240994 () sources ! internal ! forgerock ! com
[Download RAW message or body]

[Attachment #2 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[6509] trunk/connectors/java/scriptedcommon: CR-3333 / OPENICF-185 \
?\226?\128?\147 ScriptedCommon upgrade to OpenICF 1.4</title> </head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: \
verdana,arial,helvetica,sans-serif; font-size: 10pt;  } #msg dl a { font-weight: \
bold} #msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: \
bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: \
6px; } #logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em \
0; } #logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg \
h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; } \
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; \
} #logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: \
-1.5em; padding-left: 1.5em; } #logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em \
1em 0 1em; background: white;} #logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid \
#fa0; border-bottom: 1px solid #fa0; background: #fff; } #logmsg table th { \
text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted \
#fa0; } #logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: \
0.2em 0.5em; } #logmsg table thead th { text-align: center; border-bottom: 1px solid \
#fa0; } #logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: \
6px; } #patch { width: 100%; }
#patch h4 {font-family: \
verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
 #patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins \
{background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del \
{background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, \
                .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a \
href="http://sources.forgerock.org/changelog/openicf/?cs=6509">6509</a></dd> \
<dt>Author</dt> <dd>Laszlo</dd> <dt>Date</dt> <dd>2014-04-15 10:47:57 +0100 (Tue, 15 \
Apr 2014)</dd> </dl>

<h3>Log Message</h3>
<pre>CR-3333 / OPENICF-185 ?\226?\128?\147 ScriptedCommon upgrade to OpenICF \
1.4</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkconnectorsjavascriptedcommonpomxml">trunk/connectors/java/scriptedcommon/pom.xml</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmaindocbkxchapscriptedcommonxml">tr \
unk/connectors/java/scriptedcommon/src/main/docbkx/chap-scriptedcommon.xml</a></li> \
<li><a href="#trunkconnectorsjavascriptedcommonsrcmaindocbkxindexxml">trunk/connectors/java/scriptedcommon/src/main/docbkx/index.xml</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmaindocbkxlegalxml">trunk/connectors/java/scriptedcommon/src/main/docbkx/legal.xml</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfmiscsc \
riptedcommonICFObjectBuildergroovy">trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/misc/scriptedcommon/ICFObjectBuilder.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfmiscsc \
riptedcommonScriptedConnectorBasegroovy">trunk/connectors/java/scriptedcommon/src/main \
/groovy/org/forgerock/openicf/misc/scriptedcommon/ScriptedConnectorBase.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmiscscri \
ptedcommonFilterVisitorjava">trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/FilterVisitor.java</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmiscscri \
ptedcommonMapFilterVisitorjava">trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/MapFilterVisitor.java</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmiscscri \
ptedcommonScriptedConfigurationjava">trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/ScriptedConfiguration.java</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmiscscri \
ptedcommonScriptedConnectionjava">trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/ScriptedConnection.java</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmiscscri \
ptedcommonScriptedFilterTranslatorjava">trunk/connectors/java/scriptedcommon/src/main/ \
java/org/forgerock/openicf/misc/scriptedcommon/ScriptedFilterTranslator.java</a></li> \
<li><a href="#trunkconnectorsjavascriptedcommonsrcmainresourcesorgforgerockopenicfconn \
ectorsgroovyMessagesproperties">trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/groovy/Messages.properties</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcsitesitexml">trunk/connectors/java/scriptedcommon/src/site/site.xml</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestjavaorgforgerockopenicfmiscscri \
ptedcommonScriptedConnectorTestjava">trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/misc/scriptedcommon/ScriptedConnectorTest.java</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesgroovyAuthenticateScri \
ptgroovy">trunk/connectors/java/scriptedcommon/src/test/resources/groovy/AuthenticateScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesgroovyCreateScriptgroo \
vy">trunk/connectors/java/scriptedcommon/src/test/resources/groovy/CreateScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesgroovyDeleteScriptgroo \
vy">trunk/connectors/java/scriptedcommon/src/test/resources/groovy/DeleteScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesgroovyResolveUsernameS \
criptgroovy">trunk/connectors/java/scriptedcommon/src/test/resources/groovy/ResolveUsernameScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesgroovySchemaScriptgroo \
vy">trunk/connectors/java/scriptedcommon/src/test/resources/groovy/SchemaScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesgroovyScriptOnResource \
Scriptgroovy">trunk/connectors/java/scriptedcommon/src/test/resources/groovy/ScriptOnResourceScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesgroovySearchScriptgroo \
vy">trunk/connectors/java/scriptedcommon/src/test/resources/groovy/SearchScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesgroovySyncScriptgroovy \
">trunk/connectors/java/scriptedcommon/src/test/resources/groovy/SyncScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesgroovyTestScriptgroovy \
">trunk/connectors/java/scriptedcommon/src/test/resources/groovy/TestScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesgroovyUpdateScriptgroo \
vy">trunk/connectors/java/scriptedcommon/src/test/resources/groovy/UpdateScript.groovy</a></li>
 </ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/connectors/java/scriptedcommon/src/assemble/</li>
<li><a href="#trunkconnectorsjavascriptedcommonsrcassemblesamplesxml">trunk/connectors/java/scriptedcommon/src/assemble/samples.xml</a></li>
 <li>trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/scriptedcrest/</li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfconnec \
torsscriptedcrestRemoteConnectiongroovy">trunk/connectors/java/scriptedcommon/src/main \
/groovy/org/forgerock/openicf/connectors/scriptedcrest/RemoteConnection.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfconnec \
torsscriptedcrestScriptedCRESTConfigurationgroovy">trunk/connectors/java/scriptedcommo \
n/src/main/groovy/org/forgerock/openicf/connectors/scriptedcrest/ScriptedCRESTConfiguration.groovy</a></li>
 <li>trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/scriptedrest/</li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfconnec \
torsscriptedrestScriptedRESTConfigurationgroovy">trunk/connectors/java/scriptedcommon/ \
src/main/groovy/org/forgerock/openicf/connectors/scriptedrest/ScriptedRESTConfiguration.groovy</a></li>
 <li>trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/scriptedsql/</li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfconnec \
torsscriptedsqlScriptedSQLConfigurationgroovy">trunk/connectors/java/scriptedcommon/sr \
c/main/groovy/org/forgerock/openicf/connectors/scriptedsql/ScriptedSQLConfiguration.groovy</a></li>
 <li>trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/soap/</li>
 <li>trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/misc/crest/</li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfmisccr \
estCRESTFilterVisitorgroovy">trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/misc/crest/CRESTFilterVisitor.groovy</a></li>
 <li>trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/</li>
 <li>trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/groovy/</li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnecto \
rsgroovyScriptedConnectorjava">trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/groovy/ScriptedConnector.java</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnecto \
rsgroovyScriptedPoolableConnectorjava">trunk/connectors/java/scriptedcommon/src/main/j \
ava/org/forgerock/openicf/connectors/groovy/ScriptedPoolableConnector.java</a></li> \
<li>trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedcrest/</li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnecto \
rsscriptedcrestScriptedCRESTConnectorjava">trunk/connectors/java/scriptedcommon/src/ma \
in/java/org/forgerock/openicf/connectors/scriptedcrest/ScriptedCRESTConnector.java</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnecto \
rsscriptedcrestStreamingJsonSlurperjava">trunk/connectors/java/scriptedcommon/src/main \
/java/org/forgerock/openicf/connectors/scriptedcrest/StreamingJsonSlurper.java</a></li>
 <li>trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedrest/</li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnecto \
rsscriptedrestScriptedRESTConnectorjava">trunk/connectors/java/scriptedcommon/src/main \
/java/org/forgerock/openicf/connectors/scriptedrest/ScriptedRESTConnector.java</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnecto \
rsscriptedrestpackageinfojava">trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedrest/package-info.java</a></li>
 <li>trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedsql/</li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnecto \
rsscriptedsqlScriptedSQLConnectorjava">trunk/connectors/java/scriptedcommon/src/main/j \
ava/org/forgerock/openicf/connectors/scriptedsql/ScriptedSQLConnector.java</a></li> \
<li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnector \
sscriptedsqlpackageinfojava">trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedsql/package-info.java</a></li>
 <li>trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/crest/</li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmisccres \
tAbstractRemoteConnectionjava">trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/crest/AbstractRemoteConnection.java</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmisccres \
tJsonEntityjava">trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/crest/JsonEntity.java</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmiscscri \
ptedcommonOperationTypejava">trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/OperationType.java</a></li>
 <li>trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/scriptedcrest/</li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainresourcesorgforgerockopenicfcon \
nectorsscriptedcrestMessagesproperties">trunk/connectors/java/scriptedcommon/src/main/ \
resources/org/forgerock/openicf/connectors/scriptedcrest/Messages.properties</a></li> \
<li>trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/scriptedrest/</li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainresourcesorgforgerockopenicfcon \
nectorsscriptedrestMessagesproperties">trunk/connectors/java/scriptedcommon/src/main/r \
esources/org/forgerock/openicf/connectors/scriptedrest/Messages.properties</a></li> \
<li>trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/scriptedsql/</li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainresourcesorgforgerockopenicfcon \
nectorsscriptedsqlMessagesproperties">trunk/connectors/java/scriptedcommon/src/main/re \
sources/org/forgerock/openicf/connectors/scriptedsql/Messages.properties</a></li> \
<li>trunk/connectors/java/scriptedcommon/src/test/config/org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase/</li>
 <li>trunk/connectors/java/scriptedcommon/src/test/config/org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase/config/</li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestconfigorgforgerockopenicfmiscsc \
riptedcommonScriptedConnectorBaseconfigconfiggroovy">trunk/connectors/java/scriptedcom \
mon/src/test/config/org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase/config/config.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestjavaorgforgerockopenicfconnecto \
rsRESTTestBasejava">trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/RESTTestBase.java</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestjavaorgforgerockopenicfconnecto \
rsScriptedCRESTConnectorTestjava">trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/ScriptedCRESTConnectorTest.java</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestjavaorgforgerockopenicfconnecto \
rsScriptedRESTConnectorTestjava">trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/ScriptedRESTConnectorTest.java</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestjavaorgforgerockopenicfconnecto \
rsScriptedSQLConnectorTestjava">trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/ScriptedSQLConnectorTest.java</a></li>
 <li>trunk/connectors/java/scriptedcommon/src/test/resources/crest/</li>
<li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcescrestAuthenticateScript \
groovy">trunk/connectors/java/scriptedcommon/src/test/resources/crest/AuthenticateScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcescrestCreateScriptgroov \
y">trunk/connectors/java/scriptedcommon/src/test/resources/crest/CreateScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcescrestDeleteScriptgroov \
y">trunk/connectors/java/scriptedcommon/src/test/resources/crest/DeleteScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcescrestResolveUsernameSc \
riptgroovy">trunk/connectors/java/scriptedcommon/src/test/resources/crest/ResolveUsernameScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcescrestSchemaScriptgroov \
y">trunk/connectors/java/scriptedcommon/src/test/resources/crest/SchemaScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcescrestScriptOnConnector \
Scriptgroovy">trunk/connectors/java/scriptedcommon/src/test/resources/crest/ScriptOnConnectorScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcescrestScriptOnResourceS \
criptgroovy">trunk/connectors/java/scriptedcommon/src/test/resources/crest/ScriptOnResourceScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcescrestSearchScriptgroov \
y">trunk/connectors/java/scriptedcommon/src/test/resources/crest/SearchScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcescrestSyncScriptgroovy" \
>trunk/connectors/java/scriptedcommon/src/test/resources/crest/SyncScript.groovy</a></li>
> 
<li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcescrestTestScriptgroovy"> \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/TestScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcescrestUpdateAttributeVa \
luesScriptgroovy">trunk/connectors/java/scriptedcommon/src/test/resources/crest/UpdateAttributeValuesScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcescrestUpdateScriptgroov \
y">trunk/connectors/java/scriptedcommon/src/test/resources/crest/UpdateScript.groovy</a></li>
 <li>trunk/connectors/java/scriptedcommon/src/test/resources/groovy/</li>
<li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesgroovyTestHelpergroovy" \
>trunk/connectors/java/scriptedcommon/src/test/resources/groovy/TestHelper.groovy</a></li>
> 
<li>trunk/connectors/java/scriptedcommon/src/test/resources/rest/</li>
<li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesrestAuthenticateScriptg \
roovy">trunk/connectors/java/scriptedcommon/src/test/resources/rest/AuthenticateScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesrestCreateScriptgroovy \
">trunk/connectors/java/scriptedcommon/src/test/resources/rest/CreateScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesrestDeleteScriptgroovy \
">trunk/connectors/java/scriptedcommon/src/test/resources/rest/DeleteScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesrestResolveUsernameScr \
iptgroovy">trunk/connectors/java/scriptedcommon/src/test/resources/rest/ResolveUsernameScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesrestSchemaScriptgroovy \
">trunk/connectors/java/scriptedcommon/src/test/resources/rest/SchemaScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesrestScriptOnConnectorS \
criptgroovy">trunk/connectors/java/scriptedcommon/src/test/resources/rest/ScriptOnConnectorScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesrestScriptOnResourceSc \
riptgroovy">trunk/connectors/java/scriptedcommon/src/test/resources/rest/ScriptOnResourceScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesrestSearchScriptgroovy \
">trunk/connectors/java/scriptedcommon/src/test/resources/rest/SearchScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesrestSyncScriptgroovy"> \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/SyncScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesrestTestScriptgroovy"> \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/TestScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesrestUpdateAttributeVal \
uesScriptgroovy">trunk/connectors/java/scriptedcommon/src/test/resources/rest/UpdateAttributeValuesScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcesrestUpdateScriptgroovy \
">trunk/connectors/java/scriptedcommon/src/test/resources/rest/UpdateScript.groovy</a></li>
 <li>trunk/connectors/java/scriptedcommon/src/test/resources/sql/</li>
<li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcessqlAuthenticateScriptgr \
oovy">trunk/connectors/java/scriptedcommon/src/test/resources/sql/AuthenticateScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcessqlCreateScriptgroovy" \
>trunk/connectors/java/scriptedcommon/src/test/resources/sql/CreateScript.groovy</a></li>
> 
<li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcessqlDeleteScriptgroovy"> \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/DeleteScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcessqlResolveUsernameScri \
ptgroovy">trunk/connectors/java/scriptedcommon/src/test/resources/sql/ResolveUsernameScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcessqlSchemaScriptgroovy" \
>trunk/connectors/java/scriptedcommon/src/test/resources/sql/SchemaScript.groovy</a></li>
> 
<li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcessqlScriptOnResourceScri \
ptgroovy">trunk/connectors/java/scriptedcommon/src/test/resources/sql/ScriptOnResourceScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcessqlSearchScriptgroovy" \
>trunk/connectors/java/scriptedcommon/src/test/resources/sql/SearchScript.groovy</a></li>
> 
<li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcessqlSyncScriptgroovy">tr \
unk/connectors/java/scriptedcommon/src/test/resources/sql/SyncScript.groovy</a></li> \
<li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcessqlTestScriptgroovy">tr \
unk/connectors/java/scriptedcommon/src/test/resources/sql/TestScript.groovy</a></li> \
<li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcessqlUpdateScriptgroovy"> \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/UpdateScript.groovy</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresourcessqltestDatabaseddl">tr \
unk/connectors/java/scriptedcommon/src/test/resources/sql/testDatabase.ddl</a></li> \
</ul>

<h3>Removed Paths</h3>
<ul>
<li>trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/groovy/</li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmiscscri \
ptedcommonLoggerjava">trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/Logger.java</a></li>
 <li>trunk/connectors/java/scriptedcommon/src/main/resources/samples/</li>
<li>trunk/connectors/java/scriptedcommon/src/test/config/org.forgerock.openicf.connectors.groovy.ScriptedConnector/</li>
 <li>trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/groovy/</li>
 <li>trunk/connectors/java/scriptedcommon/src/test/resources/case1/</li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#trunkconnectorsjavascriptedcommon">trunk/connectors/java/scriptedcommon/</a></li>
 <li><a href="#trunkconnectorsjavascriptedcommonsrctestresources">trunk/connectors/java/scriptedcommon/src/test/resources/</a></li>
 </ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkconnectorsjavascriptedcommon"></a>
<div class="propset"><h4>Property changes: trunk/connectors/java/scriptedcommon</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnignore"></a>
<div class="modfile"><h4>Modified: svn:ignore</h4></div>
<span class="cx">classes
</span><span class="cx">scriptedcommon.iml
</span><span class="cx">target
</span><span class="cx">.clover
</span><span class="cx">   + .idea
</span><span class="cx">classes
</span><span class="cx">scriptedcommon.iml
</span><span class="cx">target
</span><span class="cx">.clover
</span><span class="cx">groovy-connector.iml
</span><a id="trunkconnectorsjavascriptedcommonpomxml"></a>
<div class="modfile"><h4>Modified: trunk/connectors/java/scriptedcommon/pom.xml (6508 \
=> 6509)</h4> <pre class="diff"><span>
<span class="info">--- trunk/connectors/java/scriptedcommon/pom.xml	2014-04-14 \
                21:18:24 UTC (rev 6508)
+++ trunk/connectors/java/scriptedcommon/pom.xml	2014-04-15 09:47:57 UTC (rev 6509)
</span><span class="lines">@@ -34,13 +34,19 @@
</span><span class="cx">     &lt;artifactId&gt;groovy-connector&lt;/artifactId&gt;
</span><span class="cx">     &lt;version&gt;1.4.0.0-SNAPSHOT&lt;/version&gt;
</span><span class="cx">     &lt;packaging&gt;bundle&lt;/packaging&gt;
</span><del>-    &lt;name&gt;Scripted Common&lt;/name&gt;
</del><ins>+    &lt;name&gt;Groovy Connector&lt;/name&gt;
</ins><span class="cx">     &lt;description&gt;This is a generic bundle that contains \
base classes and interfaces needed to write a scripted </span><span class="cx">       \
connector, such as Scripted connector. </span><span class="cx">     \
&lt;/description&gt; </span><span class="cx">     &lt;properties&gt;
</span><del>-        \
&lt;connectorPackage&gt;org.forgerock.openicf.connectors.groovy&lt;/connectorPackage&gt;
 </del><ins>+        &lt;!-- maven-compiler-plugin --&gt;
+        &lt;maven.compiler.target&gt;1.7&lt;/maven.compiler.target&gt;
+        &lt;maven.compiler.source&gt;1.7&lt;/maven.compiler.source&gt;
+        &lt;connectorPackage&gt;org.forgerock.openicf.connectors&lt;/connectorPackage&gt;
 </ins><span class="cx">         \
&lt;connectorClass&gt;ScriptedConnector&lt;/connectorClass&gt; </span><ins>+        \
&lt;openicf.osgi.import.defaults&gt; +            \
org.codehaus.groovy*;version=&quot;[1.8,3)&quot;,groovy*;version=&quot;[1.8,3)&quot; \
+        &lt;/openicf.osgi.import.defaults&gt; </ins><span class="cx">     \
&lt;/properties&gt; </span><span class="cx">     &lt;repositories&gt;
</span><span class="cx">         &lt;repository&gt;
</span><span class="lines">@@ -78,6 +84,45 @@
</span><span class="cx">             &lt;scope&gt;provided&lt;/scope&gt;
</span><span class="cx">         &lt;/dependency&gt;
</span><span class="cx"> 
</span><ins>+        &lt;!-- Scripted SQL --&gt;
+        &lt;dependency&gt;
+            &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
+            &lt;artifactId&gt;tomcat-jdbc&lt;/artifactId&gt;
+            &lt;version&gt;8.0.5&lt;/version&gt;
+            &lt;!--version&gt;7.0.52&lt;/version--&gt;
+        &lt;/dependency&gt;
+
+        &lt;!-- Scripted REST --&gt;
+        &lt;dependency&gt;
+            &lt;groupId&gt;org.codehaus.groovy.modules.http-builder&lt;/groupId&gt;
+            &lt;artifactId&gt;http-builder&lt;/artifactId&gt;
+            &lt;version&gt;0.7.1&lt;/version&gt;
+        &lt;/dependency&gt;
+        &lt;dependency&gt;
+            &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
+            &lt;artifactId&gt;httpcore&lt;/artifactId&gt;
+            &lt;version&gt;4.3.1&lt;/version&gt;
+        &lt;/dependency&gt;
+        &lt;dependency&gt;
+            &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
+            &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
+            &lt;version&gt;4.3.1&lt;/version&gt;
+        &lt;/dependency&gt;
+
+        &lt;!-- Scripted SOAP --&gt;
+
+        &lt;!-- CREST --&gt;
+        &lt;dependency&gt;
+            &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
+            &lt;artifactId&gt;httpasyncclient&lt;/artifactId&gt;
+            &lt;version&gt;4.0.1&lt;/version&gt;
+        &lt;/dependency&gt;
+        &lt;dependency&gt;
+            &lt;groupId&gt;org.forgerock.commons&lt;/groupId&gt;
+            &lt;artifactId&gt;json-resource&lt;/artifactId&gt;
+            &lt;version&gt;2.2.4&lt;/version&gt;
+        &lt;/dependency&gt;
+
</ins><span class="cx">         &lt;!-- Test Dependencies --&gt;
</span><span class="cx">         &lt;dependency&gt;
</span><span class="cx">             &lt;groupId&gt;org.testng&lt;/groupId&gt;
</span><span class="lines">@@ -94,6 +139,50 @@
</span><span class="cx">             \
&lt;artifactId&gt;connector-test-common&lt;/artifactId&gt; </span><span class="cx">   \
&lt;scope&gt;test&lt;/scope&gt; </span><span class="cx">         &lt;/dependency&gt;
</span><ins>+        &lt;!--dependency&gt;
+            &lt;groupId&gt;org.forgerock.openicf.framework&lt;/groupId&gt;
+            &lt;artifactId&gt;icfl-over-slf4j&lt;/artifactId&gt;
+            &lt;version&gt;1.4.0.0-SNAPSHOT&lt;/version&gt;
+            &lt;scope&gt;test&lt;/scope&gt;
+        &lt;/dependency&gt;
+        &lt;dependency&gt;
+            &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
+            &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
+            &lt;version&gt;1.1.1&lt;/version&gt;
+            &lt;scope&gt;test&lt;/scope&gt;
+        &lt;/dependency--&gt;
+
+        &lt;dependency&gt;
+            &lt;groupId&gt;org.forgerock.commons&lt;/groupId&gt;
+            &lt;artifactId&gt;json-resource-servlet&lt;/artifactId&gt;
+            &lt;version&gt;2.2.4&lt;/version&gt;
+            &lt;scope&gt;test&lt;/scope&gt;
+        &lt;/dependency&gt;
+        &lt;dependency&gt;
+            &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
+            &lt;artifactId&gt;jetty-servlet&lt;/artifactId&gt;
+            &lt;version&gt;8.1.14.v20131031&lt;/version&gt;
+            &lt;scope&gt;test&lt;/scope&gt;
+        &lt;/dependency&gt;
+        &lt;dependency&gt;
+            &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
+            &lt;artifactId&gt;jetty-server&lt;/artifactId&gt;
+            &lt;version&gt;8.1.14.v20131031&lt;/version&gt;
+            &lt;scope&gt;test&lt;/scope&gt;
+        &lt;/dependency&gt;
+
+        &lt;dependency&gt;
+            &lt;groupId&gt;org.hsqldb&lt;/groupId&gt;
+            &lt;artifactId&gt;hsqldb&lt;/artifactId&gt;
+            &lt;version&gt;2.3.2&lt;/version&gt;
+            &lt;scope&gt;test&lt;/scope&gt;
+        &lt;/dependency&gt;
+        &lt;dependency&gt;
+            &lt;groupId&gt;com.h2database&lt;/groupId&gt;
+            &lt;artifactId&gt;h2&lt;/artifactId&gt;
+            &lt;version&gt;1.3.175&lt;/version&gt;
+            &lt;scope&gt;test&lt;/scope&gt;
+        &lt;/dependency&gt;
</ins><span class="cx">     &lt;/dependencies&gt;
</span><span class="cx">     &lt;build&gt;
</span><span class="cx">         &lt;pluginManagement&gt;
</span><span class="lines">@@ -167,8 +256,82 @@
</span><span class="cx">                         \
&lt;artifactId&gt;groovy-all&lt;/artifactId&gt; </span><span class="cx">              \
&lt;version&gt;2.2.2&lt;/version&gt; </span><span class="cx">                     \
&lt;/dependency&gt; </span><ins>+                    &lt;dependency&gt;
+                        &lt;groupId&gt;org.forgerock.commons&lt;/groupId&gt;
+                        &lt;artifactId&gt;json-resource&lt;/artifactId&gt;
+                        &lt;version&gt;2.2.4&lt;/version&gt;
+                    &lt;/dependency&gt;
+                    &lt;dependency&gt;
+                        &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
+                        &lt;artifactId&gt;httpasyncclient&lt;/artifactId&gt;
+                        &lt;version&gt;4.0.1&lt;/version&gt;
+                    &lt;/dependency&gt;
+                    &lt;dependency&gt;
+                        \
&lt;groupId&gt;org.codehaus.groovy.modules.http-builder&lt;/groupId&gt; +             \
&lt;artifactId&gt;http-builder&lt;/artifactId&gt; +                        \
&lt;version&gt;0.7.1&lt;/version&gt; +                    &lt;/dependency&gt;
+                    &lt;dependency&gt;
+                        &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
+                        &lt;artifactId&gt;tomcat-jdbc&lt;/artifactId&gt;
+                        &lt;version&gt;8.0.5&lt;/version&gt;
+                        &lt;!--version&gt;7.0.52&lt;/version--&gt;
+                    &lt;/dependency&gt;
</ins><span class="cx">                 &lt;/dependencies&gt;
</span><span class="cx">             &lt;/plugin&gt;
</span><ins>+            &lt;plugin&gt;
+                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
+                &lt;artifactId&gt;maven-checkstyle-plugin&lt;/artifactId&gt;
+                &lt;configuration&gt;
+                    \
&lt;excludes&gt;**/generated-sources/groovy-stubs/**/*&lt;/excludes&gt; +             \
&lt;/configuration&gt; +            &lt;/plugin&gt;
+            &lt;plugin&gt;
+                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
+                &lt;artifactId&gt;maven-pmd-plugin&lt;/artifactId&gt;
+                &lt;version&gt;3.1&lt;/version&gt;
+                &lt;configuration&gt;
+                    &lt;excludes&gt;
+                        &lt;exclude&gt;**/groovy-stubs/*.java&lt;/exclude&gt;
+                    &lt;/excludes&gt;
+                    &lt;excludeRoots&gt;
+                        \
&lt;excludeRoot&gt;${project.build.directory}/generated-sources/groovy-stubs&lt;/excludeRoot&gt;
 +                    &lt;/excludeRoots&gt;
+                &lt;/configuration&gt;
+            &lt;/plugin&gt;
+            &lt;plugin&gt;
+                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
+                &lt;artifactId&gt;maven-jxr-plugin&lt;/artifactId&gt;
+                &lt;version&gt;2.4&lt;/version&gt;
+                &lt;configuration&gt;
+                    &lt;linkJavadoc&gt;true&lt;/linkJavadoc&gt;
+                    &lt;includes&gt;
+                        &lt;include&gt;**/*.java&lt;/include&gt;
+                        &lt;include&gt;**/*.groovy&lt;/include&gt;
+                    &lt;/includes&gt;
+                    &lt;excludes&gt;
+                        &lt;exclude&gt;target/generated/groovy-stubs&lt;/exclude&gt;
+                    &lt;/excludes&gt;
+                &lt;/configuration&gt;
+            &lt;/plugin&gt;
+            &lt;plugin&gt;
+                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
+                &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
+                &lt;version&gt;2.4&lt;/version&gt;
+                &lt;configuration&gt;
+                    &lt;descriptors&gt;
+                        \
&lt;descriptor&gt;src/assemble/samples.xml&lt;/descriptor&gt; +                    \
&lt;/descriptors&gt; +                &lt;/configuration&gt;
+                &lt;executions&gt;
+                    &lt;execution&gt;
+                        &lt;phase&gt;package&lt;/phase&gt;
+                        &lt;goals&gt;
+                            &lt;goal&gt;single&lt;/goal&gt;
+                        &lt;/goals&gt;
+                    &lt;/execution&gt;
+                &lt;/executions&gt;
+            &lt;/plugin&gt;
</ins><span class="cx">         &lt;/plugins&gt;
</span><span class="cx">     &lt;/build&gt;
</span><span class="cx"> &lt;/project&gt;
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcassemblesamplesxml"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/assemble/samples.xml (0 => 6509)</h4> <pre \
class="diff"><span> <span class="info">--- \
trunk/connectors/java/scriptedcommon/src/assemble/samples.xml	                        \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/assemble/samples.xml	2014-04-15 09:47:57 \
UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;!--
+  ~ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+  ~
+  ~ Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+  ~
+  ~ The contents of this file are subject to the terms
+  ~ of the Common Development and Distribution License
+  ~ (the License). You may not use this file except in
+  ~ compliance with the License.
+  ~
+  ~ You can obtain a copy of the License at
+  ~ http://forgerock.org/license/CDDLv1.0.html
+  ~ See the License for the specific language governing
+  ~ permission and limitations under the License.
+  ~
+  ~ When distributing Covered Code, include this CDDL
+  ~ Header Notice in each file and include the License file
+  ~ at http://forgerock.org/license/CDDLv1.0.html
+  ~ If applicable, add the following below the CDDL Header,
+  ~ with the fields enclosed by brackets [] replaced by
+  ~ your own identifying information:
+  ~ &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+  --&gt;
+
+&lt;!--
+    URL zipUrl = ??.class.getResource(&quot;/resources/groovy-connector-1.4.0.0-SNAPSHOT-samples.zip&quot;);
 +    URL entryUrl = new URL(&quot;jar:&quot; + zipUrl + &quot;!/groovy/&quot;);
+--&gt;
+
+&lt;assembly xmlns=&quot;http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2&quot;
 +          xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
+          xsi:schemaLocation=&quot;http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 \
http://maven.apache.org/xsd/assembly-1.1.2.xsd&quot;&gt; +    \
&lt;id&gt;samples&lt;/id&gt; +    &lt;formats&gt;
+        &lt;format&gt;zip&lt;/format&gt;
+    &lt;/formats&gt;
+    &lt;fileSets&gt;
+        &lt;fileSet&gt;
+            &lt;directory&gt;${basedir}/src/test/resources&lt;/directory&gt;
+            &lt;outputDirectory&gt;/&lt;/outputDirectory&gt;
+            &lt;includes&gt;
+                &lt;include&gt;**/*.*&lt;/include&gt;
+            &lt;/includes&gt;
+        &lt;/fileSet&gt;
+    &lt;/fileSets&gt;
+&lt;/assembly&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmaindocbkxchapscriptedcommonxml"></a>
<div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/main/docbkx/chap-scriptedcommon.xml (6508 => \
6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/docbkx/chap-scriptedcommon.xml	2014-04-14 \
                21:18:24 UTC (rev 6508)
+++ trunk/connectors/java/scriptedcommon/src/main/docbkx/chap-scriptedcommon.xml	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -60,6 +60,9 @@
</span><span class="cx"> 
</span><span class="cx">  &lt;xinclude:include \
href=&quot;sec-config-scriptedconnector.xml&quot; /&gt; </span><span class="cx">  \
&lt;xinclude:include href=&quot;sec-config-scriptedpoolableconnector.xml&quot; /&gt; \
</span><ins>+ &lt;xinclude:include \
href=&quot;sec-config-scriptedcrestconnector.xml&quot; /&gt; + &lt;xinclude:include \
href=&quot;sec-config-scriptedrestconnector.xml&quot; /&gt; + &lt;xinclude:include \
href=&quot;sec-config-scriptedsqlconnector.xml&quot; /&gt; </ins><span class="cx">  \
&lt;!--xinclude:include href=&quot;sec-schema-scriptedcommon.xml&quot; &gt; \
</span><span class="cx">      &lt;fallback&gt; </span><span class="cx">          \
&lt;para&gt; </span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmaindocbkxindexxml"></a>
<div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/main/docbkx/index.xml (6508 => 6509)</h4> \
<pre class="diff"><span> <span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/docbkx/index.xml	2014-04-14 21:18:24 \
                UTC (rev 6508)
+++ trunk/connectors/java/scriptedcommon/src/main/docbkx/index.xml	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -20,7 +20,7 @@
</span><span class="cx">   !
</span><span class="cx">   ! CCPL HEADER END
</span><span class="cx">   !
</span><del>-  !      Copyright 2011-2013 ForgeRock AS
</del><ins>+  !      Copyright 2011-2014 ForgeRock AS
</ins><span class="cx">   !
</span><span class="cx"> --&gt;
</span><span class="cx"> &lt;book xml:id='integrators-guide'
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmaindocbkxlegalxml"></a>
<div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/main/docbkx/legal.xml (6508 => 6509)</h4> \
<pre class="diff"><span> <span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/docbkx/legal.xml	2014-04-14 21:18:24 \
                UTC (rev 6508)
+++ trunk/connectors/java/scriptedcommon/src/main/docbkx/legal.xml	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -20,7 +20,7 @@
</span><span class="cx">   !
</span><span class="cx">   ! CCPL HEADER END
</span><span class="cx">   !
</span><del>-  !      Copyright 2011-2013 ForgeRock AS
</del><ins>+  !      Copyright 2011-2014 ForgeRock AS
</ins><span class="cx">   !
</span><span class="cx"> --&gt;
</span><span class="cx"> &lt;legalnotice xml:id='legalnotice'
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfconnectorsscriptedcrestRemoteConnectiongroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/scriptedcrest/RemoteConnection.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/scriptedcrest/RemoteConnection.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/scriptedcrest/RemoteConnection.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,178 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+package org.forgerock.openicf.connectors.scriptedcrest
+
+import groovy.json.JsonException
+import org.apache.http.HttpEntity
+import org.apache.http.HttpResponse
+import org.apache.http.StatusLine
+import org.apache.http.client.methods.HttpUriRequest
+import org.apache.http.concurrent.FutureCallback
+import org.apache.http.nio.protocol.HttpAsyncResponseConsumer
+import org.forgerock.json.fluent.JsonValue
+import org.forgerock.json.resource.BadRequestException
+import org.forgerock.json.resource.InternalServerErrorException
+import org.forgerock.json.resource.QueryResult
+import org.forgerock.json.resource.QueryResultHandler
+import org.forgerock.json.resource.ResourceException
+import org.forgerock.openicf.misc.crest.AbstractRemoteConnection
+import org.forgerock.openicf.misc.crest.AbstractRemoteConnection.HttpResponseResourceException
 +//Add import org.forgerock.openicf.misc.crest.AbstractRemoteConnection.HttpResponseResourceException
 +
+import java.util.concurrent.Future
+
+/**
+ *
+ *
+ * @author Laszlo Hordos
+ */
+class RemoteConnection extends AbstractRemoteConnection {
+
+    private final ScriptedCRESTConfiguration configuration;
+
+    RemoteConnection(final ScriptedCRESTConfiguration configuration) {
+        super(configuration.getResourceName(), configuration.getHttpHost())
+        this.configuration = configuration
+    }
+
+    @Override
+    public boolean isClosed() {
+        return configuration.isClosed();
+    }
+
+    def &lt;T&gt; Future&lt;T&gt; execute(HttpUriRequest request, \
HttpAsyncResponseConsumer&lt;T&gt; responseConsumer, FutureCallback&lt;T&gt; \
callback) { +        return configuration.execute(request, responseConsumer, \
callback) +    }
+
+
+    protected JsonValue parseJsonBody(final HttpEntity entity, final boolean \
allowEmpty) +            throws ResourceException {
+        StreamingJsonSlurper parser = new StreamingJsonSlurper();
+        try {
+
+            // Ensure that there is no trailing data following the JSON
+            // resource.
+            boolean hasTrailingGarbage;
+            def content = parser.parse(entity, null, (Closure) { lexer, object -&gt;
+                try {
+                    hasTrailingGarbage = lexer.nextToken() != null;
+                } catch (JsonException e) {
+                    hasTrailingGarbage = true;
+                }
+            })
+
+
+            if (hasTrailingGarbage) {
+                throw new BadRequestException(
+                        &quot;The request could not be processed because there is \
&quot; +                                + &quot;trailing data after the JSON \
content&quot;); +            }
+
+            return new JsonValue(content);
+        } catch (final JsonException e) {
+            throw new BadRequestException(
+                    &quot;The request could not be processed because the provided \
&quot; +                            + &quot;content is not valid JSON&quot;, \
e).setDetail(new JsonValue(e +                    .getMessage()));
+        } catch (final EOFException e) {
+            if (allowEmpty) {
+                return null;
+            } else {
+                throw new BadRequestException(&quot;The request could not be \
processed &quot; +                        + &quot;because it did not contain any JSON \
content&quot;, e); +            }
+        } catch (final IOException e) {
+            throw adapt(e);
+        }
+    }
+
+    protected QueryResult parseQueryResponse(final HttpResponse response,
+                                             final QueryResultHandler handler) \
throws ResourceException { +        final StatusLine statusLine = \
response.getStatusLine(); +        final HttpEntity entity = response.getEntity();
+
+        ResourceException exception = isOK(statusLine, entity);
+
+        if (null != exception) {
+            throw exception;
+        }
+
+        StreamingJsonSlurper parser = new StreamingJsonSlurper();
+        try {
+
+            // Ensure that there is no trailing data following the
+            // JSON
+            // resource.
+            boolean hasTrailingGarbage;
+
+            def content = parser.parse(entity, {
+                handler.handleResource(getAsResource(it));
+            }, { lexer, object -&gt;
+                try {
+                    hasTrailingGarbage = lexer.nextToken() != null;
+                } catch (JsonException e) {
+                    hasTrailingGarbage = true;
+                }
+            })
+
+            if (content.&quot;${QueryResult.FIELD_ERROR}&quot; != null) {
+                exception =
+                        getAsResourceException(new \
JsonValue(content.&quot;${QueryResult.FIELD_ERROR}&quot;)); +                throw \
new HttpResponseResourceException(exception); +            }
+
+            String pagedResultsCookie = \
content.&quot;${QueryResult.FIELD_PAGED_RESULTS_COOKIE}&quot;; +            int \
remainingPagedResults = \
content.&quot;${QueryResult.FIELD_REMAINING_PAGED_RESULTS}&quot;; +
+
+            if (hasTrailingGarbage) {
+                // throw new BadRequestException(
+                // &quot;The request could not be processed because there is &quot;
+                // + &quot;trailing data after the JSON content&quot;);
+            }
+            return new QueryResult(pagedResultsCookie, remainingPagedResults);
+
+        } catch (final JsonException e) {
+            // throw new BadRequestException(
+            // &quot;The request could not be processed because the provided &quot;
+            // + &quot;content is not valid JSON&quot;, e).setDetail(new
+            // JsonValue(e
+            // .getMessage()));
+            throw new InternalServerErrorException(e);
+        } catch (final EOFException e) {
+            // if (allowEmpty) {
+            // return null;
+            // } else {
+            // throw new
+            // BadRequestException(&quot;The request could not be processed &quot;
+            // + &quot;because it did not contain any JSON content&quot;);
+            // }
+            throw new InternalServerErrorException(e);
+        } catch (final IOException e) {
+            // throw adapt(e);
+            throw new InternalServerErrorException(e);
+        }
+    }
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfconnectorsscriptedcrestScriptedCRESTConfigurationgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/scriptedcrest/ScriptedCRESTConfiguration.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/scriptedcrest/ScriptedCRESTConfiguration.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/scriptedcrest/ScriptedCRESTConfiguration.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,291 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+package org.forgerock.openicf.connectors.scriptedcrest
+
+import org.apache.http.HttpHost
+import org.apache.http.auth.AuthScope
+import org.apache.http.auth.UsernamePasswordCredentials
+import org.apache.http.client.CredentialsProvider
+import org.apache.http.client.config.RequestConfig
+import org.apache.http.client.methods.HttpUriRequest
+import org.apache.http.client.protocol.HttpClientContext
+import org.apache.http.concurrent.FutureCallback
+import org.apache.http.conn.routing.HttpRoute
+import org.apache.http.conn.ssl.SSLContexts
+import org.apache.http.conn.ssl.TrustSelfSignedStrategy
+import org.apache.http.impl.client.BasicCookieStore
+import org.apache.http.impl.client.BasicCredentialsProvider
+import org.apache.http.impl.nio.client.CloseableHttpAsyncClient
+import org.apache.http.impl.nio.client.HttpAsyncClients
+import org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager
+import org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor
+import org.apache.http.nio.client.HttpAsyncClient
+import org.apache.http.nio.client.methods.HttpAsyncMethods
+import org.apache.http.nio.conn.NHttpClientConnectionManager
+import org.apache.http.nio.conn.ssl.SSLIOSessionStrategy
+import org.apache.http.nio.protocol.HttpAsyncResponseConsumer
+import org.apache.http.nio.reactor.ConnectingIOReactor
+import org.forgerock.json.resource.ResourceName
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration
+import org.identityconnectors.common.Assertions
+import org.identityconnectors.framework.spi.ConfigurationProperty
+
+import javax.net.ssl.SSLContext
+import java.security.KeyStore
+import java.util.concurrent.Future
+import java.util.concurrent.TimeUnit
+
+/**
+ * A ScriptedCRESTConfiguration.
+ *
+ * @author Laszlo Hordos
+ */
+class ScriptedCRESTConfiguration extends ScriptedConfiguration {
+
+    URI serviceAddress = null;
+
+    URI proxyAddress = null;
+
+    @ConfigurationProperty(required = true)
+    URI getServiceAddress() {
+        return serviceAddress
+    }
+
+    void setServiceAddress(URI serviceAddress) {
+        this.serviceAddress = serviceAddress
+        host = null;
+        resourceName = null;
+    }
+
+    URI getProxyAddress() {
+        return proxyAddress
+    }
+
+    void setProxyAddress(URI proxyAddress) {
+        this.proxyAddress = proxyAddress
+        proxy = null;
+    }
+
+    @Override
+    void validate() {
+        Assertions.nullCheck(serviceAddress, &quot;serviceAddress&quot;)
+        super.validate()
+    }
+
+    private HttpHost host = null;
+
+    private HttpHost proxy = null;
+
+    private ResourceName resourceName = null;
+
+
+    ResourceName getResourceName() {
+        resourceName = ResourceName.valueOf(serviceAddress?.path);
+    }
+
+    private HttpHost getHttpHost() {
+        host = new HttpHost(serviceAddress?.host, serviceAddress?.port, \
serviceAddress?.scheme); +
+    }
+
+    private HttpHost getProxyHost() {
+        if (null != proxyAddress) {
+            return new HttpHost(proxyAddress?.host, proxyAddress?.port, \
proxyAddress?.scheme); +        }
+        return null;
+    }
+
+
+    private CloseableHttpAsyncClient httpClient = null;
+
+    private IdleConnectionEvictor connectionEvictor = null;
+
+    // Create a local instance of cookie store
+    private final BasicCookieStore cookieStore = new BasicCookieStore();
+
+
+    boolean isClosed() {
+        return null == httpClient || !httpClient.isRunning();
+    }
+
+    public &lt;T&gt; Future&lt;T&gt; execute(
+            final HttpUriRequest request,
+            final HttpAsyncResponseConsumer&lt;T&gt; responseConsumer, final \
FutureCallback&lt;T&gt; callback) { +        HttpClientContext localContext = \
HttpClientContext.create(); +        localContext.setCookieStore(cookieStore);
+
+        return getHttpAsyncClient().execute(
+                HttpAsyncMethods.create(getHttpHost(), request),
+                responseConsumer,
+                localContext, callback);
+    }
+
+    HttpAsyncClient getHttpAsyncClient() {
+        if (null == httpClient) {
+            synchronized (this) {
+                if (null == httpClient) {
+
+                    //SEE: \
http://hc.apache.org/httpcomponents-asyncclient-4.0.x/httpasyncclient/examples/org/apache/http/examples/nio/client/AsyncClientConfiguration.java
 +
+                    if (false) {
+
+                        KeyStore trustStore = \
KeyStore.getInstance(KeyStore.getDefaultType()); +                        \
FileInputStream instream = new FileInputStream(new File(&quot;my.keystore&quot;)); +  \
try { +                            trustStore.load(instream, \
&quot;nopassword&quot;.toCharArray()); +                        } finally {
+                            instream.close();
+                        }
+                        // Trust own CA and all self-signed certs
+                        SSLContext sslcontext = SSLContexts.custom()
+                                .loadTrustMaterial(trustStore, new \
TrustSelfSignedStrategy()) +                                .build();
+                        // Allow TLSv1 protocol only
+                        SSLIOSessionStrategy sslSessionStrategy = new \
SSLIOSessionStrategy( +                                sslcontext,
+                                [&quot;TLSv1&quot;] as String[],
+                                null,
+                                \
SSLIOSessionStrategy.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); +                    }
+
+                    // Authentication
+
+                    // It's part of the http client spec to request the resource \
anonymously +                    // first and respond to the 401 with the \
Authorization header. +                    CredentialsProvider credsProvider = new \
BasicCredentialsProvider(); +                    credsProvider.setCredentials(
+                            new AuthScope(getHttpHost().getHostName(), \
getHttpHost().getPort()), +                            new \
UsernamePasswordCredentials(&quot;admin&quot;, &quot;Passw0rd&quot;)); +
+                    //PROXY
+                    if (false) {
+                        HttpHost proxy = new HttpHost(&quot;someproxy&quot;, 8080);
+                        RequestConfig config = RequestConfig.custom()
+                                .setProxy(proxy)
+
+                        // configure timeout on the entire client
+                        /*
+                                                             * .
+                                                             * \
setConnectionRequestTimeout +                                                         \
* ( 50). +                                                             * \
setConnectTimeout +                                                             * \
(50) +                                                             * \
.setSocketTimeout +                                                             * \
(50) +
+                        */
+                                .build();
+
+                        credsProvider.setCredentials(
+                                new AuthScope(proxy.getHostName(), proxy.getPort()),
+                                new \
UsernamePasswordCredentials(&quot;username&quot;, &quot;password&quot;)); +           \
} +
+
+
+                    ConnectingIOReactor ioReactor = new \
DefaultConnectingIOReactor(); +                    \
PoolingNHttpClientConnectionManager cm = new \
PoolingNHttpClientConnectionManager(ioReactor); +                    // Increase max \
total connection to 200 +                    cm.setMaxTotal(200);
+                    // Increase default max connection per route to 20
+                    cm.setDefaultMaxPerRoute(20);
+                    // Increase max connections for target host to 50
+                    cm.setMaxPerRoute(new HttpRoute(getHttpHost()), 50);
+
+
+                    httpClient = HttpAsyncClients.custom()
+                            .setConnectionManager(cm)
+                    //.setSSLStrategy(sslSessionStrategy)
+                            .setDefaultCredentialsProvider(credsProvider)
+                    //.setDefaultRequestConfig(config)
+                            .build();
+
+
+                    httpClient.start();
+
+                    connectionEvictor = new IdleConnectionEvictor(cm);
+                    connectionEvictor.start();
+
+                }
+            }
+        }
+        return httpClient;
+    }
+
+    @Override
+    void release() {
+        synchronized (this) {
+            super.release()
+            if (null != httpClient) {
+                httpClient.close();
+                httpClient = null;
+            }
+            if (null != connectionEvictor) {
+                // Shut down the evictor thread
+                connectionEvictor.shutdown();
+                connectionEvictor.join();
+                connectionEvictor = null;
+            }
+        }
+    }
+
+
+    public static class IdleConnectionEvictor extends Thread {
+
+        private final NHttpClientConnectionManager connMgr;
+
+        private volatile boolean shutdown;
+
+        public IdleConnectionEvictor(NHttpClientConnectionManager connMgr) {
+            super();
+            this.connMgr = connMgr;
+        }
+
+        @Override
+        public void run() {
+            try {
+                while (!shutdown) {
+                    synchronized (this) {
+                        wait(5000);
+                        // Close expired connections
+                        connMgr.closeExpiredConnections();
+                        // Optionally, close connections
+                        // that have been idle longer than 5 sec
+                        connMgr.closeIdleConnections(5, TimeUnit.SECONDS);
+                    }
+                }
+            } catch (InterruptedException ex) {
+                // terminate
+            }
+        }
+
+        public void shutdown() {
+            shutdown = true;
+            synchronized (this) {
+                notifyAll();
+            }
+        }
+    }
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfconnectorsscriptedrestScriptedRESTConfigurationgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/scriptedrest/ScriptedRESTConfiguration.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/scriptedrest/ScriptedRESTConfiguration.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/scriptedrest/ScriptedRESTConfiguration.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,314 @@
</span><ins>+/*
+ * DO NOT REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2013-2014 ForgeRock AS All rights reserved.
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+package org.forgerock.openicf.connectors.scriptedrest
+
+import groovyx.net.http.ContentType
+import groovyx.net.http.RESTClient
+import groovyx.net.http.StringHashMap
+import org.apache.http.HttpHost
+import org.apache.http.auth.AuthScope
+import org.apache.http.auth.UsernamePasswordCredentials
+import org.apache.http.client.AuthCache
+import org.apache.http.client.ClientProtocolException
+import org.apache.http.client.CredentialsProvider
+import org.apache.http.client.config.RequestConfig
+import org.apache.http.client.protocol.HttpClientContext
+import org.apache.http.conn.routing.HttpRoute
+import org.apache.http.impl.auth.BasicScheme
+import org.apache.http.impl.client.BasicAuthCache
+import org.apache.http.impl.client.BasicCredentialsProvider
+import org.apache.http.impl.client.CloseableHttpClient
+import org.apache.http.impl.client.HttpClientBuilder
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration
+import org.identityconnectors.common.Assertions
+import org.identityconnectors.common.security.GuardedString
+import org.identityconnectors.framework.spi.AbstractConfiguration
+import org.identityconnectors.framework.spi.ConfigurationProperty
+import org.identityconnectors.framework.spi.StatefulConfiguration
+
+/**
+ * Extends the {@link AbstractConfiguration} class to provide all the necessary
+ * parameters to initialize the ScriptedREST Connector.
+ *
+ * @author Gael Allioux &lt;gael.allioux@gmail.com&gt;
+ * @version 1.1.0.0
+ */
+public class ScriptedRESTConfiguration extends ScriptedConfiguration {
+
+    // Exposed configuration properties.
+
+    // ===============================================
+    // HTTP authentication
+    // ===============================================
+
+    public enum AuthMethod {
+        NONE, BASIC, BASIC_PREEMPTIVE, DIGEST, NTLM, SPNEGO, CERT, OAUTH
+    }
+
+    /*
+     * authMethod
+     * Can be:
+     *  BASIC
+     *  BASIC_PREEMPTIVE
+     *  CERT
+     *  OAUTH
+     */
+    String defaultAuthMethod = AuthMethod.BASIC.name();
+
+    /**
+     * The Remote user to authenticate with.
+     */
+    private String username = null;
+
+    /**
+     * The Password to authenticate with.
+     */
+    private GuardedString password = null;
+
+    @ConfigurationProperty(order = 1, displayMessageKey = \
&quot;username.display&quot;, +            groupMessageKey = &quot;basic.group&quot;, \
helpMessageKey = &quot;username.help&quot;, +            required = true)
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    @ConfigurationProperty(order = 2, displayMessageKey = \
&quot;password.display&quot;, +            groupMessageKey = &quot;basic.group&quot;, \
helpMessageKey = &quot;password.help&quot;, +            confidential = true)
+    public GuardedString getPassword() {
+        return password;
+    }
+
+    public void setPassword(GuardedString password) {
+        this.password = password;
+    }
+
+    // ===============================================
+    // HTTP connection
+    // ===============================================
+
+    URI serviceAddress = null;
+
+    @ConfigurationProperty(required = true)
+    URI getServiceAddress() {
+        return serviceAddress
+    }
+
+    void setServiceAddress(URI serviceAddress) {
+        this.serviceAddress = serviceAddress
+        host = null;
+    }
+
+    // ===============================================
+    // HTTP Proxy
+    // ===============================================
+
+    URI proxyAddress = null;
+
+    URI getProxyAddress() {
+        return proxyAddress
+    }
+
+    void setProxyAddress(URI proxyAddress) {
+        this.proxyAddress = proxyAddress
+        proxy = null;
+    }
+
+    // ===============================================
+    // HTTP content
+    // ===============================================
+
+    /*
+     * default content type
+     * Can be:
+     *  ANY
+     *  TEXT(&quot;text/plain&quot;)
+     *  JSON(&quot;application/json&quot;,&quot;application/javascript&quot;,&quot;text/javascript&quot;)
 +     *  XML(&quot;application/xml&quot;,&quot;text/xml&quot;,&quot;application/xhtml+xml&quot;,&quot;application/atom+xml&quot;)
 +     *  HTML(&quot;text/html&quot;)
+     *  URLENC(&quot;application/x-www-form-urlencoded&quot;)
+     *  BINARY(&quot;application/octet-stream&quot;)
+     */
+    String defaultContentType = ContentType.JSON.name();
+
+    protected final Map&lt;Object, Object&gt; defaultRequestHeaders = new \
StringHashMap&lt;Object&gt;(); +
+    String[] getDefaultRequestHeaders() {
+        def headers = []
+        return defaultRequestHeaders.each { key, value -&gt;
+            headers.add(&quot;${key}=${value}&quot;)
+        }
+        return headers as String[]
+    }
+
+    void setDefaultRequestHeaders(String[] headers) {
+        defaultRequestHeaders.clear()
+        if (null != headers) {
+            headers.each {
+                def kv = it.split('=')
+                assert kv.size() == 2
+                defaultRequestHeaders.put(kv[0], kv[1])
+            }
+        }
+    }
+
+    private HttpHost host = null;
+
+    private HttpHost proxy = null;
+
+    private HttpHost getHttpHost() {
+        return new HttpHost(serviceAddress?.host, serviceAddress?.port, \
serviceAddress?.scheme); +    }
+
+    private HttpHost getProxyHost() {
+        if (proxyAddress != null) {
+            return new HttpHost(proxyAddress?.host, proxyAddress?.port, \
proxyAddress?.scheme); +        }
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void validate() {
+        Assertions.nullCheck(getServiceAddress(), &quot;serviceAddress&quot;)
+        super.validate()
+    }
+
+    private CloseableHttpClient httpClient = null;
+    //Need for Preemptive Auth
+    private AuthCache authCache = null;
+
+    @SuppressWarnings(&quot;fallthrough&quot;)
+    RESTClient getRESTClient() {
+        if (null == httpClient) {
+            synchronized (this) {
+                if (null == httpClient) {
+
+                    //SETUP: org.apache.http
+
+                    PoolingHttpClientConnectionManager cm = new \
PoolingHttpClientConnectionManager(); +                    // Increase max total \
connection to 200 +                    cm.setMaxTotal(200);
+                    // Increase default max connection per route to 20
+                    cm.setDefaultMaxPerRoute(20);
+                    // Increase max connections for localhost:8080 to 50
+
+                    cm.setMaxPerRoute(new HttpRoute(getHttpHost()), 50);
+
+                    // configure timeout on the entire client
+                    RequestConfig requestConfig = RequestConfig.custom()/*
+                                                             * .
+                                                             * \
setConnectionRequestTimeout +                                                         \
* ( 50). +                                                             * \
setConnectTimeout +                                                             * \
(50) +                                                             * \
.setSocketTimeout +                                                             * \
(50) +                                                             */.build();
+
+                    HttpClientBuilder builder =
+                            HttpClientBuilder.create().
+                                    setConnectionManager(cm).
+                                    setDefaultRequestConfig(requestConfig).
+                                    setProxy(getProxyHost());
+
+
+                    switch (AuthMethod.valueOf(getDefaultAuthMethod())) {
+                        case AuthMethod.BASIC_PREEMPTIVE:
+
+                            // Create AuthCache instance
+                            authCache = new BasicAuthCache();
+                            // Generate BASIC scheme object and add it to the local \
auth cache +                            authCache.put(getHttpHost(), new \
BasicScheme()); +
+                        case AuthMethod.BASIC:
+                            // It's part of the http client spec to request the \
resource anonymously +                            // first and respond to the 401 \
with the Authorization header. +                            final CredentialsProvider \
credentialsProvider = new BasicCredentialsProvider(); +
+                            getPassword().access(new GuardedString.Accessor() {
+                                @Override
+                                public void access(char[] clearChars) {
+                                    credentialsProvider.setCredentials(new \
AuthScope(getHttpHost().getHostName(), getHttpHost().getPort()), +                    \
new UsernamePasswordCredentials(getUsername(), new String(clearChars))); +            \
} +                            });
+
+                            \
builder.setDefaultCredentialsProvider(credentialsProvider); +                         \
break; +                        case AuthMethod.NONE:
+                            break;
+                        default:
+                            throw new IllegalArgumentException();
+                    }
+
+                    httpClient = builder.build();
+
+                }
+            }
+        }
+
+        //SETUP: groovyx.net.http
+
+        RESTClient restClient = new RESTClient() {
+            @Override
+            protected Object doRequest(
+                    final groovyx.net.http.HTTPBuilder.RequestConfigDelegate \
delegate) throws ClientProtocolException, IOException { +                // Add \
AuthCache to the execution context +                if (null != authCache) {
+                    //do Preemptive Auth
+                    delegate.getContext().setAttribute(HttpClientContext.AUTH_CACHE, \
authCache); +                }
+                return super.doRequest(delegate)
+            }
+
+            @Override
+            void shutdown() {
+                //Do not allow to shutdown the HttpClient
+            }
+        };
+        restClient.setClient(httpClient);
+        restClient.setUri(getHttpHost().toURI());
+        restClient.setContentType(defaultContentType);
+        restClient.setHeaders(defaultRequestHeaders)
+        return restClient;
+    }
+
+    @Override
+    void release() {
+        super.release()
+        if (null != httpClient) {
+            httpClient.close();
+            httpClient = null;
+        }
+    }
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfconnectorsscriptedsqlScriptedSQLConfigurationgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/scriptedsql/ScriptedSQLConfiguration.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/scriptedsql/ScriptedSQLConfiguration.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/scriptedsql/ScriptedSQLConfiguration.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,174 @@
</span><ins>+/**
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot; Portions Copyrighted [year] [name of copyright owner]&quot;
+ *
+ */
+
+package org.forgerock.openicf.connectors.scriptedsql
+
+import org.apache.tomcat.jdbc.pool.DataSource
+import org.apache.tomcat.jdbc.pool.PoolProperties
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration
+import org.identityconnectors.common.StringUtil
+import org.identityconnectors.common.logging.Log
+import org.identityconnectors.framework.spi.ConfigurationClass
+
+/**
+ * Extends the {@link \
org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration} class to provide all \
the necessary + * parameters to initialize the ScriptedSQL Connector.
+ *
+ * The Driver class. The jdbcDriver is located by connector framework to
+ * connect to database. Required configuration property, and should be
+ * validated.
+ *
+ * &lt;pre&gt;
+ *     &lt;ul&gt;
+ *         &lt;li&gt;Oracle: oracle.jdbc.driver.OracleDriver&lt;/li&gt;
+ *         &lt;li&gt;MySQL: com.mysql.jdbc.Driver&lt;/li&gt;
+ *         &lt;li&gt;DB2: COM.ibm.db2.jdbc.net.DB2Driver&lt;/li&gt;
+ *         &lt;li&gt;MSSQL: com.microsoft.sqlserver.jdbc.SQLServerDriver&lt;/li&gt;
+ *         &lt;li&gt;Sybase: com.sybase.jdbc2.jdbc.SybDriver&lt;/li&gt;
+ *         &lt;li&gt;Derby: org.apache.derby.jdbc.ClientDriver&lt;/li&gt;
+ *         &lt;li&gt;Derby embedded: org.apache.derby.jdbc.EmbeddedDriver&lt;/li&gt;
+ *         &lt;li&gt;&lt;/li&gt;
+ *     &lt;/ul&gt;
+ * &lt;/pre&gt;
+ * &lt;p&gt;
+ *
+ * The new connection validation query. The query can be empty. Then the
+ * auto commit true/false command is applied by default. This can be
+ * insufficient on some database drivers because of caching Then the
+ * validation query is required.
+ *
+ * Database validationQuery notes:
+ * &lt;/p&gt;
+ *
+ * &lt;pre&gt;
+ * &lt;ul&gt;
+ *     &lt;li&gt;hsqldb - select 1 from INFORMATION_SCHEMA.SYSTEM_USERS&lt;/li&gt;
+ *     &lt;li&gt;Oracle - select 1 from dual&lt;/li&gt;
+ *     &lt;li&gt;DB2 - select 1 from sysibm.sysdummy1&lt;/li&gt;
+ *     &lt;li&gt;mysql - select 1&lt;/li&gt;
+ *     &lt;li&gt;microsoft SQL Server - select 1 (tested on SQL-Server 9.0, 10.5 \
[2008])&lt;/li&gt; + *     &lt;li&gt;postgresql - select 1&lt;/li&gt;
+ *     &lt;li&gt;ingres - select 1&lt;/li&gt;
+ *     &lt;li&gt;derby - values 1&lt;/li&gt;
+ *     &lt;li&gt;H2 - select 1&lt;/li&gt;
+ *     &lt;li&gt;Firebird - select 1 from rdb$database&lt;/li&gt;
+ * &lt;/ul&gt;
+ * &lt;/pre&gt;
+ *
+ * @author Gael Allioux &lt;gael.allioux@forgerock.com&gt;
+ *
+ */
+@ConfigurationClass(skipUnsupported = true)
+public class ScriptedSQLConfiguration extends ScriptedConfiguration {
+
+    /**
+     * Setup logging for the {@link ScriptedSQLConfiguration}.
+     */
+    static final Log log = Log.getLog(ScriptedSQLConfiguration.class);
+
+    @Delegate
+    private final PoolProperties poolProperties = new PoolProperties();
+
+    // =======================================================================
+    // Configuration Interface
+    // =======================================================================
+
+    /**
+     * Attempt to validate the arguments added to the Configuration.
+     */
+    @Override
+    public void validate() {
+        super.validate();
+        log.info(&quot;Validate ScriptedSQLConfiguration&quot;);
+        // check the url is configured
+        if (StringUtil.isNotBlank(getUrl())) {
+            log.info(&quot;Validate driver configuration.&quot;);
+
+            // determine if you can get a connection to the database..
+            if (getUsername() == null) {
+                throw new \
IllegalArgumentException(getMessage(&quot;MSG_USER_BLANK&quot;)); +            }
+            // check that there is a pwd to query..
+            if (getPassword() == null) {
+                throw new \
IllegalArgumentException(getMessage(&quot;MSG_PASSWORD_BLANK&quot;)); +            }
+
+            // make sure the jdbcDriver is in the class path..
+            if (StringUtil.isBlank(getDriverClassName())) {
+                throw new \
IllegalArgumentException(getMessage(&quot;MSG_JDBC_DRIVER_BLANK&quot;)); +            \
} +            try {
+                Class.forName(getDriverClassName());
+            } catch (ClassNotFoundException e) {
+                throw new \
IllegalArgumentException(getMessage(&quot;MSG_JDBC_DRIVER_NOT_FOUND&quot;)); +        \
} +            log.ok(&quot;driver configuration is ok&quot;);
+        } else {
+            throw new \
IllegalArgumentException(getMessage(&quot;MSG_JDBC_TEMPLATE_BLANK&quot;)); +        }
+        log.ok(&quot;Configuration is valid&quot;);
+    }
+
+    //private ScriptedConnection&lt;DataSource&gt; scriptedConnection = null;
+    private DataSource dataSource = null;
+
+    DataSource getDataSource() {
+        if (null == dataSource) {
+            synchronized (this) {
+                if (null == dataSource) {
+
+                    dataSource = new DataSource();
+                    dataSource.setPoolProperties(poolProperties);
+
+                }
+            }
+        }
+        return dataSource;
+    }
+
+    @Override
+    public void release() {
+        synchronized (this) {
+            super.release();
+            if (null != dataSource) {
+                dataSource.close();
+                dataSource = null;
+            }
+        }
+    }
+
+    /**
+     * Format the connector message
+     *
+     * @param key
+     *            key of the message
+     * @return return the formated message
+     */
+    public String getMessage(String key) {
+        final String fmt = getConnectorMessages().format(key, key);
+        log.ok(&quot;Get for a key {0} connector message {1}&quot;, key, fmt);
+        return fmt;
+    }
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfmisccrest"></a>
 <div class="propset"><h4>Property changes: \
trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/misc/crest</h4>
 <pre class="diff"><span>
</span></pre></div>
<a id="svnignore"></a>
<div class="addfile"><h4>Added: svn:ignore</h4></div>
<a id="trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfmisccrestCRESTFilterVisitorgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/misc/crest/CRESTFilterVisitor.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/misc/crest/CRESTFilterVisitor.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/misc/crest/CRESTFilterVisitor.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,123 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+package org.forgerock.openicf.misc.crest
+
+import org.forgerock.json.resource.QueryFilter
+import org.forgerock.openicf.misc.scriptedcommon.AbstractFilterVisitor
+import org.identityconnectors.framework.common.objects.AttributeUtil
+import org.identityconnectors.framework.common.objects.filter.AndFilter
+import org.identityconnectors.framework.common.objects.filter.ContainsAllValuesFilter
 +import org.identityconnectors.framework.common.objects.filter.ContainsFilter
+import org.identityconnectors.framework.common.objects.filter.EndsWithFilter
+import org.identityconnectors.framework.common.objects.filter.EqualsFilter
+import org.identityconnectors.framework.common.objects.filter.GreaterThanFilter
+import org.identityconnectors.framework.common.objects.filter.GreaterThanOrEqualFilter
 +import org.identityconnectors.framework.common.objects.filter.LessThanFilter
+import org.identityconnectors.framework.common.objects.filter.LessThanOrEqualFilter
+import org.identityconnectors.framework.common.objects.filter.NotFilter
+import org.identityconnectors.framework.common.objects.filter.OrFilter
+import org.identityconnectors.framework.common.objects.filter.StartsWithFilter
+
+/**
+ * A CRESTFilterVisitor converts ICF {@link \
org.identityconnectors.framework.common.objects.filter.Filter} + * to CREST {@link \
QueryFilter}. + *
+ * @author Laszlo Hordos
+ */
+class CRESTFilterVisitor extends AbstractFilterVisitor&lt;Void, QueryFilter&gt; {
+
+    static final CRESTFilterVisitor VISITOR = new CRESTFilterVisitor()
+
+    QueryFilter visit(Void parameter, AndFilter subFilters) {
+        QueryFilter left = this.accept(parameter, subFilters.left)
+        QueryFilter right = this.accept(parameter, subFilters.right)
+        return QueryFilter.and(left, right)
+    }
+
+    QueryFilter visit(Void parameter, OrFilter subFilters) {
+        QueryFilter left = this.accept(parameter, subFilters.left)
+        QueryFilter right = this.accept(parameter, subFilters.right)
+        return QueryFilter.or(left, right)
+    }
+
+    QueryFilter visit(Void parameter, NotFilter subFilter) {
+        return QueryFilter.not(this.accept(parameter, subFilter.filter))
+    }
+
+    /**
+     * EndsWith filter
+     */
+    private static final String EW = &quot;ew&quot;;
+
+    /**
+     * ContainsAll filter
+     */
+    private static final String CA = &quot;ca&quot;;
+
+    // AttributeFilter
+
+    QueryFilter visit(Void parameter, EqualsFilter filter) {
+        //TODO: Support other then Single values
+        return QueryFilter.equalTo(filter.name, \
AttributeUtil.getSingleValue(filter.attribute)) +    }
+
+    QueryFilter visit(Void parameter, ContainsAllValuesFilter filter) {
+        //TODO: Support other then Single values
+        return QueryFilter.comparisonFilter(filter.name, CA, \
AttributeUtil.getSingleValue(filter.attribute)) +    }
+
+    // StringFilter
+
+    QueryFilter visit(Void parameter, ContainsFilter filter) {
+        return QueryFilter.contains(filter.name, \
AttributeUtil.getStringValue(filter.attribute)) +    }
+
+    QueryFilter visit(Void parameter, StartsWithFilter filter) {
+        return QueryFilter.startsWith(filter.name, \
AttributeUtil.getSingleValue(filter.attribute)) +    }
+
+    QueryFilter visit(Void parameter, EndsWithFilter filter) {
+        return QueryFilter.comparisonFilter(filter.name, EW, \
AttributeUtil.getStringValue(filter.attribute)) +    }
+
+    // ComparableAttributeFilter
+
+    QueryFilter visit(Void parameter, GreaterThanFilter filter) {
+        return QueryFilter.greaterThan(filter.name, \
AttributeUtil.getSingleValue(filter.attribute)) +    }
+
+    QueryFilter visit(Void parameter, GreaterThanOrEqualFilter filter) {
+        return QueryFilter.greaterThanOrEqualTo(filter.name, \
AttributeUtil.getSingleValue(filter.attribute)) +    }
+
+    QueryFilter visit(Void parameter, LessThanFilter filter) {
+        return QueryFilter.lessThan(filter.name, \
AttributeUtil.getSingleValue(filter.attribute)) +    }
+
+    QueryFilter visit(Void parameter, LessThanOrEqualFilter filter) {
+        return QueryFilter.lessThanOrEqualTo(filter.name, \
AttributeUtil.getSingleValue(filter.attribute)) +    }
+
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfmiscscriptedcommonICFObjectBuildergroovy"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/misc/scriptedcommon/ICFObjectBuilder.groovy \
(6508 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/misc/scriptedcommon/ICFObjectBuilder.groovy	2014-04-14 \
                21:18:24 UTC (rev 6508)
+++ trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/misc/scriptedcommon/ICFObjectBuilder.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx">     static private &lt;B&gt; AbstractICFBuilder&lt;B&gt; \
delegateToTag(Class&lt;? extends AbstractICFBuilder&lt;B&gt;&gt; clazz, Closure body, \
B builder) { </span><span class="cx">         AbstractICFBuilder&lt;B&gt; tag = \
(AbstractICFBuilder&lt;B&gt;) clazz.newInstance(builder) </span><span class="cx">     \
def clone = body.rehydrate(tag, this, this) </span><ins>+        \
clone.resolveStrategy = Closure.DELEGATE_FIRST </ins><span class="cx">         \
clone() </span><span class="cx">         return tag
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfmiscscriptedcommonScriptedConnectorBasegroovy"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/misc/scriptedcommon/ScriptedConnectorBase.groovy \
(6508 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/misc/scriptedcommon/ScriptedConnectorBase.groovy	2014-04-14 \
                21:18:24 UTC (rev 6508)
+++ trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/misc/scriptedcommon/ScriptedConnectorBase.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -27,9 +27,8 @@
</span><span class="cx"> import org.codehaus.groovy.runtime.InvokerHelper
</span><span class="cx"> import org.identityconnectors.common.CollectionUtil
</span><span class="cx"> import org.identityconnectors.common.StringUtil
</span><del>-import org.identityconnectors.common.security.GuardedByteArray
</del><ins>+import org.identityconnectors.common.logging.Log
</ins><span class="cx"> import org.identityconnectors.common.security.GuardedString
</span><del>-import org.identityconnectors.common.security.SecurityUtil
</del><span class="cx"> import \
org.identityconnectors.framework.common.exceptions.ConnectorException </span><span \
class="cx"> import org.identityconnectors.framework.common.exceptions.InvalidAttributeValueException
 </span><span class="cx"> import \
org.identityconnectors.framework.common.objects.Attribute </span><span \
class="lines">@@ -63,7 +62,7 @@ </span><span class="cx"> import \
org.identityconnectors.framework.spi.operations.SearchOp </span><span class="cx"> \
import org.identityconnectors.framework.spi.operations.SyncOp </span><span \
class="cx"> import org.identityconnectors.framework.spi.operations.TestOp \
</span><del>-import org.identityconnectors.framework.spi.operations.UpdateAttributeValuesOp
 </del><ins>+import org.identityconnectors.framework.spi.operations.UpdateOp
</ins><span class="cx"> 
</span><span class="cx"> /**
</span><span class="cx">  * Main implementation of the Scripted Common code.
</span><span class="lines">@@ -73,7 +72,7 @@
</span><span class="cx">  */
</span><span class="cx"> public class ScriptedConnectorBase&lt;C extends \
ScriptedConfiguration&gt; implements AuthenticateOp, CreateOp, DeleteOp, \
ResolveUsernameOp, </span><span class="cx">         SchemaOp, ScriptOnConnectorOp, \
ScriptOnResourceOp, SearchOp&lt;Filter&gt;, SyncOp, TestOp, </span><del>-        \
UpdateAttributeValuesOp { </del><ins>+        UpdateOp {
</ins><span class="cx"> 
</span><span class="cx">     protected static final String USERNAME = \
&quot;username&quot; </span><span class="cx">     protected static final String \
PASSWORD = &quot;password&quot; </span><span class="lines">@@ -98,24 +97,6 @@
</span><span class="cx">     protected static final String FILTER = \
&quot;filter&quot; </span><span class="cx">     protected static final String GROOVY \
= &quot;GROOVY&quot; </span><span class="cx"> 
</span><del>-
-    public enum Action {
-        AUTHENTICATE,
-        CREATE,
-        DELETE,
-        GET_LATEST_SYNC_TOKEN,
-        RESOLVE_USERNAME,
-        SCHEMA,
-        SEARCH,
-        SYNC,
-        TEST,
-        RUNSCRIPTONCONNECTOR,
-        RUNSCRIPTONRESOURCE,
-        UPDATE,
-        ADD_ATTRIBUTE_VALUES,
-        REMOVE_ATTRIBUTE_VALUES;
-    }
-
</del><span class="cx">     /**
</span><span class="cx">      * Place holder for the Connector schema created in the \
Schema() method. </span><span class="cx">      */
</span><span class="lines">@@ -131,7 +112,7 @@
</span><span class="cx">     /**
</span><span class="cx">      * Setup logging for the {@link ScriptedConnectorBase}.
</span><span class="cx">      */
</span><del>-    Logger logger;
</del><ins>+    private static final Log logger = \
Log.getLog(ScriptedConnectorBase.class); </ins><span class="cx"> 
</span><span class="cx">     /**
</span><span class="cx">      * Gets the Configuration context for this connector.
</span><span class="lines">@@ -154,7 +135,6 @@
</span><span class="cx">      */
</span><span class="cx">     public void init(final Configuration config) {
</span><span class="cx">         this.configuration = (C) config;
</span><del>-        logger = configuration.getLogger(getClass(), 12);
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     /**
</span><span class="lines">@@ -176,29 +156,24 @@
</span><span class="cx">     /**
</span><span class="cx">      * {@inheritDoc}
</span><span class="cx">      */
</span><ins>+    @Override
</ins><span class="cx">     public Uid authenticate(ObjectClass objectClass, String \
username, GuardedString password, </span><span class="cx">                            \
OperationOptions options) { </span><span class="cx">         if \
(StringUtil.isNotBlank(getScriptedConfiguration().getAuthenticateScriptFileName())) { \
</span><del>-            logger.debugLocale(&quot;DEBUG_INVOKE_AUTHENTICATE&quot;, \
&quot;Invoke Authenticate ObjectClass:{0}-&gt;{1}&quot;, </del><ins>+            \
logger.ok(&quot;Invoke Authenticate ObjectClass:{0}-&gt;{1}&quot;, </ins><span \
class="cx">                     objectClass.getObjectClassValue(), username) \
</span><ins>+ +            Object uidAfter = null;
</ins><span class="cx">             try {
</span><del>-                Object uidAfter = \
executeAuthenticate(getScriptedConfiguration().getAuthenticateScriptFileName(), \
</del><ins>+                uidAfter = \
executeAuthenticate(getScriptedConfiguration().getAuthenticateScriptFileName(), \
</ins><span class="cx">                         objectClass, username, password, \
options); </span><del>-                if (uidAfter instanceof String) {
-                    logger.debug(&quot;{0}:{1} authenticated&quot;, \
                objectClass.getObjectClassValue(), uidAfter);
-                    return new Uid((String) uidAfter);
-                } else if (uidAfter instanceof Uid) {
-                    logger.debug(&quot;{0}:{1} authenticated&quot;, \
                objectClass.getObjectClassValue(), uidAfter);
-                    return (Uid) uidAfter;
-                } else {
-                    throw new ConnectorException(
-                            &quot;Authenticate script didn't return with the \
                uid(__UID__) value&quot;);
-                }
</del><span class="cx">             } catch (final RuntimeException e) {
</span><span class="cx">                 throw e;
</span><span class="cx">             } catch (final Exception e) {
</span><ins>+                //throw ConnectorException.wrap(e);
</ins><span class="cx">                 throw new \
ConnectorException(&quot;Authenticate script error&quot;, e); </span><span \
class="cx">             } </span><ins>+            return \
returnUid(OperationType.AUTHENTICATE, objectClass, uidAfter); </ins><span class="cx"> \
} else { </span><span class="cx">             throw new \
UnsupportedOperationException(); </span><span class="cx">         }
</span><span class="lines">@@ -208,40 +183,36 @@
</span><span class="cx">                                          OperationOptions \
options) { </span><span class="cx">         final Binding arguments = new Binding();
</span><span class="cx">         arguments.setVariable(USERNAME, username);
</span><del>-        arguments.setVariable(PASSWORD, \
                getGuardedStringValue(password));
-        return evaluateScript(scriptName, createBinding(arguments, \
Action.AUTHENTICATE, objectClass, null, null, options)); </del><ins>+        \
arguments.setVariable(PASSWORD, password); +        return evaluateScript(scriptName, \
createBinding(arguments, OperationType.AUTHENTICATE, objectClass, null, null, \
options)); </ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    /**
+     * {@inheritDoc}
+     */
+    @Override
</ins><span class="cx">     public Uid create(final ObjectClass objectClass, final \
Set&lt;Attribute&gt; createAttributes, </span><span class="cx">                       \
final OperationOptions options) { </span><span class="cx">         if \
(StringUtil.isNotBlank(getScriptedConfiguration().getCreateScriptFileName())) { \
</span><del>-            logger.debugLocale(&quot;DEBUG_INVOKE_CREATE&quot;, \
&quot;Invoke Create ObjectClass:{0}&quot;, </del><ins>+            \
logger.ok(&quot;Invoke Create ObjectClass:{0}&quot;, </ins><span class="cx">          \
objectClass.getObjectClassValue()); </span><ins>+            Object uidAfter = null;
</ins><span class="cx">             try {
</span><del>-                Object uidAfter = \
executeCreate(getScriptedConfiguration().getCreateScriptFileName(), </del><ins>+      \
uidAfter = executeCreate(getScriptedConfiguration().getCreateScriptFileName(), \
</ins><span class="cx">                         objectClass, createAttributes, \
options) </span><del>-                if (uidAfter instanceof String) {
-                    logger.debug(&quot;{0}:{1} created&quot;, \
                objectClass.getObjectClassValue(), uidAfter);
-                    return new Uid(uidAfter);
-                } else if (uidAfter instanceof Uid) {
-                    logger.debug(&quot;{0}:{1} created&quot;, \
                objectClass.getObjectClassValue(), uidAfter);
-                    return (Uid) uidAfter;
-                } else {
-                    throw new ConnectorException(
-                            &quot;Create script didn't return with the uid(__UID__) \
                value&quot;);
-                }
</del><span class="cx">             } catch (final RuntimeException e) {
</span><span class="cx">                 throw e;
</span><span class="cx">             } catch (final Exception e) {
</span><span class="cx">                 throw new ConnectorException(&quot;Create \
script error&quot;, e); </span><span class="cx">             }
</span><ins>+            return returnUid(OperationType.CREATE, objectClass, \
uidAfter); </ins><span class="cx">         } else {
</span><span class="cx">             throw new UnsupportedOperationException();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    protected Object executeCreate(String scriptName, final ObjectClass \
                objectClass, final Set&lt;Attribute&gt; createAttributes,
-                                   final OperationOptions options) {
</del><ins>+    protected Uid executeCreate(String scriptName, final ObjectClass \
objectClass, final Set&lt;Attribute&gt; createAttributes, +                           \
final OperationOptions options) { </ins><span class="cx">         final Binding \
arguments = new Binding(); </span><span class="cx">         final Map&lt;String, \
Attribute&gt; attributes = CollectionUtil.&lt;Attribute&gt; newCaseInsensitiveMap(); \
</span><span class="cx">         // We give the id (name) as an argument, more \
friendly than dealing </span><span class="lines">@@ -259,7 +230,7 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         arguments.setVariable(ATTRIBUTES, attributes);
</span><del>-        return evaluateScript(scriptName, createBinding(arguments, \
Action.CREATE, objectClass, null, createAttributes, options)); </del><ins>+        \
return returnUid(OperationType.CREATE, objectClass, evaluateScript(scriptName, \
createBinding(arguments, OperationType.CREATE, objectClass, null, createAttributes, \
options))); </ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     /**
</span><span class="lines">@@ -268,12 +239,12 @@
</span><span class="cx">     @Override
</span><span class="cx">     public void delete(final ObjectClass objectClass, final \
Uid uid, final OperationOptions options) { </span><span class="cx">         if \
(StringUtil.isNotBlank(getScriptedConfiguration().getDeleteScriptFileName())) { \
</span><del>-            logger.debugLocale(&quot;DEBUG_INVOKE_DELETE&quot;, \
                &quot;Invoke Delete ObjectClass:{0}-&gt;{1}&quot;,
-                    objectClass.getObjectClassValue(), uid);
</del><ins>+            logger.ok(&quot;Invoke Delete ObjectClass:{0}-&gt;{1}&quot;,
+                    objectClass.getObjectClassValue(), uid.uidValue);
</ins><span class="cx">             try {
</span><span class="cx">                 \
executeDelete(getScriptedConfiguration().getDeleteScriptFileName(), </span><span \
class="cx">                         objectClass, uid, options); </span><del>-         \
logger.debug(&quot;{0}:{1} deleted&quot;, objectClass.getObjectClassValue(), uid); \
</del><ins>+                logger.ok(&quot;{0}:{1} deleted&quot;, \
objectClass.getObjectClassValue(), uid); </ins><span class="cx">             } catch \
(final RuntimeException e) { </span><span class="cx">                 throw e;
</span><span class="cx">             } catch (final Exception e) {
</span><span class="lines">@@ -284,36 +255,30 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    protected void executeDelete(String scriptName, ObjectClass \
                objectClass, Uid uid, OperationOptions options) {
-        evaluateScript(scriptName, createBinding(new Binding(), Action.DELETE, \
objectClass, uid, null, options)); </del><ins>+    protected void \
executeDelete(String scriptName, ObjectClass objectClass, Uid uid, OperationOptions \
options) throws Exception { +        evaluateScript(scriptName, createBinding(new \
Binding(), OperationType.DELETE, objectClass, uid, null, options)); </ins><span \
class="cx">     } </span><span class="cx"> 
</span><span class="cx">     /**
</span><span class="cx">      * {@inheritDoc}
</span><span class="cx">      */
</span><ins>+    @Override
</ins><span class="cx">     public Uid resolveUsername(ObjectClass objectClass, \
String username, OperationOptions options) { </span><span class="cx">         if \
(StringUtil.isNotBlank(getScriptedConfiguration().getResolveUsernameScriptFileName())) \
{ </span><del>-            \
logger.debugLocale(&quot;DEBUG_INVOKE_RESOLVE_USERNAME&quot;, &quot;Invoke Resolve \
Username ObjectClass:{0}-&gt;{1}&quot;, </del><ins>+            \
logger.ok(&quot;Invoke Resolve Username ObjectClass:{0}-&gt;{1}&quot;, </ins><span \
class="cx">                     objectClass.getObjectClassValue(), username); \
</span><ins>+            Object uidAfter = null; </ins><span class="cx">             \
try { </span><del>-                Object uidAfter = \
executeResolveUsername(getScriptedConfiguration().getResolveUsernameScriptFileName(), \
</del><ins>+                uidAfter = \
executeResolveUsername(getScriptedConfiguration().getResolveUsernameScriptFileName(), \
</ins><span class="cx">                         objectClass, username, options); \
                </span><del>-
-                if (uidAfter instanceof String) {
-                    logger.debug(&quot;Username:{0} resolved to:{1}&quot;, username, \
                uidAfter);
-                    return new Uid(uidAfter);
-                } else if (uidAfter instanceof Uid) {
-                    logger.debug(&quot;Username:{0} resolved to:{1}&quot;, username, \
                uidAfter);
-                    return (Uid) uidAfter;
-                } else {
-                    throw new ConnectorException(
-                            &quot;ResolveUsernameScript didn't return with the \
                uid(__UID__) value&quot;);
-                }
</del><span class="cx">             } catch (final RuntimeException e) {
</span><span class="cx">                 throw e;
</span><span class="cx">             } catch (final Exception e) {
</span><span class="cx">                 throw new \
ConnectorException(&quot;ResolveUsernameScript error&quot;, e); </span><span \
class="cx">             } </span><ins>+
+            return returnUid(OperationType.RESOLVE_USERNAME, objectClass, uidAfter);
+
</ins><span class="cx">         } else {
</span><span class="cx">             throw new UnsupportedOperationException();
</span><span class="cx">         }
</span><span class="lines">@@ -323,17 +288,18 @@
</span><span class="cx">         final Binding arguments = new Binding();
</span><span class="cx">         arguments.setVariable(USERNAME, username);
</span><span class="cx">         return evaluateScript(scriptName,
</span><del>-                createBinding(arguments, Action.RESOLVE_USERNAME, \
objectClass, null, null, options)); </del><ins>+                \
createBinding(arguments, OperationType.RESOLVE_USERNAME, objectClass, null, null, \
options)); </ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     /**
</span><span class="cx">      * {@inheritDoc}
</span><span class="cx">      */
</span><ins>+    @Override
</ins><span class="cx">     public Schema schema() {
</span><span class="cx">         if \
(StringUtil.isNotBlank(getScriptedConfiguration().getSchemaScriptFileName())) { \
</span><span class="cx">             if (null == schema) { </span><span class="cx">   \
try { </span><del>-                    \
logger.debugLocale(&quot;DEBUG_INVOKE_SCHEMA&quot;, &quot;Invoke Schema&quot;); \
</del><ins>+                    logger.ok(&quot;Invoke Schema&quot;); </ins><span \
class="cx">                     Object result = \
executeSchema(getScriptedConfiguration().getSchemaScriptFileName(), </span><span \
class="cx">                             getClass() as Class&lt;? extends \
Connector&gt;); </span><span class="cx">                     if (result instanceof \
Schema) { </span><span class="lines">@@ -357,7 +323,7 @@
</span><span class="cx">     protected Object executeSchema(String scriptName, \
Class&lt;? extends Connector&gt; connectorClass) { </span><span class="cx">         \
final Binding arguments = new Binding(); </span><span class="cx">         \
arguments.setVariable(BUILDER, new ICFObjectBuilder(connectorClass)); </span><del>-   \
return evaluateScript(scriptName, createBinding(arguments, Action.SCHEMA, null, null, \
null, null)); </del><ins>+        return evaluateScript(scriptName, \
createBinding(arguments, OperationType.SCHEMA, null, null, null, null)); </ins><span \
class="cx">     } </span><span class="cx"> 
</span><span class="cx">     /**
</span><span class="lines">@@ -373,7 +339,7 @@
</span><span class="cx">                 Object result = \
InvokerHelper.createScript(getScriptedConfiguration().getGroovyScriptEngine(). \
</span><span class="cx">                         \
getGroovyClassLoader().parseClass(codeSource, false), </span><span class="cx">        \
new Binding(request.scriptArguments)).run(); </span><del>-                \
logger.debug(&quot;runScriptOnConnector ok&quot;); </del><ins>+                \
logger.ok(&quot;runScriptOnConnector ok&quot;); </ins><span class="cx">               \
return result; </span><span class="cx">             } catch (final RuntimeException \
e) { </span><span class="cx">                 throw e;
</span><span class="lines">@@ -391,7 +357,7 @@
</span><span class="cx">     @Override
</span><span class="cx">     public Object runScriptOnResource(ScriptContext request, \
OperationOptions options) { </span><span class="cx">         if \
(StringUtil.isNotBlank(getScriptedConfiguration().getScriptOnResourceScriptFileName())) \
{ </span><del>-            \
logger.debugLocale(&quot;DEBUG_INVOKE_RUNSCRIPTONRESOURCE&quot;, &quot;Invoke \
RunScriptOnResource&quot;) </del><ins>+            logger.ok(&quot;Invoke \
RunScriptOnResource&quot;) </ins><span class="cx">             try {
</span><span class="cx">                 return \
executeRunScriptOnResource(getScriptedConfiguration().getScriptOnResourceScriptFileName(),
 </span><span class="cx">                         request, options);
</span><span class="lines">@@ -412,12 +378,13 @@
</span><span class="cx">         arguments.setVariable(&quot;scriptLanguage&quot;, \
request.scriptLanguage) </span><span class="cx"> 
</span><span class="cx">         return evaluateScript(scriptName,
</span><del>-                createBinding(arguments, Action.RUNSCRIPTONRESOURCE, \
null, null, null, options)); </del><ins>+                createBinding(arguments, \
OperationType.RUNSCRIPTONRESOURCE, null, null, null, options)); </ins><span \
class="cx">     } </span><span class="cx"> 
</span><span class="cx">     /**
</span><span class="cx">      * {@inheritDoc}
</span><span class="cx">      */
</span><ins>+    @Override
</ins><span class="cx">     public FilterTranslator&lt;Filter&gt; \
createFilterTranslator(final ObjectClass objectClass, </span><span class="cx">        \
final OperationOptions options) { </span><span class="cx">         return \
ScriptedFilterTranslator.INSTANCE; </span><span class="lines">@@ -426,29 +393,30 @@
</span><span class="cx">     /**
</span><span class="cx">      * {@inheritDoc}
</span><span class="cx">      */
</span><ins>+    @Override
</ins><span class="cx">     public void executeQuery(final ObjectClass objectClass, \
final Filter query, final ResultsHandler handler, </span><span class="cx">            \
final OperationOptions options) { </span><span class="cx">         if \
(StringUtil.isNotBlank(getScriptedConfiguration().getSearchScriptFileName())) { \
</span><del>-            logger.debugLocale(&quot;DEBUG_INVOKE_SEARCH&quot;, \
&quot;Invoke Execute Query ObjectClass:{0}&quot;, </del><ins>+            \
logger.ok(&quot;Invoke Execute Query ObjectClass:{0}&quot;, </ins><span class="cx">   \
objectClass.objectClassValue) </span><span class="cx">             try {
</span><span class="cx">                 Object searchResult = \
executeQuery(getScriptedConfiguration().getSearchScriptFileName(), </span><span \
class="cx">                         objectClass, query, </span><span class="cx">      \
{ res -&gt; </span><del>-                            boolean doContinue = false
</del><span class="cx">                             if (res instanceof \
ConnectorObject) { </span><del>-                                doContinue = \
handler.handle(res) </del><ins>+                                return \
handler.handle(res) </ins><span class="cx">                             } else if \
(res instanceof Closure) { </span><del>-                                doContinue = \
handler.handle(ICFObjectBuilder.co(res)); </del><ins>+                                \
return handler.handle(ICFObjectBuilder.co(res)); +                            } else \
{ +                                throw new ConnectorException(&quot;Can not handle \
type of &quot; + null != res ? res.class.name : &quot;null&quot;) </ins><span \
class="cx">                             } </span><del>-                            \
doContinue </del><span class="cx">                         }, options);
</span><span class="cx">                 if (searchResult instanceof SearchResult) {
</span><span class="cx">                     ((SearchResultsHandler) \
handler).handleResult((SearchResult) searchResult); </span><span class="cx">          \
} else if (searchResult instanceof String) { </span><span class="cx">                 \
((SearchResultsHandler) handler).handleResult(new SearchResult((String) searchResult, \
-1)); </span><span class="cx">                 }
</span><del>-                logger.debug(&quot;Search ok&quot;);
</del><ins>+                logger.ok(&quot;Search ok&quot;);
</ins><span class="cx">             } catch (final RuntimeException e) {
</span><span class="cx">                 throw e;
</span><span class="cx">             } catch (final Exception e) {
</span><span class="lines">@@ -472,27 +440,30 @@
</span><span class="cx">         arguments.setVariable(HANDLER, handler)
</span><span class="cx"> 
</span><span class="cx">         return evaluateScript(scriptName,
</span><del>-                createBinding(arguments, Action.SEARCH, objectClass, \
null, null, options)); </del><ins>+                createBinding(arguments, \
OperationType.SEARCH, objectClass, null, null, options)); </ins><span class="cx">     \
} </span><span class="cx"> 
</span><span class="cx">     /**
</span><span class="cx">      * {@inheritDoc}
</span><span class="cx">      */
</span><ins>+    @Override
</ins><span class="cx">     public void sync(ObjectClass objectClass, SyncToken \
token, SyncResultsHandler handler, </span><span class="cx">                      \
final OperationOptions options) { </span><span class="cx">         if \
(StringUtil.isNotBlank(getScriptedConfiguration().getSyncScriptFileName())) { \
</span><del>-            logger.debugLocale(&quot;DEBUG_INVOKE_SYNC&quot;, \
&quot;Invoke Sync ObjectClass:{0}-&gt;{1}&quot;, </del><ins>+            \
logger.ok(&quot;Invoke Sync ObjectClass:{0}-&gt;{1}&quot;, </ins><span class="cx">    \
objectClass.getObjectClassValue(), token); </span><span class="cx">             try {
</span><span class="cx">                 Object newToken = \
executeSync(getScriptedConfiguration().getSyncScriptFileName(), </span><span \
class="cx">                         objectClass, token, { delta -&gt; </span><span \
class="cx">                     if (delta instanceof SyncDelta) { </span><del>-       \
handler.handle(((SyncDelta) delta)) </del><ins>+                        return \
handler.handle(((SyncDelta) delta)) </ins><span class="cx">                     } \
else if (delta instanceof Closure) { </span><del>-                        \
handler.handle(ICFObjectBuilder.delta(delta)); </del><ins>+                        \
return handler.handle(ICFObjectBuilder.delta(delta)); +                    } else {
+                        throw new ConnectorException(&quot;Can not handle type of \
&quot; + null != delta ? delta.class.name : &quot;null&quot;) </ins><span class="cx"> \
} </span><span class="cx">                 }, options);
</span><del>-                logger.debug(&quot;Sync ok&quot;);
</del><ins>+                logger.ok(&quot;Sync ok&quot;);
</ins><span class="cx">                 if (newToken instanceof SyncToken) {
</span><span class="cx">                     ((SyncTokenResultsHandler) \
handler).handleResult((SyncToken) newToken); </span><span class="cx">                 \
} else if (null != newToken) { </span><span class="lines">@@ -512,7 +483,7 @@
</span><span class="cx">         final Binding arguments = new Binding();
</span><span class="cx">         arguments.setVariable(TOKEN, token != null ? \
token.getValue() : null); </span><span class="cx">         \
arguments.setVariable(HANDLER, handler) </span><del>-        return \
evaluateScript(scriptName, createBinding(arguments, Action.SYNC, objectClass, null, \
null, options)); </del><ins>+        return evaluateScript(scriptName, \
createBinding(arguments, OperationType.SYNC, objectClass, null, null, options)); \
</ins><span class="cx">     } </span><span class="cx"> 
</span><span class="cx">     /**
</span><span class="lines">@@ -522,12 +493,12 @@
</span><span class="cx">     public SyncToken getLatestSyncToken(ObjectClass \
objectClass) { </span><span class="cx">         if \
(StringUtil.isNotBlank(getScriptedConfiguration().getSyncScriptFileName())) { \
</span><span class="cx">             SyncToken syncToken = null; </span><del>-        \
debugLocale(&quot;DEBUG_INVOKE_GET_LATEST_SYNC_TOKEN&quot;, &quot;Invoke \
GetLatestSyncToken ObjectClass:{0}&quot;, </del><ins>+            \
logger.ok(&quot;Invoke GetLatestSyncToken ObjectClass:{0}&quot;, </ins><span \
class="cx">                     objectClass.getObjectClassValue()); </span><span \
class="cx">             try { </span><span class="cx">                 Object result \
= executeGetLatestSyncToken(getScriptedConfiguration().getSyncScriptFileName(), \
</span><span class="cx">                         objectClass); </span><del>-          \
logger.debug(&quot;GetLatestSyncToken ok&quot;); </del><ins>+                \
logger.ok(&quot;GetLatestSyncToken ok&quot;); </ins><span class="cx">                 \
if (result instanceof SyncToken) { </span><span class="cx">                     \
syncToken = (SyncToken) result; </span><span class="cx">                 } else if \
(null != result) { </span><span class="lines">@@ -546,7 +517,7 @@
</span><span class="cx"> 
</span><span class="cx">     protected Object executeGetLatestSyncToken(String \
scriptName, ObjectClass objectClass) { </span><span class="cx">         return \
evaluateScript(scriptName, </span><del>-                createBinding(new Binding(), \
Action.GET_LATEST_SYNC_TOKEN, objectClass, null, null, null)); </del><ins>+           \
createBinding(new Binding(), OperationType.GET_LATEST_SYNC_TOKEN, objectClass, null, \
null, null)); </ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     /**
</span><span class="lines">@@ -556,10 +527,10 @@
</span><span class="cx">     public void test() {
</span><span class="cx">         getScriptedConfiguration().validate()
</span><span class="cx">         if \
(StringUtil.isNotBlank(getScriptedConfiguration().getTestScriptFileName())) { \
</span><del>-            logger.debugLocale(&quot;DEBUG_INVOKE_TEST&quot;, \
&quot;Invoke Test&quot;) </del><ins>+            logger.ok(&quot;Invoke Test&quot;)
</ins><span class="cx">             try {
</span><span class="cx">                 \
executeTest(getScriptedConfiguration().getTestScriptFileName()); </span><del>-        \
logger.debug(&quot;Test ok&quot;); </del><ins>+                logger.ok(&quot;Test \
ok&quot;); </ins><span class="cx">             } catch (final RuntimeException e) {
</span><span class="cx">                 throw e;
</span><span class="cx">             } catch (final Exception e) {
</span><span class="lines">@@ -570,7 +541,7 @@
</span><span class="cx"> 
</span><span class="cx">     protected void executeTest(String scriptName) {
</span><span class="cx">         evaluateScript(scriptName,
</span><del>-                createBinding(new Binding(), Action.TEST, null, null, \
null, null)); </del><ins>+                createBinding(new Binding(), \
OperationType.TEST, null, null, null, null)); </ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     /**
</span><span class="lines">@@ -580,113 +551,83 @@
</span><span class="cx">     public Uid update(ObjectClass objectClass, Uid uid, \
Set&lt;Attribute&gt; replaceAttributes, </span><span class="cx">                      \
OperationOptions options) { </span><span class="cx">         if \
(StringUtil.isNotBlank(getScriptedConfiguration().getUpdateScriptFileName())) { \
</span><del>-            logger.debugLocale(&quot;DEBUG_INVOKE_UPDATE&quot;, \
                &quot;Invoke Update ObjectClass:{0}-&gt;{1}&quot;,
-                    objectClass.getObjectClassValue(), uid);
</del><ins>+            logger.ok(&quot;Invoke Update ObjectClass:{0}-&gt;{1}&quot;,
+                    objectClass.getObjectClassValue(), uid.uidValue);
+            Object uidAfter = null;
</ins><span class="cx">             try {
</span><del>-                Object uidAfter = \
executeUpdate(getScriptedConfiguration().getUpdateScriptFileName(), </del><ins>+      \
uidAfter = executeUpdate(getScriptedConfiguration().getUpdateScriptFileName(), \
</ins><span class="cx">                         objectClass, uid, replaceAttributes, \
options) </span><del>-                if (uidAfter instanceof String) {
-                    logger.debug(&quot;{0}:{1} updated&quot;, \
                objectClass.getObjectClassValue(), uidAfter);
-                    return new Uid(uidAfter);
-                } else if (uidAfter instanceof Uid) {
-                    logger.debug(&quot;{0}:{1} updated&quot;, \
                objectClass.getObjectClassValue(), uidAfter);
-                    return (Uid) uidAfter;
-                } else {
-                    throw new ConnectorException(
-                            &quot;Update script didn't return with the uid(__UID__) \
                value&quot;);
-                }
</del><span class="cx">             } catch (final RuntimeException e) {
</span><span class="cx">                 throw e;
</span><span class="cx">             } catch (final Exception e) {
</span><span class="cx">                 throw new ConnectorException(&quot;Update \
(Update) script error&quot;, e); </span><span class="cx">             }
</span><ins>+            return returnUid(OperationType.UPDATE, objectClass, \
uidAfter); </ins><span class="cx">         } else {
</span><span class="cx">             throw new UnsupportedOperationException();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     protected Object executeUpdate(String scriptName, \
ObjectClass objectClass, Uid uid, Set&lt;Attribute&gt; replaceAttributes, \
OperationOptions options) { </span><del>-        return genericUpdate(scriptName, \
Action.UPDATE, objectClass, uid, replaceAttributes, options); </del><ins>+        \
return genericUpdate(scriptName, OperationType.UPDATE, objectClass, uid, \
replaceAttributes, options); </ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    /**
-     * {@inheritDoc}
-     */
-    @Override
</del><span class="cx">     public Uid addAttributeValues(ObjectClass objectClass, \
Uid uid, Set&lt;Attribute&gt; valuesToAdd, </span><span class="cx">                   \
OperationOptions options) { </span><span class="cx">         if \
(StringUtil.isNotBlank(getScriptedConfiguration().getUpdateScriptFileName())) { \
</span><del>-            \
logger.debugLocale(&quot;DEBUG_INVOKE_ADD_ATTRIBUTE_VALUES&quot;, &quot;Invoke \
AddAttributeValues ObjectClass:{0}-&gt;{1}&quot;, </del><ins>+            \
logger.ok(&quot;Invoke AddAttributeValues ObjectClass:{0}-&gt;{1}&quot;, </ins><span \
class="cx">                     objectClass.getObjectClassValue(), uid); \
</span><ins>+            Object uidAfter = null; </ins><span class="cx">             \
try { </span><del>-                Object uidAfter = \
executeAddAttributeValues(getScriptedConfiguration().getUpdateScriptFileName(), \
</del><ins>+                uidAfter = \
executeAddAttributeValues(getScriptedConfiguration().getUpdateScriptFileName(), \
</ins><span class="cx">                         objectClass, uid, valuesToAdd, \
options) </span><del>-                if (uidAfter instanceof String) {
-                    logger.debug(&quot;{0}:{1} updated&quot;, \
                objectClass.getObjectClassValue(), uidAfter);
-                    return new Uid(uidAfter);
-                } else if (uidAfter instanceof Uid) {
-                    logger.debug(&quot;{0}:{1} updated&quot;, \
                objectClass.getObjectClassValue(), uidAfter);
-                    return (Uid) uidAfter;
-                } else {
-                    throw new ConnectorException(
-                            &quot;Update script didn't return with the uid(__UID__) \
                value&quot;);
-                }
</del><span class="cx">             } catch (final RuntimeException e) {
</span><span class="cx">                 throw e;
</span><span class="cx">             } catch (final Exception e) {
</span><span class="cx">                 throw new ConnectorException(&quot;Update \
(AddAttributeValues) script error&quot;, e); </span><span class="cx">             }
</span><ins>+            return returnUid(OperationType.ADD_ATTRIBUTE_VALUES, \
objectClass, uidAfter); </ins><span class="cx">         } else {
</span><span class="cx">             throw new UnsupportedOperationException();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     protected Object executeAddAttributeValues(String \
scriptName, ObjectClass objectClass, Uid uid, Set&lt;Attribute&gt; valuesToAdd, \
OperationOptions options) { </span><del>-        return genericUpdate(scriptName, \
Action.ADD_ATTRIBUTE_VALUES, objectClass, uid, valuesToAdd, options); </del><ins>+    \
return genericUpdate(scriptName, OperationType.ADD_ATTRIBUTE_VALUES, objectClass, \
uid, valuesToAdd, options); </ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    /**
-     * {@inheritDoc}
-     */
-    @Override
</del><span class="cx">     public Uid removeAttributeValues(ObjectClass objectClass, \
Uid uid, </span><span class="cx">                                      \
Set&lt;Attribute&gt; valuesToRemove, OperationOptions options) { </span><span \
class="cx">         if \
(StringUtil.isNotBlank(getScriptedConfiguration().getUpdateScriptFileName())) { \
</span><del>-            \
logger.debugLocale(&quot;DEBUG_INVOKE_REMOVE_ATTRIBUTE_VALUES&quot;, &quot;Invoke \
RemoveAttributeValues ObjectClass:{0}-&gt;{1}&quot;, </del><ins>+            \
logger.ok(&quot;Invoke RemoveAttributeValues ObjectClass:{0}-&gt;{1}&quot;, \
</ins><span class="cx">                     objectClass.getObjectClassValue(), uid); \
</span><ins>+            Object uidAfter = null; </ins><span class="cx">             \
try { </span><del>-                Object uidAfter = \
executeRemoveAttributeValues(getScriptedConfiguration().getUpdateScriptFileName(), \
</del><ins>+                uidAfter = \
executeRemoveAttributeValues(getScriptedConfiguration().getUpdateScriptFileName(), \
</ins><span class="cx">                         objectClass, uid, valuesToRemove, \
options) </span><del>-                if (uidAfter instanceof String) {
-                    logger.debug(&quot;{0}:{1} updated&quot;, \
                objectClass.getObjectClassValue(), uidAfter);
-                    return new Uid(uidAfter);
-                } else if (uidAfter instanceof Uid) {
-                    logger.debug(&quot;{0}:{1} updated&quot;, \
                objectClass.getObjectClassValue(), uidAfter);
-                    return (Uid) uidAfter;
-                } else {
-                    throw new ConnectorException(
-                            &quot;Update script didn't return with the uid(__UID__) \
                value&quot;);
-                }
</del><span class="cx">             } catch (final RuntimeException e) {
</span><span class="cx">                 throw e;
</span><span class="cx">             } catch (final Exception e) {
</span><span class="cx">                 throw new ConnectorException(&quot;Update \
(RemoveAttributeValues) script error&quot;, e); </span><span class="cx">             \
} </span><ins>+            return returnUid(OperationType.REMOVE_ATTRIBUTE_VALUES, \
objectClass, uidAfter); </ins><span class="cx">         } else {
</span><span class="cx">             throw new UnsupportedOperationException();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     protected Object executeRemoveAttributeValues(String \
scriptName, ObjectClass objectClass, Uid uid, Set&lt;Attribute&gt; valuesToRemove, \
OperationOptions options) { </span><del>-        return genericUpdate(scriptName, \
Action.REMOVE_ATTRIBUTE_VALUES, objectClass, uid, valuesToRemove, options); \
</del><ins>+        return genericUpdate(scriptName, \
OperationType.REMOVE_ATTRIBUTE_VALUES, objectClass, uid, valuesToRemove, options); \
</ins><span class="cx">     } </span><span class="cx"> 
</span><del>-    protected Object evaluateScript(String scriptName, Binding \
arguments) { </del><ins>+    protected Object evaluateScript(String scriptName, \
Binding arguments) throws Exception { </ins><span class="cx">         return \
getScriptedConfiguration().evaluate(scriptName, arguments, null) </span><span \
class="cx">     } </span><span class="cx"> 
</span><del>-    protected Binding createBinding(final Binding arguments, Action \
action, final ObjectClass objectClass, final Uid uid, final Set&lt;Attribute&gt; \
                attributes,
-                                    final OperationOptions options) {
</del><ins>+    protected Binding createBinding(
+            final Binding arguments, OperationType action,
+            final ObjectClass objectClass, final Uid uid, final Set&lt;Attribute&gt; \
attributes, +            final OperationOptions options) {
</ins><span class="cx">         arguments.setVariable(ACTION, action);
</span><span class="cx">         if (null != objectClass) {
</span><span class="cx">             arguments.setVariable(OBJECT_CLASS, \
objectClass); </span><span class="lines">@@ -694,12 +635,20 @@
</span><span class="cx">         if (null != uid) {
</span><span class="cx">             arguments.setVariable(UID, uid);
</span><span class="cx">         }
</span><del>-//        if (null != attributes) {
-//            AttributesAccessor accessor = new AttributesAccessor(attributes);
-//            arguments.setVariable(ATTRIBUTES, accessor);
-//            Name name = accessor.getName();
-//            arguments.setVariable(ID, null != name ? name : null);
-//        }
</del><ins>+        if (null != attributes) {
+            //Filter out the __NAME__ here. The __UID__ is filtered out by the \
Framework +            Set&lt;Attribute&gt; attributeSet = new \
HashSet&lt;Attribute&gt;() +            Attribute name = null;
+            for (Attribute a : attributes) {
+                if (a.is(Name.NAME)) {
+                    name = a;
+                } else {
+                    attributeSet.add(a)
+                }
+            }
+            arguments.setVariable(ATTRIBUTES, attributeSet);
+            arguments.setVariable(ID, null != name ? \
AttributeUtil.getStringValue(name) : null); +        }
</ins><span class="cx">         if (null != options) {
</span><span class="cx">             arguments.setVariable(OPTIONS, options);
</span><span class="cx">         }
</span><span class="lines">@@ -709,59 +658,21 @@
</span><span class="cx">         return arguments;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    protected Object getGuardedStringValue(GuardedString password) {
-        // Password - if allowed we provide it in clear
-        if (getScriptedConfiguration().getClearTextPasswordToScript()) {
-            if (password != null) {
-                return SecurityUtil.decrypt(password);
-            }
</del><ins>+    protected Uid returnUid(OperationType action, ObjectClass \
objectClass, Object uidAfter) { +        if (uidAfter instanceof String) {
+            logger.ok(action.debugTrace(), objectClass.getObjectClassValue(), \
uidAfter); +            return new Uid((String) uidAfter);
+        } else if (uidAfter instanceof Uid) {
+            logger.ok(action.debugTrace(), objectClass.getObjectClassValue(), \
uidAfter.uidValue); +            return (Uid) uidAfter;
+        } else if (null != uidAfter) {
+            throw new ConnectorException(action.fail2(uidAfter.getClass()));
</ins><span class="cx">         } else {
</span><del>-            return { clearString -&gt;
-                if (password != null) {
-                    password.access(new GuardedString.Accessor() {
-                        @Override
-                        public void access(char[] clearChars) {
-                            if (clearString instanceof Closure) {
-                                clearString(new String(clearChars));
-                            } else {
-                                clearString = new String(clearChars);
-                            }
-                        }
-                    });
-                    clearString
-                }
-            };
</del><ins>+            throw new ConnectorException(action.fail1());
</ins><span class="cx">         }
</span><del>-        return null;
</del><span class="cx">     }
</span><span class="cx"> 
</span><del>-    protected Object getGuardedByteArrayValue(GuardedByteArray password) \
                {
-        // Password - if allowed we provide it in clear
-        if (getScriptedConfiguration().getClearTextPasswordToScript()) {
-            if (password != null) {
-                return SecurityUtil.decrypt(password);
-            }
-        } else {
-            return { clearBytesOut -&gt;
-                if (password != null) {
-                    password.access(new GuardedByteArray.Accessor() {
-                        @Override
-                        void access(byte[] clearBytes) {
-                            if (clearBytesOut instanceof Closure) {
-                                clearBytesOut(clearBytes);
-                            } else {
-                                clearBytesOut = clearBytes;
-                            }
-                        }
-                    });
-                    clearBytesOut
-                }
-            };
-        }
-        return null;
-    }
-
-    protected Object genericUpdate(String scriptName, Action method, ObjectClass \
objectClass, Uid uid, Set&lt;Attribute&gt; attributes, </del><ins>+    protected \
Object genericUpdate(String scriptName, OperationType method, ObjectClass \
objectClass, Uid uid, Set&lt;Attribute&gt; attributes, </ins><span class="cx">        \
OperationOptions options) { </span><span class="cx">         final Binding arguments \
= new Binding(); </span><span class="cx">         final Map&lt;String, Object&gt; \
attributesMap = new HashMap&lt;String, Object&gt;() </span><span class="lines">@@ \
-772,10 +683,10 @@ </span><span class="cx">             if (attribute.is(Name.NAME)) \
{ </span><span class="cx">                 arguments.setVariable(ID, \
AttributeUtil.getSingleValue(attribute)) </span><span class="cx">             } else \
if ((attribute.is(OperationalAttributes.PASSWORD_NAME) || </span><del>-               \
attribute.is(OperationalAttributes.CURRENT_PASSWORD_NAME)) &amp;&amp; \
method.equals(Action.UPDATE)) { </del><ins>+                    \
attribute.is(OperationalAttributes.CURRENT_PASSWORD_NAME)) &amp;&amp; \
method.equals(OperationType.UPDATE)) { </ins><span class="cx">                 \
attributesMap.put(attribute.getName(), </span><span class="cx">                       \
getGuardedStringValue(AttributeUtil.getGuardedStringValue(attribute))); </span><del>- \
} else if (OperationalAttributes.isOperationalAttribute(attribute) &amp;&amp; \
method.equals(Action.UPDATE)) { </del><ins>+            } else if \
(OperationalAttributes.isOperationalAttribute(attribute) &amp;&amp; \
method.equals(OperationType.UPDATE)) { </ins><span class="cx">                 \
attributesMap.put(attribute.getName(), attribute.getValue()); </span><span \
class="cx">             } else { </span><span class="cx">                 \
attributesMap.put(attribute.getName(), attribute.getValue()); \
</span></span></pre></div> <a \
id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnectorsgroovyScr \
iptedConnectorjavafromrev6504trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfconnectorsgroovyScriptedConnectorgroovy"></a>
 <div class="copfile"><h4>Copied: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/groovy/ScriptedConnector.java \
(from rev 6504, trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/groovy/ScriptedConnector.groovy) \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/groovy/ScriptedConnector.java	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/groovy/ScriptedConnector.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+package org.forgerock.openicf.connectors.groovy;
+
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration;
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase;
+import org.identityconnectors.framework.spi.Connector;
+import org.identityconnectors.framework.spi.ConnectorClass;
+
+/**
+ * A ScriptedConnector is a generic Groovy Connector.
+ *
+ * @author Laszlo Hordos
+ */
+@ConnectorClass(displayNameKey = &quot;groovy.connector.display&quot;,
+        configurationClass = ScriptedConfiguration.class)
+public class ScriptedConnector extends \
ScriptedConnectorBase&lt;ScriptedConfiguration&gt; implements Connector { +}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnectorsgroovy \
ScriptedPoolableConnectorjavafromrev6504trunkconnectorsjavascriptedcommonsrcmaingroovyorgforgerockopenicfconnectorsgroovyScriptedPoolableConnectorgroovy"></a>
 <div class="copfile"><h4>Copied: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/groovy/ScriptedPoolableConnector.java \
(from rev 6504, trunk/connectors/java/scriptedcommon/src/main/groovy/org/forgerock/openicf/connectors/groovy/ScriptedPoolableConnector.groovy) \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/groovy/ScriptedPoolableConnector.java	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/groovy/ScriptedPoolableConnector.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+package org.forgerock.openicf.connectors.groovy;
+
+import java.util.Set;
+
+import org.forgerock.openicf.misc.scriptedcommon.OperationType;
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration;
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase;
+import org.identityconnectors.common.StringUtil;
+import org.identityconnectors.framework.common.objects.Attribute;
+import org.identityconnectors.framework.common.objects.ObjectClass;
+import org.identityconnectors.framework.common.objects.OperationOptions;
+import org.identityconnectors.framework.common.objects.Uid;
+import org.identityconnectors.framework.spi.ConnectorClass;
+import org.identityconnectors.framework.spi.PoolableConnector;
+
+import groovy.lang.Binding;
+
+/**
+ * A ScriptedPoolableConnector is a generic Groovy Poolable Connector.
+ *
+ * @author Laszlo Hordos
+ */
+@ConnectorClass(displayNameKey = &quot;groovy.poolable.connector.display&quot;,
+        configurationClass = ScriptedConfiguration.class)
+public class ScriptedPoolableConnector extends \
ScriptedConnectorBase&lt;ScriptedConfiguration&gt; +        implements \
PoolableConnector { +
+    @Override
+    public void checkAlive() {
+    }
+
+    @Override
+    protected Binding createBinding(Binding arguments, OperationType action, \
ObjectClass objectClass, Uid uid, +                                    \
Set&lt;Attribute&gt; attributes, OperationOptions options) { +        Binding binding \
= super.createBinding(arguments, action, objectClass, uid, attributes, options); +    \
if (!OperationType.SCHEMA.equals(action) &amp;&amp; StringUtil +                \
.isNotBlank(getScriptedConfiguration().getSchemaScriptFileName())) { +            \
arguments.setVariable(SCHEMA, schema()); +        }
+        return binding;
+    }
+
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnectorsscriptedcrestScriptedCRESTConnectorjava"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedcrest/ScriptedCRESTConnector.java \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedcrest/ScriptedCRESTConnector.java	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedcrest/ScriptedCRESTConnector.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+package org.forgerock.openicf.connectors.scriptedcrest;
+
+import java.util.Set;
+
+import org.forgerock.openicf.misc.scriptedcommon.OperationType;
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase;
+import org.identityconnectors.common.StringUtil;
+import org.identityconnectors.framework.common.objects.Attribute;
+import org.identityconnectors.framework.common.objects.ObjectClass;
+import org.identityconnectors.framework.common.objects.OperationOptions;
+import org.identityconnectors.framework.common.objects.Uid;
+import org.identityconnectors.framework.spi.ConnectorClass;
+import org.identityconnectors.framework.spi.PoolableConnector;
+
+import groovy.lang.Binding;
+
+/**
+ * A NAME does ...
+ *
+ * @author Laszlo Hordos
+ */
+@ConnectorClass(displayNameKey = &quot;groovy.crest.connector.display&quot;,
+        configurationClass = ScriptedCRESTConfiguration.class,
+        messageCatalogPaths = \
{&quot;org/forgerock/openicf/connectors/groovy/Messages&quot;, +                \
&quot;org/forgerock/openicf/connectors/scriptedrest/Messages&quot;, +                \
&quot;org/forgerock/openicf/connectors/scriptedcrest/Messages&quot;}) +public class \
ScriptedCRESTConnector extends \
ScriptedConnectorBase&lt;ScriptedCRESTConfiguration&gt; +        implements \
PoolableConnector { +
+    @Override
+    public void checkAlive() {
+    }
+
+    @Override
+    protected Binding createBinding(Binding arguments, OperationType action, \
ObjectClass objectClass, +                                    Uid uid, \
Set&lt;Attribute&gt; attributes, OperationOptions options) { +        Binding b = \
super.createBinding(arguments, action, objectClass, uid, attributes, options); +      \
b.setVariable(CONNECTION, new RemoteConnection( +                \
(ScriptedCRESTConfiguration) getScriptedConfiguration())); +        if \
(!OperationType.SCHEMA.equals(action) &amp;&amp; StringUtil +                \
.isNotBlank(getScriptedConfiguration().getSchemaScriptFileName())) { +            \
arguments.setVariable(SCHEMA, schema()); +        }
+        return b;
+    }
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnectorsscriptedcrestStreamingJsonSlurperjava"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedcrest/StreamingJsonSlurper.java \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedcrest/StreamingJsonSlurper.java	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedcrest/StreamingJsonSlurper.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,269 @@
</span><ins>+/*
+ * Copyright 2003-2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.forgerock.openicf.connectors.scriptedcrest;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.http.HttpEntity;
+import org.codehaus.groovy.runtime.DefaultGroovyMethodsSupport;
+import org.codehaus.groovy.runtime.IOGroovyMethods;
+import org.forgerock.json.resource.QueryResult;
+
+import groovy.json.JsonException;
+import groovy.json.JsonLexer;
+import groovy.json.JsonToken;
+import groovy.lang.Closure;
+import static groovy.json.JsonTokenType.*;
+
+/**
+ * JSON slurper which parses text or reader content into a data structure of lists \
and maps. + * &lt;p/&gt;
+ * Example usage: &lt;code&gt;&lt;pre&gt;
+ * def slurper = new JsonSlurper()
+ * def result = slurper.parseText('{&quot;person&quot;:{&quot;name&quot;:&quot;Guilla \
ume&quot;,&quot;age&quot;:33,&quot;pets&quot;:[&quot;dog&quot;,&quot;cat&quot;]}}') + \
* &lt;p/&gt; + * assert result.person.name == &quot;Guillaume&quot;
+ * assert result.person.age == 33
+ * assert result.person.pets.size() == 2
+ * assert result.person.pets[0] == &quot;dog&quot;
+ * assert result.person.pets[1] == &quot;cat&quot;
+ * &lt;/pre&gt;&lt;/code&gt;
+ *
+ * @author Guillaume Laforge
+ * @since 1.8.0
+ */
+public class StreamingJsonSlurper {
+
+    /**
+     * Parse a JSON data structure from content from a reader
+     *
+     * @param reader
+     *         reader over a JSON content
+     * @return a data structure of lists and maps
+     */
+    public Object parse(Reader reader, Closure handler, Closure&lt;Object&gt; \
callback) { +        Object content = null;
+
+        JsonLexer lexer = new JsonLexer(reader);
+
+        JsonToken token = lexer.nextToken();
+        if (token.getType() == OPEN_CURLY) {
+            content = parseObject(lexer, handler);
+        } else if (token.getType() == OPEN_BRACKET) {
+            parseArray(lexer, handler);
+        } else {
+            throw new JsonException(&quot;A JSON payload should start with &quot; + \
OPEN_CURLY.getLabel() +                    + &quot; or &quot; + \
OPEN_BRACKET.getLabel() + &quot;.\n&quot; + &quot;Instead, '&quot; + token.getText() \
+                    + &quot;' was found &quot; + &quot;on line: &quot; + \
token.getStartLine() + &quot;, &quot; + &quot;column: &quot; +                    + \
token.getStartColumn()); +        }
+
+        if (null != callback) {
+            callback.call(lexer, content);
+        }
+        return content;
+    }
+
+    public Object parse(HttpEntity entity, Closure handler, Closure&lt;Object&gt; \
callback) { +        Reader reader = null;
+        try {
+            return parse(IOGroovyMethods.newReader(entity.getContent()), handler, \
callback); +        } catch (IOException ioe) {
+            throw new JsonException(&quot;Unable to process Entity Content&quot;, \
ioe); +        } finally {
+            if (reader != null) {
+                DefaultGroovyMethodsSupport.closeWithWarning(reader);
+            }
+        }
+    }
+
+    /**
+     * Parse an array from the lexer
+     *
+     * @param lexer
+     *         the lexer
+     * @return a list of JSON values
+     */
+    @SuppressWarnings(&quot;unchecked&quot;)
+    private List parseArray(JsonLexer lexer, Closure handler) {
+        List content = new ArrayList();
+
+        JsonToken currentToken;
+
+        for (; ; ) {
+            currentToken = lexer.nextToken();
+
+            if (currentToken == null) {
+                throw new JsonException(&quot;Expected a value on line: &quot; + \
lexer.getReader().getLine() +                        + &quot;, &quot; + &quot;column: \
&quot; + lexer.getReader().getColumn() + &quot;.\n&quot; +                        + \
&quot;But got an unterminated array.&quot;); +            }
+
+            if (currentToken.getType() == OPEN_CURLY) {
+                if (null != handler) {
+                    handler.call(parseObject(lexer, null));
+                } else {
+                    content.add(parseObject(lexer, handler));
+                }
+            } else if (currentToken.getType() == OPEN_BRACKET) {
+                content.add(parseArray(lexer, handler));
+            } else if (currentToken.getType().ordinal() &gt;= NULL.ordinal()) {
+                content.add(currentToken.getValue());
+            } else if (currentToken.getType() == CLOSE_BRACKET) {
+                return content;
+            } else {
+                throw new JsonException(&quot;Expected a value, an array, or an \
object &quot; + &quot;on line: &quot; +                        + \
currentToken.getStartLine() + &quot;, &quot; + &quot;column: &quot; +                 \
+ currentToken.getStartColumn() + &quot;.\n&quot; + &quot;But got '&quot; +           \
+ currentToken.getText() + &quot;' instead.&quot;); +            }
+
+            currentToken = lexer.nextToken();
+
+            if (currentToken == null) {
+                throw new JsonException(&quot;Expected &quot; + \
CLOSE_BRACKET.getLabel() + &quot; &quot; + &quot;or &quot; +                        + \
COMMA.getLabel() + &quot; &quot; + &quot;on line: &quot; + \
lexer.getReader().getLine() + &quot;, &quot; +                        + &quot;column: \
&quot; + lexer.getReader().getColumn() + &quot;.\n&quot; +                        + \
&quot;But got an unterminated array.&quot;); +            }
+
+            // Expect a comma for an upcoming value
+            // or a closing bracket for the end of the array
+            if (currentToken.getType() == CLOSE_BRACKET) {
+                break;
+            } else if (currentToken.getType() != COMMA) {
+                throw new JsonException(&quot;Expected a value or &quot; + \
CLOSE_BRACKET.getLabel() + &quot; &quot; +                        + &quot;on line: \
&quot; + currentToken.getStartLine() + &quot; &quot; + &quot;column: &quot; +         \
+ currentToken.getStartColumn() + &quot;.\n&quot; + &quot;But got '&quot; +           \
+ currentToken.getText() + &quot;' instead.&quot;); +            }
+        }
+
+        return content;
+    }
+
+    /**
+     * Parses an object from the lexer
+     *
+     * @param lexer
+     *         the lexer
+     * @return a Map representing a JSON object
+     */
+    private Map parseObject(JsonLexer lexer, Closure handler) {
+        Map content = new HashMap();
+
+        JsonToken previousToken = null;
+        JsonToken currentToken = null;
+
+        for (; ; ) {
+            currentToken = lexer.nextToken();
+
+            if (currentToken == null) {
+                throw new JsonException(&quot;Expected a String key on line: &quot;
+                        + lexer.getReader().getLine() + &quot;, &quot; + \
&quot;column: &quot; +                        + lexer.getReader().getColumn() + \
&quot;.\n&quot; + &quot;But got an unterminated object.&quot;); +            }
+
+            // expect a string key, or already a closing curly brace
+
+            if (currentToken.getType() == CLOSE_CURLY) {
+                return content;
+            } else if (currentToken.getType() != STRING) {
+                throw new JsonException(&quot;Expected &quot; + STRING.getLabel() + \
&quot; key &quot; + &quot;on line: &quot; +                        + \
currentToken.getStartLine() + &quot;, &quot; + &quot;column: &quot; +                 \
+ currentToken.getStartColumn() + &quot;.\n&quot; + &quot;But got '&quot; +           \
+ currentToken.getText() + &quot;' instead.&quot;); +            }
+
+            String mapKey = (String) currentToken.getValue();
+
+            currentToken = lexer.nextToken();
+
+            if (currentToken == null) {
+                throw new JsonException(&quot;Expected a &quot; + COLON.getLabel() + \
&quot; &quot; + &quot;on line: &quot; +                        + \
lexer.getReader().getLine() + &quot;, &quot; + &quot;column: &quot; +                 \
+ lexer.getReader().getColumn() + &quot;.\n&quot; + &quot;But got an unterminated \
object.&quot;); +            }
+
+            // expect a colon between the key and value pair
+
+            if (currentToken.getType() != COLON) {
+                throw new JsonException(&quot;Expected &quot; + COLON.getLabel() + \
&quot; &quot; + &quot;on line: &quot; +                        + \
currentToken.getStartLine() + &quot;, &quot; + &quot;column: &quot; +                 \
+ currentToken.getStartColumn() + &quot;.\n&quot; + &quot;But got '&quot; +           \
+ currentToken.getText() + &quot;' instead.&quot;); +            }
+
+            currentToken = lexer.nextToken();
+
+            if (currentToken == null) {
+                throw new JsonException(&quot;Expected a value &quot; + &quot;on \
line: &quot; +                        + lexer.getReader().getLine() + &quot;, &quot; \
+ &quot;column: &quot; +                        + lexer.getReader().getColumn() + \
&quot;.\n&quot; + &quot;But got an unterminated object.&quot;); +            }
+
+            // value can be an object, an array, a number, string, boolean or
+            // null values
+
+            if (currentToken.getType() == OPEN_CURLY) {
+                content.put(mapKey, parseObject(lexer, null));
+            } else if (currentToken.getType() == OPEN_BRACKET) {
+                if (mapKey.equals(QueryResult.FIELD_RESULT)) {
+                    content.put(mapKey, parseArray(lexer, handler));
+                } else {
+                    content.put(mapKey, parseArray(lexer, null));
+                }
+            } else if (currentToken.getType().ordinal() &gt;= NULL.ordinal()) {
+                content.put(mapKey, currentToken.getValue());
+            } else {
+                throw new JsonException(&quot;Expected a value, an array, or an \
object &quot; + &quot;on line: &quot; +                        + \
currentToken.getStartLine() + &quot;, &quot; + &quot;column: &quot; +                 \
+ currentToken.getStartColumn() + &quot;.\n&quot; + &quot;But got '&quot; +           \
+ currentToken.getText() + &quot;' instead.&quot;); +            }
+
+            previousToken = currentToken;
+            currentToken = lexer.nextToken();
+
+            // premature end of the object
+
+            if (currentToken == null) {
+                throw new JsonException(&quot;Expected &quot; + \
CLOSE_CURLY.getLabel() + &quot; or &quot; +                        + COMMA.getLabel() \
+ &quot; &quot; + &quot;on line: &quot; + previousToken.getEndLine() + &quot;, &quot; \
+                        + &quot;column: &quot; + previousToken.getEndColumn() + \
&quot;.\n&quot; +                        + &quot;But got an unterminated \
object.&quot;); +            }
+
+            // Expect a comma for an upcoming key/value pair
+            // or a closing curly brace for the end of the object
+            if (currentToken.getType() == CLOSE_CURLY) {
+                break;
+            } else if (currentToken.getType() != COMMA) {
+                throw new JsonException(&quot;Expected a value or &quot; + \
CLOSE_CURLY.getLabel() + &quot; &quot; +                        + &quot;on line: \
&quot; + currentToken.getStartLine() + &quot;, &quot; + &quot;column: &quot; +        \
+ currentToken.getStartColumn() + &quot;.\n&quot; + &quot;But got '&quot; +           \
+ currentToken.getText() + &quot;' instead.&quot;); +            }
+        }
+
+        return content;
+    }
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnectorsscriptedrestScriptedRESTConnectorjava"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedrest/ScriptedRESTConnector.java \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedrest/ScriptedRESTConnector.java	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedrest/ScriptedRESTConnector.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+/*
+ * DO NOT REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2013-2014 ForgeRock AS All rights reserved.
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+package org.forgerock.openicf.connectors.scriptedrest;
+
+import java.util.Set;
+
+import org.forgerock.openicf.misc.scriptedcommon.OperationType;
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase;
+import org.identityconnectors.framework.common.objects.Attribute;
+import org.identityconnectors.framework.common.objects.ObjectClass;
+import org.identityconnectors.framework.common.objects.OperationOptions;
+import org.identityconnectors.framework.common.objects.Uid;
+import org.identityconnectors.framework.spi.Connector;
+import org.identityconnectors.framework.spi.ConnectorClass;
+
+import groovy.lang.Binding;
+
+/**
+ * Main implementation of the ScriptedREST Connector.
+ *
+ * @author Gael Allioux &lt;gael.allioux@forgerock.com&gt;
+ */
+@ConnectorClass(displayNameKey = &quot;groovy.rest.connector.display&quot;,
+        configurationClass = ScriptedRESTConfiguration.class,
+        messageCatalogPaths = \
{&quot;org/forgerock/openicf/connectors/groovy/Messages&quot;, +                \
&quot;org/forgerock/openicf/connectors/scriptedrest/Messages&quot;}) +public class \
ScriptedRESTConnector extends ScriptedConnectorBase&lt;ScriptedRESTConfiguration&gt; \
+        implements Connector { +
+    protected Binding createBinding(Binding arguments, OperationType action, \
ObjectClass objectClass, +                                    Uid uid, \
Set&lt;Attribute&gt; attributes, OperationOptions options) { +        Binding b = \
super.createBinding(arguments, action, objectClass, uid, attributes, options); +      \
b.setVariable(CONNECTION, ((ScriptedRESTConfiguration) getScriptedConfiguration()) +  \
.getRESTClient()); +        return b;
+    }
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnectorsscriptedrestpackageinfojava"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedrest/package-info.java \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedrest/package-info.java	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedrest/package-info.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+/*
+ * DO NOT REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2013 ForgeRock Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+/**
+ * This is the core package for the connector.
+ *
+ */
+package org.forgerock.openicf.connectors.scriptedrest;
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnectorsscriptedsqlScriptedSQLConnectorjava"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedsql/ScriptedSQLConnector.java \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedsql/ScriptedSQLConnector.java	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedsql/ScriptedSQLConnector.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/**
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot; Portions Copyrighted [year] [name of copyright owner]&quot;
+ *
+ */
+package org.forgerock.openicf.connectors.scriptedsql;
+
+import java.sql.Connection;
+
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase;
+import org.identityconnectors.framework.spi.Connector;
+import org.identityconnectors.framework.spi.ConnectorClass;
+
+import groovy.lang.Binding;
+
+/**
+ * Main implementation of the ScriptedSQL Connector.
+ *
+ * @author Gael Allioux &lt;gael.allioux@forgerock.com&gt;
+ */
+@ConnectorClass(displayNameKey = &quot;groovy.sql.connector.display&quot;,
+        configurationClass = ScriptedSQLConfiguration.class,
+        messageCatalogPaths = \
{&quot;org/forgerock/openicf/connectors/groovy/Messages&quot;, +                \
&quot;org/forgerock/openicf/connectors/scriptedsql/Messages&quot;}) +public class \
ScriptedSQLConnector extends ScriptedConnectorBase&lt;ScriptedSQLConfiguration&gt; \
implements +        Connector {
+
+    protected Object evaluateScript(String scriptName, Binding arguments) throws \
Exception { +        final Connection c =
+                ((ScriptedSQLConfiguration) \
getScriptedConfiguration()).getDataSource() +                        \
.getConnection(); +        try {
+            arguments.setVariable(CONNECTION, c);
+            return super.evaluateScript(scriptName, arguments);
+        } finally {
+            // Put back the connection to pool
+            c.close();
+        }
+    }
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfconnectorsscriptedsqlpackageinfojava"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedsql/package-info.java \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedsql/package-info.java	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/connectors/scriptedsql/package-info.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+/*
+ * DO NOT REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2012 ForgeRock Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+/**
+ * This is the core package for the connector.
+ *
+ */
+package org.forgerock.openicf.connectors.scriptedsql;
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmisccrestAbstractRemoteConnectionjava"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/crest/AbstractRemoteConnection.java \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/crest/AbstractRemoteConnection.java	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/crest/AbstractRemoteConnection.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,908 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+package org.forgerock.openicf.misc.crest;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import java.util.regex.Pattern;
+
+import org.apache.http.ContentTooLongException;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpHeaders;
+import org.apache.http.HttpHost;
+import org.apache.http.HttpResponse;
+import org.apache.http.StatusLine;
+import org.apache.http.annotation.Immutable;
+import org.apache.http.client.HttpResponseException;
+import org.apache.http.client.methods.HttpDelete;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPatch;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.apache.http.client.utils.URIBuilder;
+import org.apache.http.concurrent.FutureCallback;
+import org.apache.http.entity.ContentType;
+import org.apache.http.nio.ContentDecoder;
+import org.apache.http.nio.IOControl;
+import org.apache.http.nio.entity.ContentBufferEntity;
+import org.apache.http.nio.protocol.AbstractAsyncResponseConsumer;
+import org.apache.http.nio.protocol.HttpAsyncResponseConsumer;
+import org.apache.http.nio.util.HeapByteBufferAllocator;
+import org.apache.http.nio.util.SimpleInputBuffer;
+import org.apache.http.protocol.HttpContext;
+import org.apache.http.util.Asserts;
+import org.apache.http.util.EntityUtils;
+import org.forgerock.json.fluent.JsonPointer;
+import org.forgerock.json.fluent.JsonValue;
+import org.forgerock.json.fluent.JsonValueException;
+import org.forgerock.json.resource.ActionRequest;
+import org.forgerock.json.resource.Connection;
+import org.forgerock.json.resource.Context;
+import org.forgerock.json.resource.CreateRequest;
+import org.forgerock.json.resource.DeleteRequest;
+import org.forgerock.json.resource.FutureResult;
+import org.forgerock.json.resource.InternalServerErrorException;
+import org.forgerock.json.resource.PatchOperation;
+import org.forgerock.json.resource.PatchRequest;
+import org.forgerock.json.resource.QueryRequest;
+import org.forgerock.json.resource.QueryResult;
+import org.forgerock.json.resource.QueryResultHandler;
+import org.forgerock.json.resource.ReadRequest;
+import org.forgerock.json.resource.Request;
+import org.forgerock.json.resource.Resource;
+import org.forgerock.json.resource.ResourceException;
+import org.forgerock.json.resource.ResourceName;
+import org.forgerock.json.resource.ResultHandler;
+import org.forgerock.json.resource.ServiceUnavailableException;
+import org.forgerock.json.resource.SortKey;
+import org.forgerock.json.resource.UpdateRequest;
+
+/**
+ * A NAME does ...
+ *
+ * @author Laszlo Hordos
+ */
+public abstract class AbstractRemoteConnection implements Connection {
+
+    static final String ETAG_ANY = &quot;*&quot;;
+    static final String PARAM_ACTION = param(ActionRequest.FIELD_ACTION);
+    static final String PARAM_FIELDS = param(Request.FIELD_FIELDS);
+    static final String PARAM_PAGE_SIZE = param(QueryRequest.FIELD_PAGE_SIZE);
+    static final String PARAM_PAGED_RESULTS_COOKIE = \
param(QueryRequest.FIELD_PAGED_RESULTS_COOKIE); +    static final String \
PARAM_PAGED_RESULTS_OFFSET = param(QueryRequest.FIELD_PAGED_RESULTS_OFFSET); +    \
static final String PARAM_QUERY_EXPRESSION = \
param(QueryRequest.FIELD_QUERY_EXPRESSION); +    static final String \
PARAM_QUERY_FILTER = param(QueryRequest.FIELD_QUERY_FILTER); +    static final String \
PARAM_QUERY_ID = param(QueryRequest.FIELD_QUERY_ID); +    static final String \
PARAM_SORT_KEYS = param(QueryRequest.FIELD_SORT_KEYS); +
+    static final Pattern CONTENT_TYPE_REGEX = Pattern.compile(
+            &quot;^application/json([ ]*;[ ]*charset=utf-8)?$&quot;, \
Pattern.CASE_INSENSITIVE); +
+
+    private final ResourceName resourceName;
+
+    private final HttpHost httpHost;
+
+    protected AbstractRemoteConnection(ResourceName resourceName, HttpHost httpHost) \
{ +        this.resourceName = resourceName;
+        this.httpHost = httpHost;
+    }
+
+    public abstract &lt;T&gt; Future&lt;T&gt; execute(final HttpUriRequest request,
+                                          final HttpAsyncResponseConsumer&lt;T&gt; \
responseConsumer, +                                          final \
FutureCallback&lt;T&gt; callback); +
+
+    protected abstract JsonValue parseJsonBody(final HttpEntity entity, final \
boolean allowEmpty) +            throws ResourceException;
+
+    protected abstract QueryResult parseQueryResponse(final HttpResponse response,
+                                                      final QueryResultHandler \
handler) throws ResourceException; +
+
+    public ResourceName getResourceName() {
+        return resourceName;
+    }
+
+    public HttpHost getHttpHost() {
+        return httpHost;
+    }
+
+
+    @Override
+    public void close() {
+        //Do Nothing
+    }
+
+    @Override
+    public boolean isValid() {
+        return !isClosed();
+    }
+
+    private final HttpAsyncResponseConsumer&lt;JsonValue&gt; \
JSON_VALUE_RESPONSE_HANDLER = +            new JsonValueResponseHandler();
+
+    private final HttpAsyncResponseConsumer&lt;Resource&gt; \
RESOURCE_RESPONSE_HANDLER = +            new ResourceResponseHandler();
+
+    @Override
+    public JsonValue action(final Context context, final ActionRequest request)
+            throws ResourceException {
+        final FutureResult&lt;JsonValue&gt; future = actionAsync(context, request, \
null); +        try {
+            return future.get();
+        } catch (final InterruptedException e) {
+            throw interrupted(e);
+        } finally {
+            // Cancel the request if it hasn't completed.
+            future.cancel(false);
+        }
+    }
+
+    @Override
+    public FutureResult&lt;JsonValue&gt; actionAsync(final Context context, final \
ActionRequest request, +                                               final \
ResultHandler&lt;? super JsonValue&gt; handler) { +        try {
+
+            final Future&lt;JsonValue&gt; result =
+                    execute(convert(request),
+                            JSON_VALUE_RESPONSE_HANDLER, new \
InternalFutureCallback&lt;JsonValue&gt;( +                                    \
(ResultHandler&lt;JsonValue&gt;) handler) +                    );
+
+            return new InternalFutureResult&lt;JsonValue&gt;(result);
+        } catch (final Throwable t) {
+            final ResourceException exception = adapt(t);
+            if (null != handler) {
+                handler.handleError(exception);
+            }
+            return new FailedFutureResult&lt;JsonValue&gt;(exception);
+        }
+    }
+
+    @Override
+    public QueryResult query(final Context context, final QueryRequest request,
+                             final QueryResultHandler handler) throws \
ResourceException { +        final FutureResult&lt;QueryResult&gt; future = \
queryAsync(context, request, handler); +        try {
+            return future.get();
+        } catch (final InterruptedException e) {
+            throw interrupted(e);
+        } finally {
+            // Cancel the request if it hasn't completed.
+            future.cancel(false);
+        }
+    }
+
+    @Override
+    public QueryResult query(final Context context, final QueryRequest request,
+                             final Collection&lt;? super Resource&gt; results) \
throws ResourceException { +        final QueryResultHandler handler = new \
QueryResultHandler() { +
+            @Override
+            public void handleError(final ResourceException error) {
+                // Ignore - handled by future.
+            }
+
+            @Override
+            public boolean handleResource(final Resource resource) {
+                results.add(resource);
+                return true;
+            }
+
+            @Override
+            public void handleResult(final QueryResult result) {
+                // Ignore - handled by future.
+            }
+        };
+        return query(context, request, handler);
+    }
+
+    @Override
+    public FutureResult&lt;QueryResult&gt; queryAsync(Context context, QueryRequest \
request, +                                                final QueryResultHandler \
handler) { +        try {
+
+            final Future&lt;QueryResult&gt; result =
+                    execute(convert(request),
+                            new QueryResultResponseHandler(handler),
+                            new InternalFutureCallback&lt;QueryResult&gt;(handler));
+
+            return new InternalFutureResult&lt;QueryResult&gt;(result);
+        } catch (final Throwable t) {
+            final ResourceException exception = adapt(t);
+            if (null != handler) {
+                handler.handleError(exception);
+            }
+            return new FailedFutureResult&lt;QueryResult&gt;(exception);
+        }
+    }
+
+
+    @Override
+    public Resource create(final Context context, final CreateRequest request)
+            throws ResourceException {
+        final FutureResult&lt;Resource&gt; future = createAsync(context, request, \
null); +        try {
+            return future.get();
+        } catch (final InterruptedException e) {
+            throw interrupted(e);
+        } finally {
+            // Cancel the request if it hasn't completed.
+            future.cancel(false);
+        }
+    }
+
+
+    @Override
+    public FutureResult&lt;Resource&gt; createAsync(Context context, CreateRequest \
request, +                                              ResultHandler&lt;? super \
Resource&gt; handler) { +        return handleRequestAsync(request, handler);
+    }
+
+    @Override
+    public Resource delete(final Context context, final DeleteRequest request)
+            throws ResourceException {
+        final FutureResult&lt;Resource&gt; future = deleteAsync(context, request, \
null); +        try {
+            return future.get();
+        } catch (final InterruptedException e) {
+            throw interrupted(e);
+        } finally {
+            // Cancel the request if it hasn't completed.
+            future.cancel(false);
+        }
+    }
+
+    @Override
+    public FutureResult&lt;Resource&gt; deleteAsync(Context context, DeleteRequest \
request, +                                              ResultHandler&lt;? super \
Resource&gt; handler) { +        return handleRequestAsync(request, handler);
+    }
+
+    @Override
+    public Resource patch(final Context context, final PatchRequest request)
+            throws ResourceException {
+        final FutureResult&lt;Resource&gt; future = patchAsync(context, request, \
null); +        try {
+            return future.get();
+        } catch (final InterruptedException e) {
+            throw interrupted(e);
+        } finally {
+            // Cancel the request if it hasn't completed.
+            future.cancel(false);
+        }
+    }
+
+    @Override
+    public FutureResult&lt;Resource&gt; patchAsync(Context context, PatchRequest \
request, +                                             ResultHandler&lt;? super \
Resource&gt; handler) { +        return handleRequestAsync(request, handler);
+    }
+
+    @Override
+    public Resource read(final Context context, final ReadRequest request) throws \
ResourceException { +        final FutureResult&lt;Resource&gt; future = \
readAsync(context, request, null); +        try {
+            return future.get();
+        } catch (final InterruptedException e) {
+            throw interrupted(e);
+        } finally {
+            // Cancel the request if it hasn't completed.
+            future.cancel(false);
+        }
+    }
+
+    @Override
+    public FutureResult&lt;Resource&gt; readAsync(Context context, ReadRequest \
request, +                                            ResultHandler&lt;? super \
Resource&gt; handler) { +        return handleRequestAsync(request, handler);
+    }
+
+    @Override
+    public Resource update(final Context context, final UpdateRequest request)
+            throws ResourceException {
+        final FutureResult&lt;Resource&gt; future = updateAsync(context, request, \
null); +        try {
+            return future.get();
+        } catch (final InterruptedException e) {
+            throw interrupted(e);
+        } finally {
+            // Cancel the request if it hasn't completed.
+            future.cancel(false);
+        }
+    }
+
+    @Override
+    public FutureResult&lt;Resource&gt; updateAsync(Context context, UpdateRequest \
request, +                                              ResultHandler&lt;? super \
Resource&gt; handler) { +        return handleRequestAsync(request, handler);
+    }
+
+    private HttpUriRequest convert(Request request) throws ResourceException {
+        URIBuilder builder = getUriBuilder(request);
+        HttpUriRequest rq = null;
+        try {
+            switch (request.getRequestType()) {
+                case ACTION: {
+                    ActionRequest actionRequest = (ActionRequest) request;
+
+                    builder.setParameter(PARAM_ACTION, actionRequest.getAction());
+                    for (Map.Entry&lt;String, String&gt; entry : actionRequest
+                            .getAdditionalParameters().entrySet()) {
+                        builder.setParameter(entry.getKey(), entry.getValue());
+                    }
+
+                    HttpPost httpRequest = new HttpPost(builder.build());
+                    httpRequest.setEntity(new \
JsonEntity(actionRequest.getContent())); +
+                    rq = httpRequest;
+                    rq.addHeader(HttpHeaders.ACCEPT, \
ContentType.APPLICATION_JSON.toString()); +                    \
rq.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString()); +    \
break; +                }
+                case CREATE: {
+                    CreateRequest createRequest = (CreateRequest) request;
+
+                    if (null == createRequest.getNewResourceId()) {
+                        builder.setParameter(PARAM_ACTION, \
ActionRequest.ACTION_ID_CREATE); +                        HttpPost httpRequest = new \
HttpPost(builder.build()); +                        httpRequest.setEntity(new \
JsonEntity(createRequest.getContent())); +                        rq = httpRequest;
+                    } else {
+                        HttpPut httpRequest = new HttpPut(builder.build());
+                        httpRequest.setEntity(new \
JsonEntity(createRequest.getContent())); +                        \
httpRequest.setHeader(HttpHeaders.IF_NONE_MATCH, ETAG_ANY); +                        \
rq = httpRequest; +                    }
+                    rq.addHeader(HttpHeaders.ACCEPT, \
ContentType.APPLICATION_JSON.toString()); +                    \
rq.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString()); +    \
break; +                }
+                case UPDATE: {
+                    UpdateRequest updateRequest = (UpdateRequest) request;
+
+                    HttpPut httpRequest = new HttpPut(builder.build());
+                    httpRequest.setEntity(new \
JsonEntity(updateRequest.getNewContent())); +
+                    if (null != updateRequest.getRevision()) {
+                        httpRequest.setHeader(HttpHeaders.ETAG, \
updateRequest.getRevision()); +                    }
+
+                    rq = httpRequest;
+                    rq.addHeader(HttpHeaders.ACCEPT, \
ContentType.APPLICATION_JSON.toString()); +                    \
rq.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString()); +    \
break; +                }
+                case PATCH: {
+                    PatchRequest patchRequest = (PatchRequest) request;
+
+                    List&lt;Map&lt;String, Object&gt;&gt; patch =
+                            new ArrayList&lt;Map&lt;String, \
Object&gt;&gt;(patchRequest.getPatchOperations().size()); +                    for \
(PatchOperation operation : patchRequest.getPatchOperations()) { +                    \
patch.add(operation.toJsonValue().asMap()); +                    }
+
+                    HttpPatch httpRequest = new HttpPatch(builder.build());
+                    httpRequest.setEntity(new JsonEntity(patch));
+
+                    if (null != patchRequest.getRevision()) {
+                        httpRequest.setHeader(HttpHeaders.ETAG, \
patchRequest.getRevision()); +                    }
+
+                    rq = httpRequest;
+                    rq.addHeader(HttpHeaders.ACCEPT, \
ContentType.APPLICATION_JSON.toString()); +                    \
rq.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString()); +    \
break; +                }
+                case DELETE: {
+                    DeleteRequest deleteRequest = (DeleteRequest) request;
+
+                    rq = new HttpDelete(builder.build());
+                    if (null != deleteRequest.getRevision()) {
+                        rq.setHeader(HttpHeaders.ETAG, deleteRequest.getRevision());
+                    }
+                    break;
+                }
+                case READ: {
+                    rq = new HttpGet(builder.build());
+                    break;
+                }
+                case QUERY: {
+                    QueryRequest queryRequest = (QueryRequest) request;
+
+                    for (Map.Entry&lt;String, String&gt; entry : \
queryRequest.getAdditionalQueryParameters() +                            .entrySet()) \
{ +                        builder.setParameter(entry.getKey(), entry.getValue());
+                    }
+
+                    if (null != queryRequest.getQueryId()) {
+                        builder.setParameter(PARAM_QUERY_ID, \
queryRequest.getQueryId()); +                    } else if (null != \
queryRequest.getQueryFilter()) { +                        \
builder.setParameter(PARAM_QUERY_FILTER, queryRequest.getQueryFilter() +              \
.toString()); +                    } else if (null != \
queryRequest.getQueryExpression()) { +                        \
builder.setParameter(PARAM_QUERY_EXPRESSION, queryRequest.getQueryExpression()); +    \
} +
+                    if (0 &lt; queryRequest.getPageSize()) {
+                        builder.setParameter(PARAM_PAGE_SIZE, \
Integer.toString(queryRequest +                                .getPageSize()));
+
+                        if (null != queryRequest.getPagedResultsCookie()) {
+                            builder.setParameter(PARAM_PAGED_RESULTS_COOKIE, \
queryRequest +                                    .getPagedResultsCookie());
+                        }
+                        builder.setParameter(PARAM_PAGED_RESULTS_OFFSET, \
Integer.toString(queryRequest +                                \
.getPagedResultsOffset())); +                    }
+
+                    for (SortKey key : queryRequest.getSortKeys()) {
+                        builder.setParameter(PARAM_SORT_KEYS, key.toString());
+                    }
+                    rq = new HttpGet(builder.build());
+                    break;
+                }
+            }
+        } catch (URISyntaxException e) {
+            throw new InternalServerErrorException(e);
+        }
+        return rq;
+    }
+
+    private URIBuilder getUriBuilder(Request request) {
+        ResourceName resourceName = \
getResourceName().concat(request.getResourceNameObject()); +
+        if (request instanceof CreateRequest
+                &amp;&amp; null != ((CreateRequest) request).getNewResourceId()) {
+            resourceName = resourceName.concat(((CreateRequest) \
request).getNewResourceId()); +        }
+
+        URIBuilder builder =
+                new \
URIBuilder().setScheme(getHttpHost().getSchemeName()).setHost(getHttpHost().getHostName())
 +                        .setPort(getHttpHost().getPort()).setPath(&quot;/&quot; + \
resourceName.toString()); +
+        for (JsonPointer field : request.getFields()) {
+            builder.setParameter(PARAM_FIELDS, field.toString());
+        }
+        return builder;
+    }
+
+
+    private FutureResult&lt;Resource&gt; handleRequestAsync(Request request,
+                                                      ResultHandler&lt;? super \
Resource&gt; handler) { +        try {
+
+            final Future&lt;Resource&gt; result =
+                    execute(convert(request),
+                            RESOURCE_RESPONSE_HANDLER, new \
InternalFutureCallback&lt;Resource&gt;( +                                    \
(ResultHandler&lt;Resource&gt;) handler) +                    );
+
+            return new InternalFutureResult&lt;Resource&gt;(result);
+        } catch (final Throwable t) {
+            final ResourceException exception = adapt(t);
+            if (null != handler) {
+                handler.handleError(exception);
+            }
+            return new FailedFutureResult&lt;Resource&gt;(exception);
+        }
+    }
+
+    // Handle thread interruption.
+    private ResourceException interrupted(final InterruptedException e) {
+        return new ServiceUnavailableException(&quot;Client thread \
interrupted&quot;, e); +    }
+
+    // Internal Class definitions
+
+
+    @Immutable
+    static abstract public class AbstractJsonValueResponseHandler&lt;T&gt; extends \
AbstractAsyncResponseConsumer&lt;T&gt; { +
+        protected volatile HttpResponse response;
+        private volatile SimpleInputBuffer buf;
+
+        @Override
+        protected void onResponseReceived(final HttpResponse response) throws \
IOException { +            this.response = response;
+        }
+
+        @Override
+        protected void onEntityEnclosed(
+                final HttpEntity entity, final ContentType contentType) throws \
IOException { +            long len = entity.getContentLength();
+            if (len &gt; Integer.MAX_VALUE) {
+                throw new ContentTooLongException(&quot;Entity content is too long: \
&quot; + len); +            }
+            if (len &lt; 0) {
+                len = 4096;
+            }
+            this.buf = new SimpleInputBuffer((int) len, new \
HeapByteBufferAllocator()); +            this.response.setEntity(new \
ContentBufferEntity(entity, this.buf)); +        }
+
+        @Override
+        protected void onContentReceived(
+                final ContentDecoder decoder, final IOControl ioctrl) throws \
IOException { +            Asserts.notNull(this.buf, &quot;Content buffer&quot;);
+            this.buf.consumeContent(decoder);
+        }
+
+        @Override
+        protected void releaseResources() {
+            this.response = null;
+            this.buf = null;
+        }
+
+    }
+
+    /**
+     * A {@link org.apache.http.client.ResponseHandler} that returns the response \
body as a JsonValue for successful +     * (2xx) responses. If the response code was \
&gt;= 300, the response body is consumed and an {@link +     * \
HttpResponseResourceException} is thrown. +     * &lt;p/&gt;
+     * If this is used with {@link \
org.apache.http.client.HttpClient#execute(org.apache.http.client.methods.HttpUriRequest,
 +     * org.apache.http.client.ResponseHandler)} , HttpClient may handle redirects \
(3xx responses) internally. +     */
+    @Immutable
+    public class JsonValueResponseHandler extends \
AbstractJsonValueResponseHandler&lt;JsonValue&gt; { +
+        /**
+         * Returns the response body as a String if the response was successful (a \
2xx status code). If no response body +         * exists, this returns null. If the \
response was unsuccessful (&gt;= 300 status code), throws an {@link +         * \
org.apache.http.client.HttpResponseException}. +         */
+        @Override
+        protected JsonValue buildResult(HttpContext context) throws Exception {
+            return parseResponse(response);
+        }
+
+    }
+
+    /**
+     * A {@link org.apache.http.client.ResponseHandler} that returns the response \
body as a String for successful (2xx) +     * responses. If the response code was \
&gt;= 300, the response body is consumed and an {@link +     * \
org.apache.http.client.HttpResponseException} is thrown. +     * &lt;p/&gt;
+     * If this is used with {@link \
org.apache.http.client.HttpClient#execute(org.apache.http.client.methods.HttpUriRequest,
 +     * org.apache.http.client.ResponseHandler)} , HttpClient may handle redirects \
(3xx responses) internally. +     */
+    @Immutable
+    public class QueryResultResponseHandler extends \
AbstractJsonValueResponseHandler&lt;QueryResult&gt; { +
+        private final QueryResultHandler handler;
+
+        public QueryResultResponseHandler(final QueryResultHandler handler) {
+            this.handler = handler;
+        }
+
+        /**
+         * Returns the response body as a String if the response was successful (a \
2xx status code). If no response body +         * exists, this returns null. If the \
response was unsuccessful (&gt;= 300 status code), throws an {@link +         * \
org.apache.http.client.HttpResponseException}. +         */
+        public QueryResult buildResult(HttpContext context) throws Exception {
+
+            return parseQueryResponse(response, handler);
+
+        }
+
+    }
+
+    /**
+     * A {@link org.apache.http.client.ResponseHandler} that returns the response \
body as a Resource for successful +     * (2xx) responses. If the response code was \
&gt;= 300, the response body is consumed and an {@link +     * \
HttpResponseResourceException} is thrown. +     * &lt;p/&gt;
+     * If this is used with {@link \
org.apache.http.client.HttpClient#execute(org.apache.http.client.methods.HttpUriRequest,
 +     * org.apache.http.client.ResponseHandler)} , HttpClient may handle redirects \
(3xx responses) internally. +     */
+    @Immutable
+    public class ResourceResponseHandler extends \
AbstractJsonValueResponseHandler&lt;Resource&gt; { +
+        /**
+         * Returns the response body as a String if the response was successful (a \
2xx status code). If no response body +         * exists, this returns null. If the \
response was unsuccessful (&gt;= 300 status code), throws an {@link +         * \
org.apache.http.client.HttpResponseException}. +         */
+        public Resource buildResult(HttpContext context) throws Exception {
+
+            return getAsResource(parseResponse(response));
+
+        }
+
+
+    }
+
+    /**
+     * The HttpResponseResourceException wraps the {@link ResourceException} into \
{@link +     * org.apache.http.client.HttpResponseException}.
+     * &lt;p/&gt;
+     * This exception is used inside {@link \
org.apache.http.client.ResponseHandler#handleResponse(org.apache.http.HttpResponse)}. \
+     */ +    public static class HttpResponseResourceException extends \
HttpResponseException { +
+        private final ResourceException cause;
+
+        public HttpResponseResourceException(ResourceException wrapped) {
+            super(wrapped.getCode(), wrapped.getReason());
+            cause = wrapped;
+        }
+
+        @Override
+        public ResourceException getCause() {
+            return cause;
+        }
+    }
+
+    static private class InternalFutureCallback&lt;R&gt; implements \
FutureCallback&lt;R&gt; { +
+        private final ResultHandler&lt;R&gt; handler;
+
+        protected InternalFutureCallback(final ResultHandler&lt;R&gt; handler) {
+            this.handler = handler;
+        }
+
+        protected ResultHandler&lt;R&gt; getResultHandler() {
+            return handler;
+        }
+
+        protected R adapt(R source) throws ResourceException {
+            return source;
+        }
+
+        @Override
+        public void completed(final R s) {
+            final ResultHandler&lt;R&gt; handler = getResultHandler();
+            if (null != handler) {
+                try {
+                    handler.handleResult(adapt(s));
+                } catch (final ResourceException e) {
+                    handler.handleError(e);
+                }
+            }
+        }
+
+        @Override
+        public void failed(final Exception e) {
+            final ResultHandler&lt;R&gt; handler = getResultHandler();
+            if (null != handler) {
+                if (e instanceof HttpResponseResourceException) {
+                    handler.handleError(((HttpResponseResourceException) \
e).getCause()); +                } else {
+                    handler.handleError(new InternalServerErrorException(e));
+                }
+            }
+        }
+
+        @Override
+        public void cancelled() {
+            final ResultHandler&lt;R&gt; handler = getResultHandler();
+            if (null != handler) {
+                handler.handleError(new ServiceUnavailableException(&quot;Client \
thread interrupted&quot;)); +            }
+        }
+    }
+
+    /**
+     * @param &lt;
+     *         T &gt;
+     */
+    private static class InternalFutureResult&lt;T&gt; implements \
FutureResult&lt;T&gt; { +
+        private final Future&lt;T&gt; futureTask;
+
+        protected InternalFutureResult(final Future&lt;T&gt; futureTask) {
+            this.futureTask = futureTask;
+        }
+
+        protected Future&lt;T&gt; getResult() {
+            return futureTask;
+        }
+
+        @Override
+        public boolean cancel(boolean mayInterruptIfRunning) {
+            return getResult().cancel(mayInterruptIfRunning);
+        }
+
+        @Override
+        public T get() throws ResourceException, InterruptedException {
+            try {
+                return getResult().get();
+            } catch (ExecutionException e) {
+                final Throwable cause = e.getCause();
+                if (cause instanceof ResourceException) {
+                    throw (ResourceException) cause;
+                }
+                throw new InternalServerErrorException(e);
+            }
+        }
+
+        @Override
+        public T get(long timeout, TimeUnit unit) throws ResourceException, \
TimeoutException, +                InterruptedException {
+            try {
+                return getResult().get(timeout, unit);
+            } catch (ExecutionException e) {
+                final Throwable cause = e.getCause();
+                if (cause instanceof ResourceException) {
+                    throw (ResourceException) cause;
+                }
+                throw new InternalServerErrorException(e);
+            }
+        }
+
+        @Override
+        public boolean isCancelled() {
+            return getResult().isCancelled();
+        }
+
+        @Override
+        public boolean isDone() {
+            return getResult().isDone();
+        }
+    }
+
+    static class FailedFutureResult&lt;V&gt; implements FutureResult&lt;V&gt; {
+        private ResourceException exception;
+
+        FailedFutureResult(final ResourceException result) {
+            this.exception = result;
+        }
+
+        @Override
+        public boolean cancel(boolean mayInterruptIfRunning) {
+            return false; // Cannot cancel.
+        }
+
+        @Override
+        public V get() throws ResourceException, InterruptedException {
+            throw exception;
+        }
+
+        @Override
+        public V get(long timeout, TimeUnit unit) throws ResourceException, \
TimeoutException, +                InterruptedException {
+            throw exception;
+        }
+
+        @Override
+        public boolean isCancelled() {
+            return false;
+        }
+
+        @Override
+        public boolean isDone() {
+            return true;
+        }
+
+    }
+
+    //
+    // Protected static methods
+    //
+
+    protected static Resource getAsResource(final JsonValue value) throws \
ResourceException { +        try {
+            return new \
Resource(value.get(Resource.FIELD_CONTENT_ID).required().asString(), value +          \
.get(Resource.FIELD_CONTENT_REVISION).asString(), value); +        } catch \
(JsonValueException e) { +            // What shell we do if the response does not \
contains the _id +            throw new InternalServerErrorException(e);
+        }
+    }
+
+    protected static ResourceException getAsResourceException(JsonValue \
resourceException) { +        ResourceException exception = null;
+        if (resourceException.isMap()) {
+            JsonValue code = resourceException.get(ResourceException.FIELD_CODE);
+            if (code.isNumber()) {
+                String message = \
resourceException.get(ResourceException.FIELD_MESSAGE).asString(); +
+                exception = ResourceException.getException(code.asInteger(), \
message); +
+                String reason = \
resourceException.get(ResourceException.FIELD_REASON).asString(); +                if \
(null != reason) { +                    exception.setReason(reason);
+                }
+
+                JsonValue detail = \
resourceException.get(ResourceException.FIELD_DETAIL); +                if \
(!detail.isNull()) { +                    exception.setDetail(detail);
+                }
+            }
+        }
+        return exception;
+    }
+
+    protected ResourceException isOK(StatusLine statusLine, HttpEntity entity) {
+        ResourceException exception = null;
+        if (statusLine.getStatusCode() &gt;= 300) {
+
+            String contentType = entity.getContentType().getValue();
+            if (contentType != null &amp;&amp; \
CONTENT_TYPE_REGEX.matcher(contentType).matches()) { +                try {
+                    JsonValue resourceException = parseJsonBody(entity, true);
+
+                    exception = getAsResourceException(resourceException);
+
+                } catch (ResourceException e) {
+                    /* ignore */
+                }
+            } else {
+                try {
+                    EntityUtils.consume(entity);
+                } catch (IOException e) {
+                    /* ignore */
+                }
+            }
+            if (null == exception) {
+                exception =
+                        ResourceException.getException(statusLine.getStatusCode(), \
statusLine +                                .getReasonPhrase());
+            }
+        }
+        return exception;
+    }
+
+    protected JsonValue parseResponse(final HttpResponse response) throws \
ResourceException { +        final StatusLine statusLine = response.getStatusLine();
+        final HttpEntity entity = response.getEntity();
+        ResourceException exception = isOK(statusLine, entity);
+        if (null != exception) {
+            throw exception;
+        }
+        return parseJsonBody(entity, true);
+    }
+
+    protected static String param(final String field) {
+        return &quot;_&quot; + field;
+    }
+
+    /**
+     * Adapts an {@code Exception} to a {@code ResourceException}.
+     *
+     * @param t
+     *         The exception which caused the request to fail.
+     * @return The equivalent resource exception.
+     */
+    protected static ResourceException adapt(final Throwable t) {
+        if (t instanceof ResourceException) {
+            return (ResourceException) t;
+        } else {
+            return new InternalServerErrorException(t);
+        }
+    }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmisccrestJsonEntityjava"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/crest/JsonEntity.java \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/crest/JsonEntity.java	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/crest/JsonEntity.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,86 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+package org.forgerock.openicf.misc.crest;
+
+import java.util.Map;
+
+import org.apache.http.annotation.NotThreadSafe;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.forgerock.json.fluent.JsonValue;
+
+import groovy.json.JsonOutput;
+
+/**
+ * A self contained, repeatable entity that obtains its content from a {@link \
String}. + *
+ * @author Laszlo Hordos
+ */
+@NotThreadSafe
+class JsonEntity extends StringEntity {
+
+    /**
+     * Creates a JsonEntity with the specified content.
+     *
+     * @param content
+     *         content to be used. Not {@code null}.
+     * @throws IllegalArgumentException
+     *         if the source parameter is null
+     */
+    public JsonEntity(final Object content) {
+        super(getJsonContent(content), ContentType.APPLICATION_JSON);
+    }
+
+    /**
+     * Creates a JsonEntity.
+     *
+     * @throws IllegalArgumentException
+     *         if the string parameter is null
+     */
+    public JsonEntity(final String string) {
+        super(string, ContentType.APPLICATION_JSON);
+    }
+
+    private static String getJsonContent(Object source) {
+
+        Object value = null;
+        if (source instanceof JsonValue) {
+            value = ((JsonValue) source).getObject();
+        } else {
+            value = source;
+        }
+        if (value instanceof Map) {
+            return JsonOutput.toJson((Map) value);
+        } else if (value instanceof Number) {
+            return JsonOutput.toJson((Number) value);
+        } else if (value instanceof String) {
+            return JsonOutput.toJson((String) value);
+        } else if (value instanceof Boolean) {
+            return JsonOutput.toJson((Boolean) value);
+        }
+        return JsonOutput.toJson(value);
+
+    }
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmiscscriptedcommonFilterVisitorjava"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/FilterVisitor.java \
(6508 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/FilterVisitor.java	2014-04-14 \
                21:18:24 UTC (rev 6508)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/FilterVisitor.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -39,32 +39,29 @@
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="cx">  * A visitor of {@code Filter}s, in the style of the visitor \
design pattern. </span><del>- * &lt;p&gt;
- * Classes implementing this interface can query filters in a type-safe manner.
- * When a visitor is passed to a filter's accept method, the corresponding visit
- * method most applicable to that filter is invoked.
</del><ins>+ * &lt;p/&gt;
+ * Classes implementing this interface can query filters in a type-safe manner. When \
a visitor is passed to a filter's + * accept method, the corresponding visit method \
most applicable to that filter is invoked. </ins><span class="cx">  *
</span><span class="cx">  * @param &lt;R&gt;
</span><del>- *            The return type of this visitor's methods. Use
- *            {@link java.lang.Void} for visitors that do not need to return
- *            results.
</del><ins>+ *         The return type of this visitor's methods. Use {@link \
java.lang.Void} for visitors that do not need to return + *         results.
</ins><span class="cx">  * @param &lt;P&gt;
</span><del>- *            The type of the additional parameter to this visitor's \
                methods.
- *            Use {@link java.lang.Void} for visitors that do not need an
- *            additional parameter.
</del><ins>+ *         The type of the additional parameter to this visitor's \
methods. Use {@link java.lang.Void} for visitors that + *         do not need an \
additional parameter. </ins><span class="cx">  */
</span><span class="cx"> public interface FilterVisitor&lt;P, R&gt; {
</span><span class="cx"> 
</span><span class="cx">     /**
</span><span class="cx">      * Visits an {@code and} filter.
</span><del>-     * &lt;p&gt;
-     * &lt;b&gt;Implementation note&lt;/b&gt;: for the purposes of matching, an \
                empty
-     * sub-filter list should always evaluate to {@code true}.
</del><ins>+     * &lt;p/&gt;
+     * &lt;b&gt;Implementation note&lt;/b&gt;: for the purposes of matching, an \
empty sub-filter list should always evaluate to +     * {@code true}.
</ins><span class="cx">      *
</span><span class="cx">      * @param parameter
</span><del>-     *            A visitor specified parameter.
</del><ins>+     *         A visitor specified parameter.
</ins><span class="cx">      * @param subFilters
</span><del>-     *            The unmodifiable list of sub-filters.
</del><ins>+     *         The unmodifiable list of sub-filters.
</ins><span class="cx">      * @return Returns a visitor specified result.
</span><span class="cx">      */
</span><span class="cx">     public R visit(P parameter, AndFilter subFilters);
</span><span class="lines">@@ -73,9 +70,9 @@
</span><span class="cx">      * Visits a {@code contains all} filter.
</span><span class="cx">      *
</span><span class="cx">      * @param parameter
</span><del>-     *            A visitor specified parameter.
</del><ins>+     *         A visitor specified parameter.
</ins><span class="cx">      * @param filter
</span><del>-     *            The value assertion.
</del><ins>+     *         The value assertion.
</ins><span class="cx">      * @return Returns a visitor specified result.
</span><span class="cx">      */
</span><span class="cx">     public R visit(P parameter, ContainsAllValuesFilter \
filter); </span><span class="lines">@@ -84,9 +81,9 @@
</span><span class="cx">      * Visits a {@code contains} filter.
</span><span class="cx">      *
</span><span class="cx">      * @param parameter
</span><del>-     *            A visitor specified parameter.
</del><ins>+     *         A visitor specified parameter.
</ins><span class="cx">      * @param filter
</span><del>-     *            The value assertion.
</del><ins>+     *         The value assertion.
</ins><span class="cx">      * @return Returns a visitor specified result.
</span><span class="cx">      */
</span><span class="cx">     public R visit(P parameter, ContainsFilter filter);
</span><span class="lines">@@ -95,9 +92,9 @@
</span><span class="cx">      * Visits a {@code ends with} filter.
</span><span class="cx">      *
</span><span class="cx">      * @param parameter
</span><del>-     *            A visitor specified parameter.
</del><ins>+     *         A visitor specified parameter.
</ins><span class="cx">      * @param filter
</span><del>-     *            The value assertion.
</del><ins>+     *         The value assertion.
</ins><span class="cx">      * @return Returns a visitor specified result.
</span><span class="cx">      */
</span><span class="cx">     public R visit(P parameter, EndsWithFilter filter);
</span><span class="lines">@@ -106,9 +103,9 @@
</span><span class="cx">      * Visits a {@code equality} filter.
</span><span class="cx">      *
</span><span class="cx">      * @param parameter
</span><del>-     *            A visitor specified parameter.
</del><ins>+     *         A visitor specified parameter.
</ins><span class="cx">      * @param filter
</span><del>-     *            The value assertion.
</del><ins>+     *         The value assertion.
</ins><span class="cx">      * @return Returns a visitor specified result.
</span><span class="cx">      */
</span><span class="cx">     public R visit(P parameter, EqualsFilter filter);
</span><span class="lines">@@ -117,9 +114,9 @@
</span><span class="cx">      * Visits a {@code greater than} filter.
</span><span class="cx">      *
</span><span class="cx">      * @param parameter
</span><del>-     *            A visitor specified parameter.
</del><ins>+     *         A visitor specified parameter.
</ins><span class="cx">      * @param filter
</span><del>-     *            The value assertion.
</del><ins>+     *         The value assertion.
</ins><span class="cx">      * @return Returns a visitor specified result.
</span><span class="cx">      */
</span><span class="cx">     public R visit(P parameter, GreaterThanFilter filter);
</span><span class="lines">@@ -128,9 +125,9 @@
</span><span class="cx">      * Visits a {@code greater than or equal to} filter.
</span><span class="cx">      *
</span><span class="cx">      * @param parameter
</span><del>-     *            A visitor specified parameter.
</del><ins>+     *         A visitor specified parameter.
</ins><span class="cx">      * @param filter
</span><del>-     *            The value assertion.
</del><ins>+     *         The value assertion.
</ins><span class="cx">      * @return Returns a visitor specified result.
</span><span class="cx">      */
</span><span class="cx">     public R visit(P parameter, GreaterThanOrEqualFilter \
filter); </span><span class="lines">@@ -139,9 +136,9 @@
</span><span class="cx">      * Visits a {@code less than} filter.
</span><span class="cx">      *
</span><span class="cx">      * @param parameter
</span><del>-     *            A visitor specified parameter.
</del><ins>+     *         A visitor specified parameter.
</ins><span class="cx">      * @param filter
</span><del>-     *            The value assertion.
</del><ins>+     *         The value assertion.
</ins><span class="cx">      * @return Returns a visitor specified result.
</span><span class="cx">      */
</span><span class="cx">     public R visit(P parameter, LessThanFilter filter);
</span><span class="lines">@@ -150,9 +147,9 @@
</span><span class="cx">      * Visits a {@code less than or equal to} filter.
</span><span class="cx">      *
</span><span class="cx">      * @param parameter
</span><del>-     *            A visitor specified parameter.
</del><ins>+     *         A visitor specified parameter.
</ins><span class="cx">      * @param filter
</span><del>-     *            The value assertion.
</del><ins>+     *         The value assertion.
</ins><span class="cx">      * @return Returns a visitor specified result.
</span><span class="cx">      */
</span><span class="cx">     public R visit(P parameter, LessThanOrEqualFilter \
filter); </span><span class="lines">@@ -161,23 +158,23 @@
</span><span class="cx">      * Visits a {@code not} filter.
</span><span class="cx">      *
</span><span class="cx">      * @param parameter
</span><del>-     *            A visitor specified parameter.
</del><ins>+     *         A visitor specified parameter.
</ins><span class="cx">      * @param subFilter
</span><del>-     *            The sub-filter.
</del><ins>+     *         The sub-filter.
</ins><span class="cx">      * @return Returns a visitor specified result.
</span><span class="cx">      */
</span><span class="cx">     public R visit(P parameter, NotFilter subFilter);
</span><span class="cx"> 
</span><span class="cx">     /**
</span><span class="cx">      * Visits an {@code or} filter.
</span><del>-     * &lt;p&gt;
-     * &lt;b&gt;Implementation note&lt;/b&gt;: for the purposes of matching, an \
                empty
-     * sub-filter list should always evaluate to {@code false}.
</del><ins>+     * &lt;p/&gt;
+     * &lt;b&gt;Implementation note&lt;/b&gt;: for the purposes of matching, an \
empty sub-filter list should always evaluate to +     * {@code false}.
</ins><span class="cx">      *
</span><span class="cx">      * @param parameter
</span><del>-     *            A visitor specified parameter.
</del><ins>+     *         A visitor specified parameter.
</ins><span class="cx">      * @param subFilters
</span><del>-     *            The unmodifiable list of sub-filters.
</del><ins>+     *         The unmodifiable list of sub-filters.
</ins><span class="cx">      * @return Returns a visitor specified result.
</span><span class="cx">      */
</span><span class="cx">     public R visit(P parameter, OrFilter subFilters);
</span><span class="lines">@@ -186,9 +183,9 @@
</span><span class="cx">      * Visits a {@code starts with} filter.
</span><span class="cx">      *
</span><span class="cx">      * @param parameter
</span><del>-     *            A visitor specified parameter.
</del><ins>+     *         A visitor specified parameter.
</ins><span class="cx">      * @param filter
</span><del>-     *            The value assertion.
</del><ins>+     *         The value assertion.
</ins><span class="cx">      * @return Returns a visitor specified result.
</span><span class="cx">      */
</span><span class="cx">     public R visit(P parameter, StartsWithFilter filter);
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmiscscriptedcommonLoggerjava"></a>
 <div class="delfile"><h4>Deleted: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/Logger.java \
(6508 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/Logger.java	2014-04-14 \
                21:18:24 UTC (rev 6508)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/Logger.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -1,89 +0,0 @@
</span><del>-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
- *
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the License). You may not use this file except in
- * compliance with the License.
- *
- * You can obtain a copy of the License at
- * http://forgerock.org/license/CDDLv1.0.html
- * See the License for the specific language governing
- * permission and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL
- * Header Notice in each file and include the License file
- * at http://forgerock.org/license/CDDLv1.0.html
- * If applicable, add the following below the CDDL Header,
- * with the fields enclosed by brackets [] replaced by
- * your own identifying information:
- * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
- */
-
-package org.forgerock.openicf.misc.scriptedcommon;
-
-/**
- * A Logger is another logging abstraction.
- *
- * @author Laszlo Hordos
- */
-public interface Logger {
-
-    public boolean isDebug();
-
-    public boolean isInfo();
-
-    public boolean isWarning();
-
-    public boolean isError();
-
-    public void debug(Throwable ex, String format, Object... args);
-
-    public void debugLocale(Throwable ex, String key, Object... args);
-
-    public void debugLocale(Throwable ex, String key, String defaultMessage, \
                Object... args);
-
-    public void info(Throwable ex, String format, Object... args);
-
-    public void infoLocale(Throwable ex, String key, Object... args);
-
-    public void infoLocale(Throwable ex, String key, String defaultMessage, \
                Object... args);
-
-    public void warn(Throwable ex, String format, Object... args);
-
-    public void warnLocale(Throwable ex, String key, Object... args);
-
-    public void warnLocale(Throwable ex, String key, String defaultMessage, \
                Object... args);
-
-    public void error(Throwable ex, String format, Object... args);
-
-    public void errorLocale(Throwable ex, String key, Object... args);
-
-    public void errorLocale(Throwable ex, String key, String defaultMessage, \
                Object... args);
-
-    public void debug(String format, Object... args);
-
-    public void debugLocale(String key, Object... args);
-
-    public void debugLocale(String key, String defaultMessage, Object... args);
-
-    public void info(String format, Object... args);
-
-    public void infoLocale(String key, Object... args);
-
-    public void infoLocale(String key, String defaultMessage, Object... args);
-
-    public void warn(String format, Object... args);
-
-    public void warnLocale(String key, Object... args);
-
-    public void warnLocale(String key, String defaultMessage, Object... args);
-
-    public void error(String format, Object... args);
-
-    public void errorLocale(String key, Object... args);
-
-    public void errorLocale(String key, String defaultMessage, Object... args);
-}
</del></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmiscscriptedcommonMapFilterVisitorjava"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/MapFilterVisitor.java \
(6508 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/MapFilterVisitor.java	2014-04-14 \
                21:18:24 UTC (rev 6508)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/MapFilterVisitor.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -44,9 +44,7 @@
</span><span class="cx"> import \
org.identityconnectors.framework.common.objects.filter.StartsWithFilter; </span><span \
class="cx">  </span><span class="cx"> /**
</span><del>- * A MapFilterVisitor converts a
- * {@link org.identityconnectors.framework.common.objects.filter.Filter} to
- * {@link Map}.
</del><ins>+ * A MapFilterVisitor converts a {@link \
org.identityconnectors.framework.common.objects.filter.Filter} to {@link Map}. \
</ins><span class="cx">  * </span><span class="cx">  * @author Gael Allioux \
&lt;gael.allioux@forgerock.com&gt; </span><span class="cx">  */
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmiscscriptedcommonOperationTypejava"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/OperationType.java \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/OperationType.java	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/OperationType.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+package org.forgerock.openicf.misc.scriptedcommon;
+
+/**
+ * A NAME does ...
+ *
+ * @author Laszlo Hordos
+ */
+public enum OperationType {
+    AUTHENTICATE,
+    CREATE,
+    DELETE,
+    GET_LATEST_SYNC_TOKEN,
+    RESOLVE_USERNAME,
+    SCHEMA,
+    SEARCH,
+    SYNC,
+    TEST,
+    RUNSCRIPTONCONNECTOR,
+    RUNSCRIPTONRESOURCE,
+    UPDATE,
+    ADD_ATTRIBUTE_VALUES,
+    REMOVE_ATTRIBUTE_VALUES;
+
+    public String debugTrace() {
+        return new StringBuilder(&quot;{0}:{1} \
&quot;).append(this.name()).toString(); +    }
+
+    public String fail1() {
+        return new StringBuilder(this.name()).append(&quot; script didn't return \
with the uid(__UID__) value&quot;).toString(); +    }
+
+    public String fail2(Class&lt;?&gt; clazz) {
+        return new StringBuilder(this.name()).append(&quot; script returned with an \
unsupported uid(__UID__) value type: &quot;) +                \
.append(clazz).toString(); +    }
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmiscscriptedcommonScriptedConfigurationjava"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/ScriptedConfiguration.java \
(6508 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/ScriptedConfiguration.java	2014-04-14 \
                21:18:24 UTC (rev 6508)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/ScriptedConfiguration.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -23,11 +23,8 @@
</span><span class="cx">  */
</span><span class="cx"> package org.forgerock.openicf.misc.scriptedcommon;
</span><span class="cx"> 
</span><del>-import static \
                org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase.LOGGER;
                
-
</del><span class="cx"> import java.io.File;
</span><span class="cx"> import java.net.URL;
</span><del>-import java.text.MessageFormat;
</del><span class="cx"> import java.util.Arrays;
</span><span class="cx"> import java.util.HashSet;
</span><span class="cx"> import java.util.concurrent.ConcurrentHashMap;
</span><span class="lines">@@ -35,13 +32,12 @@
</span><span class="cx"> 
</span><span class="cx"> import org.codehaus.groovy.control.CompilerConfiguration;
</span><span class="cx"> import \
org.codehaus.groovy.control.customizers.ImportCustomizer; </span><del>-import \
org.identityconnectors.common.ReflectionUtil; </del><span class="cx"> import \
org.identityconnectors.common.StringUtil; </span><span class="cx"> import \
org.identityconnectors.common.logging.Log; </span><span class="cx"> import \
org.identityconnectors.framework.common.exceptions.ConnectorException; \
</span><del>-import org.identityconnectors.framework.common.objects.ConnectorMessages;
 </del><span class="cx"> import \
org.identityconnectors.framework.common.objects.ConnectorObject; </span><span \
class="cx"> import org.identityconnectors.framework.spi.AbstractConfiguration; \
</span><ins>+import org.identityconnectors.framework.spi.ConfigurationProperty; \
</ins><span class="cx"> import \
org.identityconnectors.framework.spi.StatefulConfiguration; </span><span class="cx"> 
</span><span class="cx"> import groovy.lang.Binding;
</span><span class="lines">@@ -51,13 +47,13 @@
</span><span class="cx"> import groovy.util.GroovyScriptEngine;
</span><span class="cx"> import groovy.util.ResourceException;
</span><span class="cx"> import groovy.util.ScriptException;
</span><ins>+import static \
org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase.LOGGER; </ins><span \
class="cx">  </span><span class="cx"> /**
</span><del>- * Extends the {@link AbstractConfiguration} class to provide all the \
                necessary
- * parameters to initialize the Scripted Connector.
</del><ins>+ * Extends the {@link AbstractConfiguration} class to provide all the \
necessary parameters to initialize the Scripted + * Connector.
</ins><span class="cx">  *
</span><span class="cx">  * @author Gael Allioux &lt;gael.allioux@forgerock.com&gt;
</span><del>- *
</del><span class="cx">  */
</span><span class="cx"> public class ScriptedConfiguration extends \
AbstractConfiguration implements StatefulConfiguration { </span><span class="cx"> 
</span><span class="lines">@@ -68,39 +64,17 @@
</span><span class="cx">     private static final String DOT_STAR = &quot;.*&quot;;
</span><span class="cx">     private static final String EMPTY_STRING = &quot;&quot;;
</span><span class="cx">     private final CompilerConfiguration config;
</span><ins>+
</ins><span class="cx">     {
</span><span class="cx">         config = new \
CompilerConfiguration(CompilerConfiguration.DEFAULT); </span><span class="cx">        \
config.setSourceEncoding(&quot;UTF-8&quot;); </span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // \
======================================================================= </span><del>- \
// Scripts </del><ins>+    // Operation Script Files
</ins><span class="cx">     // \
======================================================================= </span><span \
class="cx">  </span><span class="cx">     /**
</span><del>-     * Should password be passed to scripts in clear text?
-     */
-    private boolean clearTextPasswordToScript = true;
-
-    /**
-     * Return the clearTextPasswordToScript boolean
-     *
-     * @return value
-     */
-    public boolean getClearTextPasswordToScript() {
-        return clearTextPasswordToScript;
-    }
-
-    /**
-     * Set the clearTextPasswordToScript value
-     *
-     * @param value
-     */
-    public void setClearTextPasswordToScript(boolean value) {
-        this.clearTextPasswordToScript = value;
-    }
-
-    /**
</del><span class="cx">      * Authenticate script filename
</span><span class="cx">      */
</span><span class="cx">     private String authenticateScriptFileName = null;
</span><span class="lines">@@ -110,6 +84,7 @@
</span><span class="cx">      *
</span><span class="cx">      * @return value
</span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = \
&quot;groovy.operation.scripts&quot;) </ins><span class="cx">     public String \
getAuthenticateScriptFileName() { </span><span class="cx">         return \
authenticateScriptFileName; </span><span class="cx">     }
</span><span class="lines">@@ -133,6 +108,7 @@
</span><span class="cx">      *
</span><span class="cx">      * @return value
</span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = \
&quot;groovy.operation.scripts&quot;) </ins><span class="cx">     public String \
getCreateScriptFileName() { </span><span class="cx">         return \
createScriptFileName; </span><span class="cx">     }
</span><span class="lines">@@ -156,6 +132,7 @@
</span><span class="cx">      *
</span><span class="cx">      * @return updateScriptFileName value
</span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = \
&quot;groovy.operation.scripts&quot;) </ins><span class="cx">     public String \
getUpdateScriptFileName() { </span><span class="cx">         return \
updateScriptFileName; </span><span class="cx">     }
</span><span class="lines">@@ -179,6 +156,7 @@
</span><span class="cx">      *
</span><span class="cx">      * @return deleteScriptFileName value
</span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = \
&quot;groovy.operation.scripts&quot;) </ins><span class="cx">     public String \
getDeleteScriptFileName() { </span><span class="cx">         return \
deleteScriptFileName; </span><span class="cx">     }
</span><span class="lines">@@ -202,6 +180,7 @@
</span><span class="cx">      *
</span><span class="cx">      * @return resolveUsernameScriptFileName value
</span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = \
&quot;groovy.operation.scripts&quot;) </ins><span class="cx">     public String \
getResolveUsernameScriptFileName() { </span><span class="cx">         return \
resolveUsernameScriptFileName; </span><span class="cx">     }
</span><span class="lines">@@ -216,29 +195,6 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     /**
</span><del>-     * ScriptOnConnector script FileName
-     */
-    private String scriptOnConnectorScriptFileName = null;
-
-    /**
-     * Return the ScriptOnConnector script FileName
-     *
-     * @return scriptOnConnectorScriptFileName value
-     */
-    public String getScriptOnConnectorScriptFileName() {
-        return scriptOnConnectorScriptFileName;
-    }
-
-    /**
-     * Set the ScriptOnConnector script FileName
-     *
-     * @param value
-     */
-    public void setScriptOnConnectorScriptFileName(String value) {
-        this.scriptOnConnectorScriptFileName = value;
-    }
-
-    /**
</del><span class="cx">      * ScriptOnResource script FileName
</span><span class="cx">      */
</span><span class="cx">     private String scriptOnResourceScriptFileName = null;
</span><span class="lines">@@ -248,6 +204,7 @@
</span><span class="cx">      *
</span><span class="cx">      * @return scriptOnResourceScriptFileName value
</span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = \
&quot;groovy.operation.scripts&quot;) </ins><span class="cx">     public String \
getScriptOnResourceScriptFileName() { </span><span class="cx">         return \
scriptOnResourceScriptFileName; </span><span class="cx">     }
</span><span class="lines">@@ -271,6 +228,7 @@
</span><span class="cx">      *
</span><span class="cx">      * @return searchScriptFileName value
</span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = \
&quot;groovy.operation.scripts&quot;) </ins><span class="cx">     public String \
getSearchScriptFileName() { </span><span class="cx">         return \
searchScriptFileName; </span><span class="cx">     }
</span><span class="lines">@@ -294,6 +252,7 @@
</span><span class="cx">      *
</span><span class="cx">      * @return syncScriptFileName value
</span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = \
&quot;groovy.operation.scripts&quot;) </ins><span class="cx">     public String \
getSyncScriptFileName() { </span><span class="cx">         return syncScriptFileName;
</span><span class="cx">     }
</span><span class="lines">@@ -317,6 +276,7 @@
</span><span class="cx">      *
</span><span class="cx">      * @return schemaScriptFileName value
</span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = \
&quot;groovy.operation.scripts&quot;) </ins><span class="cx">     public String \
getSchemaScriptFileName() { </span><span class="cx">         return \
schemaScriptFileName; </span><span class="cx">     }
</span><span class="lines">@@ -340,6 +300,7 @@
</span><span class="cx">      *
</span><span class="cx">      * @return testScriptFileName value
</span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = \
&quot;groovy.operation.scripts&quot;) </ins><span class="cx">     public String \
getTestScriptFileName() { </span><span class="cx">         return testScriptFileName;
</span><span class="cx">     }
</span><span class="lines">@@ -353,10 +314,31 @@
</span><span class="cx">         this.testScriptFileName = value;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+
+    // =======================================================================
+    // Groovy Engine configuration
+    // =======================================================================
+
+
</ins><span class="cx">     /**
</span><del>-     * Gets the currently configured warning level. See WarningMessage \
                for level
-     * details.
</del><ins>+     * Gets extensions used to find a groovy files
+     *
+     * @return
</ins><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = &quot;groovy.engine&quot;)
+    public String[] getScriptExtensions() {
+        return config.getScriptExtensions().toArray(new \
String[config.getScriptExtensions().size()]); +    }
+
+    public void setScriptExtensions(String[] scriptExtensions) {
+        config.setScriptExtensions(
+                null != scriptExtensions ? new \
HashSet&lt;String&gt;(Arrays.asList(scriptExtensions)) : null); +    }
+
+    /**
+     * Gets the currently configured warning level. See WarningMessage for level \
details. +     */
+    @ConfigurationProperty(groupMessageKey = &quot;groovy.engine&quot;)
</ins><span class="cx">     public int getWarningLevel() {
</span><span class="cx">         return config.getWarningLevel();
</span><span class="cx">     }
</span><span class="lines">@@ -371,6 +353,7 @@
</span><span class="cx">     /**
</span><span class="cx">      * Gets the currently configured source file encoding.
</span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = &quot;groovy.engine&quot;)
</ins><span class="cx">     public String getSourceEncoding() {
</span><span class="cx">         return config.getSourceEncoding();
</span><span class="cx">     }
</span><span class="lines">@@ -385,6 +368,7 @@
</span><span class="cx">     /**
</span><span class="cx">      * Gets the target directory for writing classes.
</span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = &quot;groovy.engine&quot;)
</ins><span class="cx">     public File getTargetDirectory() {
</span><span class="cx">         return config.getTargetDirectory();
</span><span class="cx">     }
</span><span class="lines">@@ -399,6 +383,7 @@
</span><span class="cx">     /**
</span><span class="cx">      * @return the classpath
</span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = &quot;groovy.engine&quot;)
</ins><span class="cx">     public String[] getClasspath() {
</span><span class="cx">         if (null != config.getClasspath()) {
</span><span class="cx">             return config.getClasspath().toArray(new \
String[config.getClasspath().size()]); </span><span class="lines">@@ -416,6 +401,7 @@
</span><span class="cx">     /**
</span><span class="cx">      * Returns true if verbose operation has been requested.
</span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = &quot;groovy.engine&quot;)
</ins><span class="cx">     public boolean getVerbose() {
</span><span class="cx">         return config.getVerbose();
</span><span class="cx">     }
</span><span class="lines">@@ -430,6 +416,7 @@
</span><span class="cx">     /**
</span><span class="cx">      * Returns true if debugging operation has been \
requested. </span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = &quot;groovy.engine&quot;)
</ins><span class="cx">     public boolean getDebug() {
</span><span class="cx">         return config.getDebug();
</span><span class="cx">     }
</span><span class="lines">@@ -444,55 +431,58 @@
</span><span class="cx">     /**
</span><span class="cx">      * Returns the requested error tolerance.
</span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = &quot;groovy.engine&quot;)
</ins><span class="cx">     public int getTolerance() {
</span><span class="cx">         return config.getTolerance();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     /**
</span><del>-     * Sets the error tolerance, which is the number of non-fatal errors \
                (per
-     * unit) that should be tolerated before compilation is aborted.
</del><ins>+     * Sets the error tolerance, which is the number of non-fatal errors \
(per unit) that should be tolerated before +     * compilation is aborted.
</ins><span class="cx">      */
</span><span class="cx">     public void setTolerance(int tolerance) {
</span><span class="cx">         config.setTolerance(tolerance);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     /**
</span><del>-     * Gets the name of the base class for scripts. It must be a \
                subclass of
-     * Script.
</del><ins>+     * Gets the name of the base class for scripts. It must be a subclass \
of Script. </ins><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = &quot;groovy.engine&quot;)
</ins><span class="cx">     public String getScriptBaseClass() {
</span><span class="cx">         return config.getScriptBaseClass();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     /**
</span><del>-     * Sets the name of the base class for scripts. It must be a \
                subclass of
-     * Script.
</del><ins>+     * Sets the name of the base class for scripts. It must be a subclass \
of Script. </ins><span class="cx">      */
</span><span class="cx">     public void setScriptBaseClass(String scriptBaseClass) {
</span><span class="cx">         config.setScriptBaseClass(scriptBaseClass);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    public void setRecompileGroovySource(boolean recompile) {
-        config.setRecompileGroovySource(recompile);
-    }
-
</del><ins>+    @ConfigurationProperty(groupMessageKey = &quot;groovy.engine&quot;)
</ins><span class="cx">     public boolean getRecompileGroovySource() {
</span><span class="cx">         return config.getRecompileGroovySource();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    public void setMinimumRecompilationInterval(int time) {
-        config.setMinimumRecompilationInterval(time);
</del><ins>+    public void setRecompileGroovySource(boolean recompile) {
+        config.setRecompileGroovySource(recompile);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    @ConfigurationProperty(groupMessageKey = &quot;groovy.engine&quot;)
</ins><span class="cx">     public int getMinimumRecompilationInterval() {
</span><span class="cx">         return config.getMinimumRecompilationInterval();
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    public void setMinimumRecompilationInterval(int time) {
+        config.setMinimumRecompilationInterval(time);
+    }
+
</ins><span class="cx">     /**
</span><span class="cx">      * Returns the list of disabled global AST \
transformation class names. </span><span class="cx">      *
</span><span class="cx">      * @return a list of global AST transformation fully \
qualified class names </span><span class="cx">      */
</span><ins>+    @ConfigurationProperty(groupMessageKey = &quot;groovy.engine&quot;)
</ins><span class="cx">     public String[] getDisabledGlobalASTTransformations() {
</span><span class="cx">         if (null != \
config.getDisabledGlobalASTTransformations()) { </span><span class="cx">             \
return config.getDisabledGlobalASTTransformations().toArray(new String[0]); \
</span><span class="lines">@@ -513,6 +503,10 @@ </span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // =======================================================================
 +    // Other Configuration Properties
+    // =======================================================================
+
</ins><span class="cx">     public void release() {
</span><span class="cx">         groovyScriptEngine = null;
</span><span class="cx">         loggerCache.clear();
</span><span class="lines">@@ -528,7 +522,6 @@
</span><span class="cx">         loadScript(getDeleteScriptFileName());
</span><span class="cx">         loadScript(getResolveUsernameScriptFileName());
</span><span class="cx">         loadScript(getSchemaScriptFileName());
</span><del>-        loadScript(getScriptOnConnectorScriptFileName());
</del><span class="cx">         loadScript(getScriptOnResourceScriptFileName());
</span><span class="cx">         loadScript(getSearchScriptFileName());
</span><span class="cx">         loadScript(getSyncScriptFileName());
</span><span class="lines">@@ -537,13 +530,13 @@
</span><span class="cx">         logger.info(&quot;Scripts are loaded&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    private static ConcurrentMap&lt;String, Logger&gt; loggerCache =
-            new ConcurrentHashMap&lt;String, Logger&gt;(11);
</del><ins>+    private static ConcurrentMap&lt;String, Log&gt; loggerCache =
+            new ConcurrentHashMap&lt;String, Log&gt;(11);
</ins><span class="cx"> 
</span><del>-    Object evaluate(String scriptName, Binding binding, Object delegate) \
{ </del><ins>+    Object evaluate(String scriptName, Binding binding, Object \
delegate) throws Exception { </ins><span class="cx">         try {
</span><span class="cx">             Script scr = \
getGroovyScriptEngine().createScript(scriptName, binding); </span><del>-            \
binding.setVariable(LOGGER, getLogger(scr.getClass(), 12)); </del><ins>+            \
binding.setVariable(LOGGER, getLogger(scr.getClass())); </ins><span class="cx">       \
if (scr instanceof DelegatingScript &amp;&amp; null != delegate) { </span><span \
class="cx">                 ((DelegatingScript) scr).setDelegate(delegate); \
</span><span class="cx">             } </span><span class="lines">@@ -555,19 +548,6 \
@@ </span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Logger getLogger(final Class&lt;?&gt; clazz, int depth) {
-        final String key = clazz.getName();
-        Logger logger = loggerCache.get(key);
-        if (null == logger) {
-            logger = new LoggerImpl(clazz, getConnectorMessages(), depth);
-            Logger l = loggerCache.putIfAbsent(key, logger);
-            if (l != null) {
-                logger = l;
-            }
-        }
-        return logger;
-    }
-
</del><span class="cx">     Class loadScript(String scriptName) {
</span><span class="cx">         if (StringUtil.isNotBlank(scriptName)) {
</span><span class="cx">             try {
</span><span class="lines">@@ -581,6 +561,19 @@
</span><span class="cx">         return null;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    private Log getLogger(final Class&lt;?&gt; clazz) {
+        final String key = clazz.getName();
+        Log logger = loggerCache.get(key);
+        if (null == logger) {
+            logger = Log.getLog(clazz);
+            Log l = loggerCache.putIfAbsent(key, logger);
+            if (l != null) {
+                logger = l;
+            }
+        }
+        return logger;
+    }
+
</ins><span class="cx">     private GroovyScriptEngine groovyScriptEngine = null;
</span><span class="cx"> 
</span><span class="cx">     GroovyScriptEngine getGroovyScriptEngine() {
</span><span class="lines">@@ -625,182 +618,6 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     protected String[] getImports() {
</span><del>-        return new String[] { \
ConnectorObject.class.getPackage().getName() + &quot;.*&quot; }; </del><ins>+        \
return new String[]{ConnectorObject.class.getPackage().getName() + &quot;.*&quot;}; \
</ins><span class="cx">     } </span><del>-
-    protected static class LoggerImpl implements Logger {
-
-        private static final String DFLT = &quot;__IGNORE__&quot;;
-        private final Class&lt;?&gt; clazz;
-        private final ConnectorMessages connectorMessages;
-        private final Log log;
-        private final Integer methodDepth;
-
-        protected LoggerImpl(final Class&lt;?&gt; clazz, final ConnectorMessages \
                messages, int depth) {
-            this.clazz = clazz;
-            log = Log.getLog(this.clazz);
-            connectorMessages = messages;
-            methodDepth = depth;
-        }
-
-        protected Log getLog() {
-            return log;
-        }
-
-        /**
-         * Logs based on the parameters given. Uses the format parameter inside
-         * {@link java.text.MessageFormat}.
-         *
-         * @param level
-         *            the logging level at which to write the message.
-         * @param ex
-         *            [optional] exception stack trace to log.
-         * @param format
-         *            [optional] create a message of a particular format.
-         * @param args
-         *            [optional] parameters to the format string.
-         */
-        public void log(final Log.Level level, final Throwable ex, final String key,
-                final String format, final Object... args) {
-            if (getLog().isLoggable(level)) {
-                String message = format;
-                if (key != null) {
-                    String messageLocal = connectorMessages.format(key, DFLT, args);
-                    if (!DFLT.equals(messageLocal)) {
-                        // MessageKey was found
-                        message = messageLocal;
-                    } else {
-                        // MessageKey not was found
-                        if (format != null &amp;&amp; args != null) {
-                            message = MessageFormat.format(format, args);
-                        } else if (format == null &amp;&amp; ex != null) {
-                            message = ex.getLocalizedMessage();
-                        } else if (format == null) {
-                            message = key;
-                        }
-                    }
-                } else {
-                    if (format != null &amp;&amp; args != null) {
-                        message = MessageFormat.format(format, args);
-                    } else if (format == null &amp;&amp; ex != null) {
-                        message = ex.getLocalizedMessage();
-                    }
-                }
-                final String methodName = ReflectionUtil.getMethodName(methodDepth);
-                getLog().log(clazz, methodName, level, message, ex);
-            }
-        }
-
-        public boolean isDebug() {
-            return getLog().isOk();
-        }
-
-        public boolean isInfo() {
-            return getLog().isInfo();
-        }
-
-        public boolean isWarning() {
-            return getLog().isWarning();
-        }
-
-        public boolean isError() {
-            return getLog().isError();
-        }
-
-        public void debug(Throwable ex, String format, Object... args) {
-            log(Log.Level.OK, ex, null, format, args);
-        }
-
-        public void debugLocale(Throwable ex, String key, Object... args) {
-            log(Log.Level.OK, ex, key, null, args);
-        }
-
-        public void debugLocale(Throwable ex, String key, String defaultMessage, \
                Object... args) {
-            log(Log.Level.OK, ex, key, defaultMessage, args);
-        }
-
-        public void info(Throwable ex, String format, Object... args) {
-            log(Log.Level.INFO, ex, null, format, args);
-        }
-
-        public void infoLocale(Throwable ex, String key, Object... args) {
-            log(Log.Level.INFO, ex, key, null, args);
-        }
-
-        public void infoLocale(Throwable ex, String key, String defaultMessage, \
                Object... args) {
-            log(Log.Level.INFO, ex, key, defaultMessage, args);
-        }
-
-        public void warn(Throwable ex, String format, Object... args) {
-            log(Log.Level.WARN, ex, null, format, args);
-        }
-
-        public void warnLocale(Throwable ex, String key, Object... args) {
-            log(Log.Level.WARN, ex, key, null, args);
-        }
-
-        public void warnLocale(Throwable ex, String key, String defaultMessage, \
                Object... args) {
-            log(Log.Level.WARN, ex, key, defaultMessage, args);
-        }
-
-        public void error(Throwable ex, String format, Object... args) {
-            log(Log.Level.ERROR, ex, null, format, args);
-        }
-
-        public void errorLocale(Throwable ex, String key, Object... args) {
-            log(Log.Level.ERROR, ex, key, null, args);
-        }
-
-        public void errorLocale(Throwable ex, String key, String defaultMessage, \
                Object... args) {
-            log(Log.Level.ERROR, ex, key, defaultMessage, args);
-        }
-
-        public void debug(String format, Object... args) {
-            log(Log.Level.OK, null, null, format, args);
-        }
-
-        public void debugLocale(String key, Object... args) {
-            log(Log.Level.OK, null, key, null, args);
-        }
-
-        public void debugLocale(String key, String defaultMessage, Object... args) {
-            log(Log.Level.OK, null, key, defaultMessage, args);
-        }
-
-        public void info(String format, Object... args) {
-            log(Log.Level.INFO, null, null, format, args);
-        }
-
-        public void infoLocale(String key, Object... args) {
-            log(Log.Level.INFO, null, key, null, args);
-        }
-
-        public void infoLocale(String key, String defaultMessage, Object... args) {
-            log(Log.Level.INFO, null, key, defaultMessage, args);
-        }
-
-        public void warn(String format, Object... args) {
-            log(Log.Level.WARN, null, null, format, args);
-        }
-
-        public void warnLocale(String key, Object... args) {
-            log(Log.Level.WARN, null, key, null, args);
-        }
-
-        public void warnLocale(String key, String defaultMessage, Object... args) {
-            log(Log.Level.WARN, null, key, defaultMessage, args);
-        }
-
-        public void error(String format, Object... args) {
-            log(Log.Level.ERROR, null, null, format, args);
-        }
-
-        public void errorLocale(String key, Object... args) {
-            log(Log.Level.ERROR, null, key, null, args);
-        }
-
-        public void errorLocale(String key, String defaultMessage, Object... args) {
-            log(Log.Level.ERROR, null, key, defaultMessage, args);
-        }
-    }
</del><span class="cx"> }
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmiscscriptedcommonScriptedConnectionjava"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/ScriptedConnection.java \
(6508 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/ScriptedConnection.java	2014-04-14 \
                21:18:24 UTC (rev 6508)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/ScriptedConnection.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -21,13 +21,13 @@
</span><span class="cx">  * your own identifying information:
</span><span class="cx">  * &quot;Portions Copyrighted [year] [name of copyright \
owner]&quot; </span><span class="cx">  */
</span><ins>+
</ins><span class="cx"> package org.forgerock.openicf.misc.scriptedcommon;
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- *
</del><span class="cx">  * @author Gael Allioux &lt;gael.allioux@forgerock.com&gt;
</span><span class="cx">  */
</span><del>-public interface ScriptedConnection {
</del><ins>+public interface ScriptedConnection&lt;T&gt; {
</ins><span class="cx"> 
</span><span class="cx">     /**
</span><span class="cx">      * Release internal resources.
</span><span class="lines">@@ -40,11 +40,11 @@
</span><span class="cx">     public void test();
</span><span class="cx"> 
</span><span class="cx">     /**
</span><del>-     * The connection needs to provide a generic handler object
-     * that will be used by every scripts to connect to the remote system
</del><ins>+     * The connection needs to provide a generic handler object that will \
be used by every scripts to connect to the +     * remote system
</ins><span class="cx">      *
</span><span class="cx">      * @return the connection handler generic Object
</span><span class="cx">      */
</span><del>-    public Object getConnectionHandler();
</del><ins>+    public T getConnectionHandler();
</ins><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainjavaorgforgerockopenicfmiscscriptedcommonScriptedFilterTranslatorjava"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/ScriptedFilterTranslator.java \
(6508 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/ScriptedFilterTranslator.java	2014-04-14 \
                21:18:24 UTC (rev 6508)
+++ trunk/connectors/java/scriptedcommon/src/main/java/org/forgerock/openicf/misc/scriptedcommon/ScriptedFilterTranslator.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -24,10 +24,6 @@
</span><span class="cx"> 
</span><span class="cx"> package org.forgerock.openicf.misc.scriptedcommon;
</span><span class="cx"> 
</span><del>-import static \
                org.identityconnectors.framework.common.objects.filter.FilterBuilder.and;
                
-import static org.identityconnectors.framework.common.objects.filter.FilterBuilder.not;
                
-import static org.identityconnectors.framework.common.objects.filter.FilterBuilder.or;
                
-
</del><span class="cx"> import \
org.identityconnectors.framework.common.objects.filter.AbstractFilterTranslator; \
</span><span class="cx"> import \
org.identityconnectors.framework.common.objects.filter.ContainsAllValuesFilter; \
</span><span class="cx"> import \
org.identityconnectors.framework.common.objects.filter.ContainsFilter; </span><span \
class="lines">@@ -40,10 +36,10 @@ </span><span class="cx"> import \
org.identityconnectors.framework.common.objects.filter.LessThanOrEqualFilter; \
</span><span class="cx"> import \
org.identityconnectors.framework.common.objects.filter.StartsWithFilter; </span><span \
class="cx">  </span><ins>+import static \
org.identityconnectors.framework.common.objects.filter.FilterBuilder.*; +
</ins><span class="cx"> /**
</span><del>- *
</del><span class="cx">  * @author Gael Allioux &lt;gael.allioux@forgerock.com&gt;
</span><del>- *
</del><span class="cx">  */
</span><span class="cx"> public class ScriptedFilterTranslator extends \
AbstractFilterTranslator&lt;Filter&gt; { </span><span class="cx"> 
</span><span class="lines">@@ -62,7 +58,7 @@
</span><span class="cx">      */
</span><span class="cx">     @Override
</span><span class="cx">     protected Filter createContainsAllValuesExpression(final \
ContainsAllValuesFilter filter, </span><del>-            boolean not) {
</del><ins>+                                                       boolean not) {
</ins><span class="cx">         return not ? not(filter) : filter;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -79,7 +75,7 @@
</span><span class="cx">      */
</span><span class="cx">     @Override
</span><span class="cx">     protected Filter createEndsWithExpression(final \
EndsWithFilter filter, boolean not) { </span><del>-        return \
super.createEndsWithExpression(filter, not); </del><ins>+        return not ? \
not(filter) : filter; </ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     /**
</span><span class="lines">@@ -103,7 +99,7 @@
</span><span class="cx">      */
</span><span class="cx">     @Override
</span><span class="cx">     protected Filter \
createGreaterThanOrEqualExpression(final GreaterThanOrEqualFilter filter, \
</span><del>-            boolean not) { </del><ins>+                                  \
boolean not) { </ins><span class="cx">         return not ? not(filter) : filter;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainresourcesorgforgerockopenicfconnectorsgroovyMessagesproperties"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/groovy/Messages.properties \
(6508 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/groovy/Messages.properties	2014-04-14 \
                21:18:24 UTC (rev 6508)
+++ trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/groovy/Messages.properties	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -1,7 +1,8 @@
</span><del>-# DO NOT REMOVE COPYRIGHT NOTICES OR THIS HEADER.
</del><span class="cx"> #
</span><del>-# Copyright (c) 2013-2014 ForgeRock AS. All rights reserved.
</del><ins>+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
</ins><span class="cx"> #
</span><ins>+# Copyright (c) 2013-2014 ForgeRock AS. All Rights Reserved
+#
</ins><span class="cx"> # The contents of this file are subject to the terms
</span><span class="cx"> # of the Common Development and Distribution License
</span><span class="cx"> # (the License). You may not use this file except in
</span><span class="lines">@@ -19,35 +20,70 @@
</span><span class="cx"> # with the fields enclosed by brackets [] replaced by
</span><span class="cx"> # your own identifying information:
</span><span class="cx"> # &quot;Portions Copyrighted [year] [name of copyright \
owner]&quot; </span><ins>+#
+
</ins><span class="cx"> groovy.connector.display=Scripted Groovy
</span><span class="cx"> groovy.poolable.connector.display=Scripted Poolable Groovy
</span><span class="cx"> 
</span><del>-clearTextPasswordToScript.display=Clear Text Password to Script
-clearTextPasswordToScript.help=On Authenticate/Create/Update operations, the \
password field is passed to the script. If this option is true (default), the \
password is passed in clear text. If false, the password is passed as a Guarded \
String. </del><ins>+#############################################################
+##                  SHARED PROPERTIES                      ##
+#############################################################
+
+# Operation Script Files
+groovy.operation.scripts=Operation Script Files
</ins><span class="cx"> authenticateScriptFileName.display=Authenticate Script \
filename </span><span class="cx"> authenticateScriptFileName.help=The name of the \
file used to perform the AUTHENTICATE operation. </span><span class="cx"> \
createScriptFileName.display=Create Script filename </span><span class="cx"> \
createScriptFileName.help=The name of the file used to perform the CREATE operation. \
                </span><del>-updateScriptFileName.display=Update Script filename
-updateScriptFileName.help=The name of the file used to perform the UPDATE operation.
</del><span class="cx"> deleteScriptFileName.display=Delete Script filename
</span><span class="cx"> deleteScriptFileName.help=The name of the file used to \
perform the DELETE operation. \
</span><ins>+resolveUsernameScriptFileName.display=ResolveUsername Script filename \
+resolveUsernameScriptFileName.help=The name of the file used to perform the \
RESOLVE_USERNAME operation. +schemaScriptFileName.display=Schema Script filename
+schemaScriptFileName.help=The name of the file used to perform the SCHEMA operation.
+scriptOnResourceScriptFileName.display=ScriptOnResource Script filename
+scriptOnResourceScriptFileName.help=The name of the file used to perform the \
RUNSCRIPTONRESOURCE operation. </ins><span class="cx"> \
searchScriptFileName.display=Search Script filename </span><span class="cx"> \
searchScriptFileName.help=The name of the file used to perform the SEARCH operation. \
</span><span class="cx"> syncScriptFileName.display=Sync Script filename </span><span \
class="cx"> syncScriptFileName.help=The name of the file used to perform the SYNC \
operation. </span><del>-schemaScriptFileName.display=Schema Script filename
-schemaScriptFileName.help=The name of the file used to perform the SCHEMA operation.
</del><span class="cx"> testScriptFileName.display=Test Script filename
</span><span class="cx"> testScriptFileName.help=The name of the file used to perform \
the TEST operation. </span><ins>+updateScriptFileName.display=Update Script filename
+updateScriptFileName.help=The name of the file used to perform the UPDATE operation.
</ins><span class="cx"> 
</span><del>-classpath.display=N/A
-classpath.help=N/A
-scriptOnResourceScriptFileName.display=N/A
-scriptOnResourceScriptFileName.help=N/A
-scriptOnConnectorScriptFileName.display=N/A
-scriptOnConnectorScriptFileName.help=N/A
</del><ins>+groovy.engine=Groovy Engine configuration
</ins><span class="cx"> 
</span><ins>+# Groovy Engine configuration
+classpath.display=Classpath
+classpath.help=Classpath for use during compilation.
+debug.display=Debug
+debug.help=If true, debugging code should be activated
+disabledGlobalASTTransformations.display=Disabled Global AST Transformations
+disabledGlobalASTTransformations.help=Sets a list of global AST transformations \
which should not be loaded even if they are defined in \
META-INF/org.codehaus.groovy.transform.ASTTransformation files. By default, none is \
disabled. +minimumRecompilationInterval.display=Minimum Recompilation Interval
+minimumRecompilationInterval.help=Sets the minimum of time after a script can be \
recompiled. +recompileGroovySource.display=Recompile Groovy Source
+recompileGroovySource.help=If set to true recompilation is enabled
+scriptBaseClass.display=Script Base Class
+scriptBaseClass.help=Base class name for scripts (must derive from Script)
+sourceEncoding.display=Source Encoding
+sourceEncoding.help=Encoding for source files
+targetDirectory.display=Target Directory
+targetDirectory.help=Directory into which to write classes.
+tolerance.display=Tolerance
+tolerance.help=The error tolerance, which is the number of non-fatal errors (per \
unit) that should be tolerated before compilation is aborted. \
+verbose.display=Verbose +verbose.help=If true, the compiler should produce action \
information +warningLevel.display=Warning Level
+warningLevel.help=Warning Level of the compiler
+
+#############################################################
+
+
+clearTextPasswordToScript.display=Clear Text Password to Script
+clearTextPasswordToScript.help=On Authenticate/Create/Update operations, the \
password field is passed to the script. If this option is true (default), the \
password is passed in clear text. If false, the password is passed as a Guarded \
String. +
</ins><span class="cx"> DEBUG_INVOKE_AUTHENTICATE=Invoke Authenticate \
ObjectClass:{0}-&gt;{1} </span><span class="cx"> DEBUG_INVOKE_CREATE=Invoke Create \
ObjectClass:{0} </span><span class="cx"> DEBUG_INVOKE_DELETE=Invoke Delete \
ObjectClass:{0}-&gt;{1} </span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainresourcesorgforgerockopenicfconnectorsscriptedcrestMessagesproperties"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/scriptedcrest/Messages.properties \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/scriptedcrest/Messages.properties	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/scriptedcrest/Messages.properties	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+#
+# Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+#
+# The contents of this file are subject to the terms
+# of the Common Development and Distribution License
+# (the License). You may not use this file except in
+# compliance with the License.
+#
+# You can obtain a copy of the License at
+# http://forgerock.org/license/CDDLv1.0.html
+# See the License for the specific language governing
+# permission and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL
+# Header Notice in each file and include the License file
+# at http://forgerock.org/license/CDDLv1.0.html
+# If applicable, add the following below the CDDL Header,
+# with the fields enclosed by brackets [] replaced by
+# your own identifying information:
+# &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+#
+
+groovy.crest.connector.display=Scripted CREST
+
+host.display=Example Host Property
+host.help=An example string configuration property
+remoteUser.display=Example Remote User Property
+remoteUser.help=An example string configuration property
+password.display=Example Password Property
+password.help=An example GuardedString property
+basic.group=Basic Configuration Properties
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainresourcesorgforgerockopenicfconnectorss \
criptedrestMessagespropertiesfromrev6504trunkconnectorsjavascriptedrestsrcmainresourcesorgforgerockopenicfconnectorsscriptedrestMessagesproperties"></a>
 <div class="copfile"><h4>Copied: \
trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/scriptedrest/Messages.properties \
(from rev 6504, trunk/connectors/java/scriptedrest/src/main/resources/org/forgerock/openicf/connectors/scriptedrest/Messages.properties) \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/scriptedrest/Messages.properties	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/scriptedrest/Messages.properties	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+#
+# Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+#
+# The contents of this file are subject to the terms
+# of the Common Development and Distribution License
+# (the License). You may not use this file except in
+# compliance with the License.
+#
+# You can obtain a copy of the License at
+# http://forgerock.org/license/CDDLv1.0.html
+# See the License for the specific language governing
+# permission and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL
+# Header Notice in each file and include the License file
+# at http://forgerock.org/license/CDDLv1.0.html
+# If applicable, add the following below the CDDL Header,
+# with the fields enclosed by brackets [] replaced by
+# your own identifying information:
+# &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+#
+
+groovy.rest.connector.display=Scripted REST
+
+
+host.display=Example Host Property
+host.help=An example string configuration property
+remoteUser.display=Example Remote User Property
+remoteUser.help=An example string configuration property
+password.display=Example Password Property
+password.help=An example GuardedString property
+basic.group=Basic Configuration Properties
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcmainresourcesorgforgerockopenicfconnectorss \
criptedsqlMessagespropertiesfromrev6504trunkconnectorsjavascriptedsqlsrcmainresourcesorgforgerockopenicfconnectorsscriptedsqlMessagesproperties"></a>
 <div class="copfile"><h4>Copied: \
trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/scriptedsql/Messages.properties \
(from rev 6504, trunk/connectors/java/scriptedsql/src/main/resources/org/forgerock/openicf/connectors/scriptedsql/Messages.properties) \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/scriptedsql/Messages.properties	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/main/resources/org/forgerock/openicf/connectors/scriptedsql/Messages.properties	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,166 @@
</span><ins>+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+#
+# Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+#
+# The contents of this file are subject to the terms
+# of the Common Development and Distribution License
+# (the License). You may not use this file except in
+# compliance with the License.
+#
+# You can obtain a copy of the License at
+# http://forgerock.org/license/CDDLv1.0.html
+# See the License for the specific language governing
+# permission and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL
+# Header Notice in each file and include the License file
+# at http://forgerock.org/license/CDDLv1.0.html
+# If applicable, add the following below the CDDL Header,
+# with the fields enclosed by brackets [] replaced by
+# your own identifying information:
+# &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+#
+
+groovy.sql.connector.display=Scripted SQL
+
+
+defaultAutoCommit.display=
+defaultAutoCommit.help=The default auto-commit state of connections created by this \
pool. If not set, default is JDBC driver default (If not set then the setAutoCommit \
method will not be called.) +
+defaultReadOnly.help=The default read-only state of connections created by this \
pool. If not set then the setReadOnly method will not be called. (Some drivers don't \
support read only mode, ex: Informix) +
+defaultTransactionIsolation.help=The default TransactionIsolation state of \
connections created by this pool. One of the following: NONE, READ_COMMITTED, \
READ_UNCOMMITTED, REPEATABLE_READ, SERIALIZABLE If not set, the method will not be \
called and it defaults to the JDBC driver. +
+defaultCatalog.help=The default catalog of connections created by this pool.
+
+driverClassName.help=The fully qualified Java class name of the JDBC driver to be \
used. The driver has to be accessible from the same classloader as tomcat-jdbc.jar +
+username.help=The connection username to be passed to our JDBC driver to establish a \
connection. Note that method DataSource.getConnection(username,password) by default \
will not use credentials passed into the method, but will use the ones configured \
here. See alternateUsernameAllowed property for more details. +
+password.help=The connection password to be passed to our JDBC driver to establish a \
connection. Note that method DataSource.getConnection(username,password) by default \
will not use credentials passed into the method, but will use the ones configured \
here. See alternateUsernameAllowed property for more details. +
+maxActive.help=The maximum number of active connections that can be allocated from \
this pool at the same time. The default value is 100 +
+maxIdle.help=The maximum number of connections that should be kept in the pool at \
all times. Default value is maxActive:100 Idle connections are checked periodically \
(if enabled) and connections that been idle for longer than \
minEvictableIdleTimeMillis will be released. (also see testWhileIdle) +
+minIdle.help=The minimum number of established connections that should be kept in \
the pool at all times. The connection pool can shrink below this number if validation \
queries fail. Default value is derived from initialSize:10 (also see testWhileIdle) +
+initialSize.help=The initial number of connections that are created when the pool is \
started. Default value is 10 +
+maxWait.help=The maximum number of milliseconds that the pool will wait (when there \
are no available connections) for a connection to be returned before throwing an \
exception. Default value is 30000 (30 seconds) +
+testOnBorrow.help=The indication of whether objects will be validated before being \
borrowed from the pool. If the object fails to validate, it will be dropped from the \
pool, and we will attempt to borrow another. NOTE - for a true value to have any \
effect, the validationQuery parameter must be set to a non-null string. In order to \
have a more efficient validation, see validationInterval. Default value is false +
+testOnReturn.help=The indication of whether objects will be validated before being \
returned to the pool. NOTE - for a true value to have any effect, the validationQuery \
parameter must be set to a non-null string. The default value is false. +
+testWhileIdle.help=The indication of whether objects will be validated by the idle \
object evictor (if any). If an object fails to validate, it will be dropped from the \
pool. NOTE - for a true value to have any effect, the validationQuery parameter must \
be set to a non-null string. The default value is false and this property has to be \
set in order for the pool cleaner/test thread is to run (also see \
timeBetweenEvictionRunsMillis) +
+validationQuery.help=The SQL query that will be used to validate connections from \
this pool before returning them to the caller. If specified, this query does not have \
to return any data, it just can't throw a SQLException. The default value is null. \
Example values are SELECT 1(mysql), select 1 from dual(oracle), SELECT 1(MS Sql \
Server) +
+validationQueryTimeout.help=The timeout in seconds before a connection validation \
queries fail. This works by calling java.sql.Statement.setQueryTimeout(seconds) on \
the statement that executes the validationQuery. The pool itself doesn't timeout the \
query, it is still up to the JDBC driver to enforce query timeouts. A value less than \
or equal to zero will disable this feature. The default value is -1. +
+validatorClassName.help=The name of a class which implements the \
org.apache.tomcat.jdbc.pool.Validator interface and provides a no-arg constructor \
(may be implicit). If specified, the class will be used to create a Validator \
instance which is then used instead of any validation query to validate connections. \
The default value is null. An example value is com.mycompany.project.SimpleValidator. \
+ +timeBetweenEvictionRunsMillis.help=The number of milliseconds to sleep between \
runs of the idle connection validation/cleaner thread. This value should not be set \
under 1 second. It dictates how often we check for idle, abandoned connections, and \
how often we validate idle connections. The default value is 5000 (5 seconds). +
+minEvictableIdleTimeMillis.help=The minimum amount of time an object may sit idle in \
the pool before it is eligible for eviction. The default value is 60000 (60 seconds). \
+ +accessToUnderlyingConnectionAllowed.help=Property not used. Access can be achieved \
by calling unwrap on the pooled connection. see javax.sql.DataSource interface, or \
call getConnection through reflection or cast the object as \
javax.sql.PooledConnection +
+removeAbandoned.help=Flag to remove abandoned connections if they exceed the \
removeAbandonedTimeout. If set to true a connection is considered abandoned and \
eligible for removal if it has been in use longer than the removeAbandonedTimeout \
Setting this to true can recover db connections from applications that fail to close \
a connection. See also logAbandoned The default value is false. +
+removeAbandonedTimeout.help=Timeout in seconds before an abandoned(in use) \
connection can be removed. The default value is 60 (60 seconds). The value should be \
set to the longest running query your applications might have. +
+logAbandoned.help=Flag to log stack traces for application code which abandoned a \
Connection. Logging of abandoned Connections adds overhead for every Connection \
borrow because a stack trace has to be generated. The default value is false. +
+connectionProperties.help=The connection properties that will be sent to our JDBC \
driver when establishing new connections. Format of the string must be \
[propertyName=property;]* NOTE - The &quot;user&quot; and &quot;password&quot; \
properties will be passed explicitly, so they do not need to be included here. The \
default value is null. +
+
+poolPreparedStatements.help=Property not used.
+
+maxOpenPreparedStatements.help=Property not used.
+
+numTestsPerEvictionRun.help=Property not used in tomcat-jdbc-pool.
+
+
+initSQL.help= A custom query to be run when a connection is first created. The \
default value is null. +
+jdbcInterceptors.help=A semicolon separated list of classnames extending \
org.apache.tomcat.jdbc.pool.JdbcInterceptor class. See Configuring JDBC interceptors \
below for more detailed description of syntaz and examples. These interceptors will \
be inserted as an interceptor into the chain of operations on a java.sql.Connection \
object. The default value is null. +
+#Predefined interceptors:
+#org.apache.tomcat.jdbc.pool.interceptor.
+#ConnectionState - keeps track of auto commit, read only, catalog and transaction \
isolation level. +#org.apache.tomcat.jdbc.pool.interceptor.
+#StatementFinalizer - keeps track of opened statements, and closes them when the \
connection is returned to the pool. +
+#More predefined interceptors are described in detail in the JDBC Interceptors \
section. +
+validationInterval.help=avoid excess validation, only run validation at most at this \
frequency - time in milliseconds. If a connection is due for validation, but has been \
validated previously within this interval, it will not be validated again. The \
default value is 30000 (30 seconds). +
+jmxEnabled.help=Register the pool with JMX or not. The default value is true.
+
+fairQueue.help=Set to true if you wish that calls to getConnection should be treated \
fairly in a true FIFO fashion. This uses the \
org.apache.tomcat.jdbc.pool.FairBlockingQueue implementation for the list of the idle \
connections. The default value is true. This flag is required when you want to use \
asynchronous connection retrieval. Setting this flag ensures that threads receive \
connections in the order they arrive. During performance tests, there is a very large \
difference in how locks and lock waiting is implemented. When fairQueue=true there is \
a decision making process based on what operating system the system is running. If \
the system is running on Linux (property os.name=Linux. To disable this Linux \
specific behavior and still use the fair queue, simply add the property \
org.apache.tomcat.jdbc.pool.FairBlockingQueue.ignoreOS=true to your system properties \
before the connection pool classes are loaded. +
+abandonWhenPercentageFull.help=Connections that have been abandoned (timed out) wont \
get closed and reported up unless the number of connections in use are above the \
percentage defined by abandonWhenPercentageFull. The value should be between 0-100. \
The default value is 0, which implies that connections are eligible for closure as \
soon as removeAbandonedTimeout has been reached. +
+maxAge.help=Time in milliseconds to keep this connection. When a connection is \
returned to the pool, the pool will check to see if the now - time-when-connected \
&gt; maxAge has been reached, and if so, it closes the connection rather than \
returning it to the pool. The default value is 0, which implies that connections will \
be left open and no age check will be done upon returning the connection to the pool. \
+ +useEquals.help=Set to true if you wish the ProxyConnection class to use \
String.equals and set to false when you wish to use == when comparing method names. \
This property does not apply to added interceptors as those are configured \
individually. The default value is true. +
+suspectTimeout.help=Timeout value in seconds. Similar to to the \
removeAbandonedTimeout value but instead of treating the connection as abandoned, and \
potentially closing the connection, this simply logs the warning if logAbandoned is \
set to true. If this value is equal or less than 0, no suspect checking will be \
performed. Suspect checking only takes place if the timeout value is larger than 0 \
and the connection was not abandoned or if abandon check is disabled. If a connection \
is suspect a WARN message gets logged and a JMX notification gets sent once. +
+rollbackOnReturn.help=If autoCommit==false then the pool can terminate the \
transaction by calling rollback on the connection as it is returned to the pool \
Default value is false. +
+commitOnReturn.help=If autoCommit==false then the pool can complete the transaction \
by calling commit on the connection as it is returned to the pool If \
rollbackOnReturn==true then this attribute is ignored. Default value is false. +
+alternateUsernameAllowed.help=By default, the jdbc-pool will ignore the \
DataSource.getConnection(username,password) call, and simply return a previously \
pooled connection under the globally configured properties username and password, for \
performance reasons. The pool can however be configured to allow use of different \
credentials each time a connection is requested. To enable the functionality \
described in the DataSource.getConnection(username,password) call, simply set the \
property alternateUsernameAllowed to true. Should you request a connection with the \
credentials user1/password1 and the connection was previously connected using \
different user2/password2, the connection will be closed, and reopened with the \
requested credentials. This way, the pool size is still managed on a global level, \
and not on a per schema level. +
+dataSource.help=Inject a data source to the connection pool, and the pool will use \
the data source to retrieve connections instead of establishing them using the \
java.sql.Driver interface. This is useful when you wish to pool XA connections or \
connections established using a data source instead of a connection string. +
+dataSourceJNDI.help=The JNDI name for a data source to be looked up in JNDI and then \
used to establish connections to the database. See the dataSource attribute. Default \
value is null +
+useDisposableConnectionFacade.help=Set this to true if you wish to put a facade on \
your connection so that it cannot be reused after it has been closed. This prevents a \
thread holding on to a reference of a connection it has already called closed on, to \
execute queries on it. +
+logValidationErrors.help=Set this to true to log errors during the validation phase \
to the log file. If set to true, errors will be logged as SEVERE. Default value is \
false for backwards compatibility. +
+propagateInterruptState.help=Set this to true to propagate the interrupt state for a \
thread that has been interrupted (not clearing the interrupt state). Default value is \
false for backwards compatibility. +
+ignoreExceptionOnPreLoad.help=Flag whether ignore error of connection creation while \
initializing the pool. Set to true if you want to ignore error of connection creation \
while initializing the pool. Set to false if you want to fail the initialization of \
the pool by throwing exception. +
+
+
+
+name.blank=The Name attribute cannot be null or empty.
+pwd.blank=The Password attribute cannot be null or empty.
+invalid.jndi.entry=Invalid value in JNDI entry : ''{0}''.
+configuration.property.empty=Property ''{0}'' is empty.
+key.column.blank=Key column name configuration property is empty.
+pwd.column.blank=Password column name configuration property is empty.
+changelog.column.blank=Changelog column name configuration property is empty.
+table.blank=Table configuration property is empty.
+admin.user.blank=User configuration property is empty.
+admin.password.blank=Password configuration property is empty.
+host.blank=Host configuration property is empty.
+port.blank=Port configuration property is empty.
+database.blank=Database configuration property is empty.
+jdbc.template.blank=Configuration property JDBC Connection URL is empty.
+jdbc.driver.blank=Configuration property JDBC Driver is empty.
+jdbc.driver.not.found=JDBC Driver is not found on classpath.
+invalid.quoting=Invalid quoting ''{0}''.
+acount.object.class.required=Operation requires an 'Account' 'ObjectClass'.
+auth.op.not.supported=Authenticate operation is not supported.
+auth.op.failed=User ''{0}'' authentication failed!
+invalid.attribute.set=Invalid attributes set.
+uid.blank=Operation requires an valid Uid!
+result.handler.null=Result handler is null!
+passwd.column.eq.key.column=The password column should not be the same as key \
column. +passwd.column.eq.change.log.column=The password column should not be the \
same as changelog column. +key.column.eq.change.log.column=The key column should not \
be the same as changelog column. +query.invalid=Validate connection query ''{0}'' do \
not return a result set. +more.users.deleted=Delete account invalid, the uid ''{0}'' \
has more then one record. +invalid.sync.token.value=Sync token value is invalid.
+can.not.read=Can not read from the table or view ''{0}''.
+can.not.create=Can not create account ''{0}''.
+can.not.update=Can not update account ''{0}''.
+can.not.delete=Can not delete account ''{0}''.
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrcsitesitexml"></a>
<div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/site/site.xml (6508 => 6509)</h4> <pre \
class="diff"><span> <span class="info">--- \
trunk/connectors/java/scriptedcommon/src/site/site.xml	2014-04-14 21:18:24 UTC (rev \
                6508)
+++ trunk/connectors/java/scriptedcommon/src/site/site.xml	2014-04-15 09:47:57 UTC \
(rev 6509) </span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">         &lt;menu name=&quot;ScriptedREST Core Docs&quot;&gt;
</span><span class="cx">             &lt;!--&lt;item name=&quot;All Formats&quot; \
href=&quot;docs.html&quot; /&gt;--&gt; </span><span class="cx">             \
&lt;!--item name=&quot;Release Notes&quot; \
href=&quot;./doc/release-notes/index.html&quot; /--&gt; </span><del>-            \
&lt;item name=&quot;Developer Guide&quot; \
href=&quot;./doc/scriptedcommon-1.4.0.0-SNAPSHOT/index.html&quot; /&gt; </del><ins>+  \
&lt;item name=&quot;Developer Guide&quot; \
href=&quot;./doc/groovy-connector-1.4.0.0-SNAPSHOT/index.html&quot; /&gt; </ins><span \
class="cx">         &lt;/menu&gt; </span><span class="cx"> 
</span><span class="cx">         &lt;menu ref=&quot;reports&quot;/&gt;
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestconfigorgforgerockopenicfmiscscriptedco \
mmonScriptedConnectorBaseconfigconfiggroovyfromrev6504trunkconnectorsjavascriptedcommo \
nsrctestconfigorgforgerockopenicfconnectorsgroovyScriptedConnectorconfigconfiggroovy"></a>
 <div class="copfile"><h4>Copied: \
trunk/connectors/java/scriptedcommon/src/test/config/org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase/config/config.groovy \
(from rev 6504, trunk/connectors/java/scriptedcommon/src/test/config/org.forgerock.openicf.connectors.groovy.ScriptedConnector/config/config.groovy) \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/config/org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase/config/config.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/config/org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase/config/config.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+/*
+ * DO NOT REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014. ForgeRock AS. All rights reserved.
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ *
+ */
+
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase
+import org.identityconnectors.common.security.GuardedString
+
+
+configuration {
+    clearTextPasswordToScript = false
+    authenticateScriptFileName = &quot;AuthenticateScript.groovy&quot;
+    createScriptFileName = &quot;CreateScript.groovy&quot;
+    deleteScriptFileName = &quot;DeleteScript.groovy&quot;
+    resolveUsernameScriptFileName = &quot;ResolveUsernameScript.groovy&quot;
+    schemaScriptFileName = &quot;SchemaScript.groovy&quot;
+    //scriptOnConnectorScriptFileName = &quot;ScriptOnConnectorScript.groovy&quot;
+    scriptOnResourceScriptFileName = &quot;ScriptOnResourceScript.groovy&quot;
+    searchScriptFileName = &quot;SearchScript.groovy&quot;
+    syncScriptFileName = &quot;SyncScript.groovy&quot;
+    testScriptFileName = &quot;TestScript.groovy&quot;
+    updateScriptFileName = &quot;UpdateScript.groovy&quot;
+
+    //warningLevel=WarningMessage.LIKELY_ERRORS
+    //sourceEncoding=&quot;UTF-8&quot;
+    //targetDirectory=${project.build.directory}
+    //classpath=[${project.build.outputDirectory}]
+    //verbose=true
+    //debug=true
+    //tolerance=10
+    //scriptBaseClass=&quot;&quot;
+    //recompileGroovySource=true
+    //minimumRecompilationInterval=100
+    //disabledGlobalASTTransformations=[]
+}
+
+environments {
+    GROOVY {
+        configuration {
+            classpath = \
[URLDecoder.decode(ScriptedConnectorBase.class.getResource(&quot;/groovy/&quot;).file, \
&quot;UTF-8&quot;)] +            scriptExtensions = ['groovy', 'java'] as String[]
+        }
+    }
+    CREST {
+        configuration {
+            classpath = \
[URLDecoder.decode(ScriptedConnectorBase.class.getResource(&quot;/crest/&quot;).file, \
&quot;UTF-8&quot;)] +            serviceAddress = new \
URI(&quot;http://localhost:8080/crest/&quot;) +            login = &quot;admin&quot;
+            password = new GuardedString(&quot;Passw0rd&quot;.toCharArray())
+        }
+    }
+    REST {
+        configuration {
+            classpath = \
[URLDecoder.decode(ScriptedConnectorBase.class.getResource(&quot;/rest/&quot;).file, \
&quot;UTF-8&quot;)] +            serviceAddress = new \
URI(&quot;http://localhost:8080/rest/&quot;) +            username = \
&quot;admin&quot; +            password = new \
GuardedString(&quot;Passw0rd&quot;.toCharArray()) +        }
+    }
+    SQL {
+        configuration {
+            classpath = \
[URLDecoder.decode(ScriptedConnectorBase.class.getResource(&quot;/sql/&quot;).file, \
&quot;UTF-8&quot;)] +            driverClassName = &quot;org.h2.Driver&quot;
+            validationQuery = &quot;select 1&quot;
+            url = &quot;jdbc:h2:mem:test;DB_CLOSE_DELAY=-1&quot;
+            username = &quot;sa&quot;
+            password = &quot;sa&quot;
+        }
+    }
+}
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestjavaorgforgerockopenicfconnectorsRESTTestBasejava"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/RESTTestBase.java \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/RESTTestBase.java	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/RESTTestBase.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,177 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+package org.forgerock.openicf.connectors;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+import org.eclipse.jetty.security.ConstraintMapping;
+import org.eclipse.jetty.security.ConstraintSecurityHandler;
+import org.eclipse.jetty.security.MappedLoginService;
+import org.eclipse.jetty.security.SecurityHandler;
+import org.eclipse.jetty.security.authentication.BasicAuthenticator;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.UserIdentity;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.util.security.Constraint;
+import org.eclipse.jetty.util.security.Credential;
+import org.forgerock.json.resource.servlet.HttpServlet;
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase;
+import org.identityconnectors.common.logging.Log;
+import org.identityconnectors.framework.api.APIConfiguration;
+import org.identityconnectors.framework.api.ConnectorFacade;
+import org.identityconnectors.framework.api.ConnectorFacadeFactory;
+import org.identityconnectors.framework.spi.Connector;
+import org.identityconnectors.test.common.PropertyBag;
+import org.identityconnectors.test.common.TestHelpers;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeSuite;
+
+/**
+ * @author Laszlo Hordos
+ */
+public abstract class RESTTestBase {
+
+    /**
+     * Setup logging for the {@link RESTTestBase}.
+     */
+    private static final Log logger = Log.getLog(RESTTestBase.class);
+
+    private ConnectorFacade facade = null;
+    private Server server = null;
+
+    private SecurityHandler getSecurityHandler() throws IOException {
+        Constraint constraint = new Constraint(Constraint.__BASIC_AUTH, \
&quot;user&quot;); +        constraint.setAuthenticate(true);
+
+        ConstraintMapping cm = new ConstraintMapping();
+        cm.setPathSpec(&quot;/*&quot;);
+        cm.setConstraint(constraint);
+
+        ConstraintSecurityHandler sh = new ConstraintSecurityHandler();
+        sh.setAuthenticator(new BasicAuthenticator());
+        sh.setConstraintMappings(Arrays.asList(new ConstraintMapping[]{cm}));
+
+        MappedLoginService loginService = new MappedLoginService() {
+
+            @Override
+            protected UserIdentity loadUser(String username) {
+                return null;
+            }
+
+            @Override
+            protected void loadUsers() throws IOException {
+                Credential credential = \
Credential.getCredential(&quot;Passw0rd&quot;); +                String[] roles = new \
String[]{&quot;user&quot;}; +                putUser(&quot;admin&quot;, credential, \
roles); +
+            }
+        };
+        loginService.setName(&quot;user&quot;);
+        sh.setLoginService(loginService);
+        sh.setConstraintMappings(Arrays.asList(new ConstraintMapping[]{cm}));
+
+        return sh;
+    }
+
+    @BeforeSuite
+    public void startServer() throws Exception {
+        System.out.append(&quot;Test port: \
&quot;).println(System.getProperty(&quot;jetty.http.port&quot;)); +        // Create \
a basic jetty server object that will listen on port 8080. +        // you can \
programmatically obtain it for use in test cases. +        server = new Server(8080);
+
+        // Initializing the security handler
+        ServletContextHandler handler =
+                new ServletContextHandler(server, &quot;/&quot;, \
ServletContextHandler.SESSIONS +                        | \
ServletContextHandler.SECURITY); +
+        // ADD SERVLET
+        // /rest/users/*
+        ServletHolder holder = handler.addServlet(HttpServlet.class, \
&quot;/rest/users/*&quot;); +        \
holder.setInitParameter(&quot;connection-factory-class&quot;, +                \
&quot;org.forgerock.json.resource.servlet.MemoryBackendConnectionFactoryProvider&quot;);
 +        holder.setInitParameter(&quot;uri-template&quot;, &quot;&quot;);
+
+        // /rest/groups/*
+        holder = handler.addServlet(HttpServlet.class, &quot;/rest/groups/*&quot;);
+        holder.setInitParameter(&quot;connection-factory-class&quot;,
+                &quot;org.forgerock.json.resource.servlet.MemoryBackendConnectionFactoryProvider&quot;);
 +        holder.setInitParameter(&quot;uri-template&quot;, &quot;&quot;);
+
+        // /crest/users/*
+        holder = handler.addServlet(HttpServlet.class, &quot;/crest/users/*&quot;);
+        holder.setInitParameter(&quot;connection-factory-class&quot;,
+                &quot;org.forgerock.json.resource.servlet.MemoryBackendConnectionFactoryProvider&quot;);
 +        holder.setInitParameter(&quot;uri-template&quot;, &quot;&quot;);
+
+        // /crest/groups/*
+        holder = handler.addServlet(HttpServlet.class, &quot;/crest/groups/*&quot;);
+        holder.setInitParameter(&quot;connection-factory-class&quot;,
+                &quot;org.forgerock.json.resource.servlet.MemoryBackendConnectionFactoryProvider&quot;);
 +        holder.setInitParameter(&quot;uri-template&quot;, &quot;&quot;);
+
+        // SECURITY HANDLER
+        SecurityHandler sh = getSecurityHandler();
+        sh.setHandler(handler);
+
+        server.setHandler(sh);
+        server.start();
+        logger.info(&quot;Jetty Server Started&quot;);
+    }
+
+    @AfterSuite
+    public void stopServer() throws Exception {
+        server.stop();
+        logger.info(&quot;Jetty Server Stopped&quot;);
+    }
+
+
+    protected abstract ConnectorFacade getFacade();
+
+    protected ConnectorFacade getFacade(Class&lt;? extends Connector&gt; clazz, \
String environment) { +        if (null == facade) {
+            facade = createConnectorFacade(clazz, environment);
+        }
+        return facade;
+    }
+
+    public static ConnectorFacade createConnectorFacade(Class&lt;? extends \
Connector&gt; clazz, +                                                        String \
environment) { +        PropertyBag propertyBag =
+                TestHelpers.getProperties(ScriptedConnectorBase.class, environment);
+
+        APIConfiguration impl =
+                TestHelpers.createTestConfiguration(clazz, propertyBag, \
&quot;configuration&quot;); +        impl.setProducerBufferSize(0);
+        impl.getResultsHandlerConfiguration().setEnableAttributesToGetSearchResultsHandler(false);
 +        impl.getResultsHandlerConfiguration().setEnableCaseInsensitiveFilter(false);
 +        impl.getResultsHandlerConfiguration().setEnableFilteredResultsHandler(false);
 +        impl.getResultsHandlerConfiguration().setEnableNormalizingResultsHandler(false);
 +
+        return ConnectorFacadeFactory.getInstance().newInstance(impl);
+    }
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestjavaorgforgerockopenicfconnectorsScriptedCRESTConnectorTestjava"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/ScriptedCRESTConnectorTest.java \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/ScriptedCRESTConnectorTest.java	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/ScriptedCRESTConnectorTest.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+package org.forgerock.openicf.connectors;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.forgerock.openicf.connectors.scriptedcrest.ScriptedCRESTConnector;
+import org.identityconnectors.framework.api.ConnectorFacade;
+import org.identityconnectors.framework.common.objects.Attribute;
+import org.identityconnectors.framework.common.objects.AttributeBuilder;
+import org.identityconnectors.framework.common.objects.ObjectClass;
+import org.identityconnectors.framework.common.objects.Uid;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * A NAME does ...
+ *
+ * @author Laszlo Hordos
+ */
+public class ScriptedCRESTConnectorTest extends RESTTestBase {
+
+    protected static final String TEST_NAME = &quot;CREST&quot;;
+
+    protected ConnectorFacade getFacade() {
+        return getFacade(ScriptedCRESTConnector.class, TEST_NAME);
+    }
+
+    @Test
+    public void test() throws Exception {
+        final ConnectorFacade facade = getFacade();
+        facade.test();
+    }
+
+    @Test
+    public void testCreate() throws Exception {
+        final ConnectorFacade facade = getFacade();
+        Set&lt;Attribute&gt; createAttributes = new HashSet&lt;Attribute&gt;();
+        createAttributes.add(AttributeBuilder.build(&quot;userName&quot;, \
&quot;doe&quot;)); +        \
createAttributes.add(AttributeBuilder.buildCurrentPassword(&quot;Passw0rd&quot;.toCharArray()));
 +
+        createAttributes.add(AttributeBuilder.build(&quot;givenName&quot;, \
&quot;John&quot;)); +        \
createAttributes.add(AttributeBuilder.build(&quot;sn&quot;, &quot;Doe&quot;)); +      \
createAttributes.add(AttributeBuilder.build(&quot;mail&quot;, \
&quot;jdoe@example.com&quot;)); +        \
createAttributes.add(AttributeBuilder.build(&quot;telephoneNumber&quot;, \
&quot;1-555-555-1212&quot;)); +
+        createAttributes.add(AttributeBuilder.buildEnabled(true));
+
+        Uid uid1 = facade.create(ObjectClass.ACCOUNT, createAttributes, null);
+
+        Assert.assertEquals(uid1.getUidValue(), &quot;0&quot;);
+    }
+
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestjavaorgforgerockopenicfconnectorsScriptedRESTConnectorTestjava"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/ScriptedRESTConnectorTest.java \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/ScriptedRESTConnectorTest.java	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/ScriptedRESTConnectorTest.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+package org.forgerock.openicf.connectors;
+
+import java.net.URI;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.forgerock.openicf.connectors.scriptedrest.ScriptedRESTConnector;
+import org.identityconnectors.framework.api.ConnectorFacade;
+import org.identityconnectors.framework.common.objects.Attribute;
+import org.identityconnectors.framework.common.objects.AttributeBuilder;
+import org.identityconnectors.framework.common.objects.Name;
+import org.identityconnectors.framework.common.objects.ObjectClass;
+import org.identityconnectors.framework.common.objects.Uid;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * A NAME does ...
+ *
+ * @author Laszlo Hordos
+ */
+public class ScriptedRESTConnectorTest extends RESTTestBase {
+
+    protected static final String TEST_NAME = &quot;REST&quot;;
+
+    protected ConnectorFacade getFacade() {
+        return getFacade(ScriptedRESTConnector.class, TEST_NAME);
+    }
+
+    @Test
+    public void testURI() throws Exception {
+        URI host = new URI(&quot;http://localhost:8080/openidm&quot;);
+        host.getAuthority();
+    }
+
+    @Test
+    public void test() throws Exception {
+        final ConnectorFacade facade = getFacade();
+        facade.test();
+    }
+
+    @Test(enabled = false)
+    public void testCreate() throws Exception {
+        final ConnectorFacade facade = getFacade();
+        Set&lt;Attribute&gt; createAttributes = new HashSet&lt;Attribute&gt;();
+        createAttributes.add(new Name(&quot;foo&quot;));
+        createAttributes.add(AttributeBuilder.buildCurrentPassword(&quot;Passw0rd&quot;.toCharArray()));
 +        createAttributes.add(AttributeBuilder.buildEnabled(true));
+
+        Uid uid1 = facade.create(ObjectClass.ACCOUNT, createAttributes, null);
+
+        Assert.assertEquals(uid1.getUidValue(), &quot;foo&quot;);
+    }
+
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestjavaorgforgerockopenicfconnectorsScriptedSQLConnectorTestjava"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/ScriptedSQLConnectorTest.java \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/ScriptedSQLConnectorTest.java	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/connectors/ScriptedSQLConnectorTest.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,129 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+package org.forgerock.openicf.connectors;
+
+import java.io.InputStream;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.apache.commons.io.IOUtils;
+import org.forgerock.openicf.connectors.scriptedsql.ScriptedSQLConnector;
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase;
+import org.identityconnectors.common.logging.Log;
+import org.identityconnectors.framework.api.ConnectorFacade;
+import org.identityconnectors.test.common.PropertyBag;
+import org.identityconnectors.test.common.TestHelpers;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import static org.forgerock.openicf.connectors.RESTTestBase.createConnectorFacade;
+
+/**
+ * A NAME does ...
+ *
+ * @author Laszlo Hordos
+ */
+public class ScriptedSQLConnectorTest {
+
+    /**
+     * Setup logging for the {@link ScriptedSQLConnectorTest}.
+     */
+    private static final Log logger = Log.getLog(ScriptedSQLConnectorTest.class);
+
+    protected static final String TEST_NAME = &quot;SQL&quot;;
+
+    private ConnectorFacade facadeInstance;
+
+    @BeforeClass
+    public void startServer() throws Exception {
+        Connection con = getConnection();
+        Statement stmt = con.createStatement();
+        try {
+            InputStream in = \
ScriptedSQLConnectorTest.class.getResourceAsStream(&quot;/sql/testDatabase.ddl&quot;);
 +            Assert.assertNotNull(in);
+            stmt.execute(IOUtils.toString(in));
+        } finally {
+            stmt.close();
+            con.close();
+        }
+    }
+
+    @AfterClass
+    public void stopServer() throws Exception {
+        Connection con = getConnection();
+        Statement stmt = con.createStatement();
+        try {
+            stmt.execute(&quot;SHUTDOWN&quot;);
+        } finally {
+            stmt.close();
+            con.close();
+        }
+    }
+
+    @Test
+    public void testTest() throws Exception {
+        final ConnectorFacade facade = getFacade(TEST_NAME);
+        facade.test();
+    }
+
+    private Connection getConnection() throws ClassNotFoundException, SQLException {
+        PropertyBag propertyBag = \
TestHelpers.getProperties(ScriptedConnectorBase.class, TEST_NAME); +
+        String jdbcUrl = \
propertyBag.getStringProperty(&quot;configuration.url&quot;); +        \
Assert.assertNotNull(jdbcUrl); +
+        Class.forName(&quot;org.h2.Driver&quot;);
+        return DriverManager.getConnection(jdbcUrl, &quot;sa&quot;, &quot;sa&quot;);
+    }
+
+    protected ConnectorFacade getFacade(String environment) {
+        if (null == facadeInstance) {
+            facadeInstance = createConnectorFacade(ScriptedSQLConnector.class, \
environment); +        }
+        return facadeInstance;
+    }
+
+    @Test
+    public void sampleTest() throws Exception {
+        Connection con = getConnection();
+        Statement stmt = con.createStatement();
+        try {
+            ResultSet rs = stmt.executeQuery(&quot;SELECT id, UID FROM Users&quot;);
+            while (rs.next()) {
+                String name = rs.getString(&quot;uid&quot;);
+                System.out.println(name);
+            }
+        } finally {
+            stmt.close();
+            con.close();
+        }
+    }
+
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestjavaorgforgerockopenicfmiscscriptedcommonScriptedConnectorTestjava"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/misc/scriptedcommon/ScriptedConnectorTest.java \
(6508 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/misc/scriptedcommon/ScriptedConnectorTest.java	2014-04-14 \
                21:18:24 UTC (rev 6508)
+++ trunk/connectors/java/scriptedcommon/src/test/java/org/forgerock/openicf/misc/scriptedcommon/ScriptedConnectorTest.java	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -30,31 +30,45 @@
</span><span class="cx"> import java.util.MissingResourceException;
</span><span class="cx"> import java.util.Set;
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx"> import \
org.forgerock.openicf.connectors.groovy.ScriptedConnector; </span><span class="cx"> \
import org.identityconnectors.common.logging.Log; </span><span class="cx"> import \
org.identityconnectors.common.security.GuardedString; </span><del>-import \
org.identityconnectors.framework.api.APIConfiguration; </del><span class="cx"> import \
org.identityconnectors.framework.api.ConnectorFacade; </span><del>-import \
org.identityconnectors.framework.api.ConnectorFacadeFactory; </del><ins>+import \
org.identityconnectors.framework.common.exceptions.AlreadyExistsException; \
</ins><span class="cx"> import \
org.identityconnectors.framework.common.exceptions.ConnectorSecurityException; \
</span><span class="cx"> import \
org.identityconnectors.framework.common.exceptions.InvalidAttributeValueException; \
</span><ins>+import org.identityconnectors.framework.common.exceptions.InvalidCredentialException;
 +import org.identityconnectors.framework.common.exceptions.InvalidPasswordException;
+import org.identityconnectors.framework.common.exceptions.PermissionDeniedException;
+import org.identityconnectors.framework.common.exceptions.PreconditionFailedException;
 +import org.identityconnectors.framework.common.exceptions.PreconditionRequiredException;
 +import org.identityconnectors.framework.common.exceptions.RetryableException;
</ins><span class="cx"> import \
org.identityconnectors.framework.common.exceptions.UnknownUidException; </span><span \
class="cx"> import org.identityconnectors.framework.common.objects.Attribute; \
</span><span class="cx"> import \
org.identityconnectors.framework.common.objects.AttributeBuilder; </span><ins>+import \
org.identityconnectors.framework.common.objects.AttributeUtil; </ins><span \
class="cx"> import org.identityconnectors.framework.common.objects.ConnectorObject; \
</span><span class="cx"> import org.identityconnectors.framework.common.objects.Name; \
</span><span class="cx"> import \
org.identityconnectors.framework.common.objects.ObjectClass; </span><ins>+import \
org.identityconnectors.framework.common.objects.OperationOptionsBuilder; +import \
org.identityconnectors.framework.common.objects.ResultsHandler; </ins><span \
class="cx"> import org.identityconnectors.framework.common.objects.Schema; \
</span><span class="cx"> import \
org.identityconnectors.framework.common.objects.ScriptContextBuilder; \
</span><ins>+import org.identityconnectors.framework.common.objects.SearchResult; \
+import org.identityconnectors.framework.common.objects.SortKey; </ins><span \
class="cx"> import org.identityconnectors.framework.common.objects.SyncDelta; \
</span><ins>+import org.identityconnectors.framework.common.objects.SyncDeltaType; \
</ins><span class="cx"> import \
org.identityconnectors.framework.common.objects.SyncResultsHandler; </span><span \
class="cx"> import org.identityconnectors.framework.common.objects.SyncToken; \
</span><span class="cx"> import org.identityconnectors.framework.common.objects.Uid; \
</span><del>-import org.identityconnectors.test.common.PropertyBag; \
</del><ins>+import org.identityconnectors.framework.common.objects.filter.FilterBuilder;
 </ins><span class="cx"> import org.identityconnectors.test.common.TestHelpers;
</span><span class="cx"> import org.testng.Assert;
</span><span class="cx"> import org.testng.annotations.Test;
</span><span class="cx"> 
</span><ins>+import static \
org.forgerock.openicf.connectors.RESTTestBase.createConnectorFacade; +
</ins><span class="cx"> public class ScriptedConnectorTest {
</span><span class="cx"> 
</span><span class="cx">     /**
</span><span class="lines">@@ -62,69 +76,160 @@
</span><span class="cx">      */
</span><span class="cx">     private static final Log logger = \
Log.getLog(ScriptedConnectorTest.class); </span><span class="cx"> 
</span><del>-    protected static final String testCase = &quot;case1&quot;;
</del><ins>+    protected static final String TEST_NAME = &quot;GROOVY&quot;;
+    private static final ObjectClass TEST = new ObjectClass(&quot;__TEST__&quot;);
+    private static final ObjectClass SAMPLE = new \
ObjectClass(&quot;__SAMPLE__&quot;); </ins><span class="cx"> 
</span><span class="cx">     private ConnectorFacade facade;
</span><span class="cx"> 
</span><ins>+    // =======================================================================
 +    // Authenticate Operation Test
+    // =======================================================================
+
</ins><span class="cx">     @Test(expectedExceptions = \
ConnectorSecurityException.class) </span><span class="cx">     public void \
testAuthenticate1() throws Exception { </span><del>-        \
                getFacade(testCase).authenticate(ObjectClass.ACCOUNT, \
                &quot;TEST1&quot;,
-                new GuardedString(&quot;&quot;.toCharArray()), null);
</del><ins>+        getFacade(TEST_NAME).authenticate(TEST, &quot;TEST1&quot;,
+                new GuardedString(&quot;Passw0rd&quot;.toCharArray()), null);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    @Test(expectedExceptions = InvalidCredentialException.class)
+    public void testAuthenticate2() throws Exception {
+        getFacade(TEST_NAME).authenticate(TEST, &quot;TEST2&quot;,
+                new GuardedString(&quot;Passw0rd&quot;.toCharArray()), null);
+    }
+
+    @Test(expectedExceptions = InvalidPasswordException.class)
+    public void testAuthenticate3() throws Exception {
+        getFacade(TEST_NAME).authenticate(TEST, &quot;TEST3&quot;,
+                new GuardedString(&quot;Passw0rd&quot;.toCharArray()), null);
+    }
+
+    @Test(expectedExceptions = PermissionDeniedException.class)
+    public void testAuthenticate4() throws Exception {
+        getFacade(TEST_NAME).authenticate(TEST, &quot;TEST4&quot;,
+                new GuardedString(&quot;Passw0rd&quot;.toCharArray()), null);
+    }
+
</ins><span class="cx">     @Test
</span><span class="cx">     public void testAuthenticate5() throws Exception {
</span><del>-        \
Assert.assertNotNull(getFacade(testCase).authenticate(ObjectClass.ACCOUNT, \
                &quot;TEST5&quot;,
-                new GuardedString(&quot;Passw0rd&quot;.toCharArray()), null));
</del><ins>+        Assert.assertEquals(getFacade(TEST_NAME).authenticate(TEST, \
&quot;TEST5&quot;, +                new \
GuardedString(&quot;Passw0rd&quot;.toCharArray()), null).getUidValue(), \
&quot;TEST5&quot;); </ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    @Test
</del><ins>+    @Test(expectedExceptions = UnknownUidException.class)
</ins><span class="cx">     public void testAuthenticate6() throws Exception {
</span><del>-        \
Assert.assertNotNull(getFacade(testCase).authenticate(ObjectClass.ACCOUNT, \
                &quot;TEST6&quot;,
-                new GuardedString(&quot;Passw0rd&quot;.toCharArray()), null));
</del><ins>+        getFacade(TEST_NAME).authenticate(TEST, &quot;TEST6&quot;,
+                new GuardedString(&quot;Passw0rd&quot;.toCharArray()), null);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // =======================================================================
 +    // Create Operation Test
+    // =======================================================================
+
</ins><span class="cx">     @Test
</span><span class="cx">     public void testCreate() throws Exception {
</span><del>-        Set&lt;Attribute&gt; createAttributes = new \
                HashSet&lt;Attribute&gt;(1);
-        createAttributes.add(new Name(&quot;1&quot;));
-        createAttributes.add(AttributeBuilder.build(&quot;email&quot;, \
                &quot;mail@example.com&quot;));
-        ConnectorFacade facade = getFacade(testCase);
</del><ins>+        Set&lt;Attribute&gt; createAttributes = \
getTestConnectorObject(&quot;Foo&quot;); +        ConnectorFacade facade = \
getFacade(TEST_NAME); </ins><span class="cx">         Uid uid = \
facade.create(ObjectClass.ACCOUNT, createAttributes, null); </span><span class="cx">  \
Assert.assertNotNull(uid); </span><span class="cx">         ConnectorObject co = \
facade.getObject(ObjectClass.ACCOUNT, uid, null); </span><span class="cx">         \
Assert.assertEquals(co.getUid(), uid); </span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    @Test(expectedExceptions = AlreadyExistsException.class)
+    public void testCreateTest1() throws Exception {
+        Set&lt;Attribute&gt; createAttributes = \
getTestConnectorObject(&quot;TEST1&quot;); +        ConnectorFacade facade = \
getFacade(TEST_NAME); +        facade.create(TEST, createAttributes, null);
+    }
+
+    @Test(expectedExceptions = InvalidAttributeValueException.class)
+    public void testCreateTest2() throws Exception {
+        Set&lt;Attribute&gt; createAttributes = \
getTestConnectorObject(&quot;TEST2&quot;); +        ConnectorFacade facade = \
getFacade(TEST_NAME); +        facade.create(TEST, createAttributes, null);
+    }
+
+    @Test(expectedExceptions = IllegalArgumentException.class)
+    public void testCreateTest3() throws Exception {
+        Set&lt;Attribute&gt; createAttributes = \
getTestConnectorObject(&quot;TEST3&quot;); +        ConnectorFacade facade = \
getFacade(TEST_NAME); +        facade.create(TEST, createAttributes, null);
+    }
+
+    @Test(expectedExceptions = RetryableException.class)
+    public void testCreateTest4() throws Exception {
+        Set&lt;Attribute&gt; createAttributes = \
getTestConnectorObject(&quot;TEST4&quot;); +        ConnectorFacade facade = \
getFacade(TEST_NAME); +        facade.create(TEST, createAttributes, null);
+    }
+
+    @Test
+    public void testCreateTest5() throws Exception {
+        Set&lt;Attribute&gt; createAttributes = \
getTestConnectorObject(&quot;TEST5&quot;); +        ConnectorFacade facade = \
getFacade(TEST_NAME); +        Uid uid = facade.create(TEST, createAttributes, null);
+        Assert.assertEquals(uid.getUidValue(), &quot;TEST5&quot;);
+    }
+
+    // =======================================================================
+    // Delete Operation Test
+    // =======================================================================
+
</ins><span class="cx">     @Test(expectedExceptions = UnknownUidException.class)
</span><del>-    public void testDelete() throws Exception {
-        ConnectorFacade facade = getFacade(testCase);
-        facade.delete(ObjectClass.ACCOUNT, new Uid(&quot;NON_EXIST&quot;), null);
</del><ins>+    public void testDelete1() throws Exception {
+        ConnectorFacade facade = getFacade(TEST_NAME);
+        facade.delete(TEST, new Uid(&quot;TEST1&quot;), null);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+
+    @Test(expectedExceptions = PreconditionFailedException.class)
+    public void testDelete4() throws Exception {
+        ConnectorFacade facade = getFacade(TEST_NAME);
+        facade.delete(TEST, new Uid(&quot;TEST4&quot;), null);
+    }
+
+    @Test(expectedExceptions = PreconditionRequiredException.class)
+    public void testDelete5() throws Exception {
+        ConnectorFacade facade = getFacade(TEST_NAME);
+        facade.delete(TEST, new Uid(&quot;TEST5&quot;), null);
+    }
+
+    // =======================================================================
+    // ResolveUsername Operation Test
+    // =======================================================================
+
</ins><span class="cx">     @Test
</span><span class="cx">     public void testResolveUsername() throws Exception {
</span><del>-        ConnectorFacade facade = getFacade(testCase);
</del><ins>+        ConnectorFacade facade = getFacade(TEST_NAME);
</ins><span class="cx">         Uid uidAfter = \
facade.resolveUsername(ObjectClass.ACCOUNT, &quot;TEST1&quot;, null); </span><span \
class="cx">         Assert.assertEquals(uidAfter.getUidValue(), &quot;123&quot;); \
</span><span class="cx">     } </span><span class="cx"> 
</span><span class="cx">     @Test(expectedExceptions = UnknownUidException.class)
</span><span class="cx">     public void testResolveUsername1() throws Exception {
</span><del>-        ConnectorFacade facade = getFacade(testCase);
</del><ins>+        ConnectorFacade facade = getFacade(TEST_NAME);
</ins><span class="cx">         facade.resolveUsername(ObjectClass.ACCOUNT, \
&quot;NON_EXIST&quot;, null); </span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // =======================================================================
 +    // Schema Operation Test
+    // =======================================================================
+
</ins><span class="cx">     @Test
</span><span class="cx">     public void testSchema() throws Exception {
</span><del>-        ConnectorFacade facade = getFacade(testCase);
</del><ins>+        ConnectorFacade facade = getFacade(TEST_NAME);
</ins><span class="cx">         Schema schema = facade.schema();
</span><span class="cx">         \
Assert.assertNotNull(schema.findObjectClassInfo(&quot;__TEST__&quot;)); </span><span \
class="cx">     } </span><span class="cx"> 
</span><ins>+    // =======================================================================
 +    // ScriptOnConnector Operation Test
+    // =======================================================================
+
</ins><span class="cx">     @Test
</span><span class="cx">     public void testScriptOnConnector() throws Exception {
</span><del>-        ConnectorFacade facade = getFacade(testCase);
</del><ins>+        ConnectorFacade facade = getFacade(TEST_NAME);
</ins><span class="cx">         ScriptContextBuilder builder = new \
ScriptContextBuilder(); </span><span class="cx">         \
builder.setScriptLanguage(&quot;Groovy&quot;); </span><span class="cx">         \
builder.setScriptText(&quot;return uid&quot;); </span><span class="lines">@@ -133,9 \
+238,13 @@ </span><span class="cx">         \
Assert.assertEquals(facade.runScriptOnConnector(builder.build(), null), uid); \
</span><span class="cx">     } </span><span class="cx"> 
</span><ins>+    // =======================================================================
 +    // ScriptOnResource Operation Test
+    // =======================================================================
+
</ins><span class="cx">     @Test
</span><span class="cx">     public void testScriptOnResource() throws Exception {
</span><del>-        ConnectorFacade facade = getFacade(testCase);
</del><ins>+        ConnectorFacade facade = getFacade(TEST_NAME);
</ins><span class="cx">         ScriptContextBuilder builder = new \
ScriptContextBuilder(); </span><span class="cx">         \
builder.setScriptLanguage(&quot;SHELL&quot;); </span><span class="cx">         \
builder.setScriptText(&quot;test&quot;); </span><span class="lines">@@ -144,48 \
+253,241 @@ </span><span class="cx"> 
</span><span class="cx">     @Test(expectedExceptions = \
InvalidAttributeValueException.class) </span><span class="cx">     public void \
testScriptOnResourceFail() throws Exception { </span><del>-        ConnectorFacade \
facade = getFacade(testCase); </del><ins>+        ConnectorFacade facade = \
getFacade(TEST_NAME); </ins><span class="cx">         ScriptContextBuilder builder = \
new ScriptContextBuilder(); </span><span class="cx">         \
builder.setScriptLanguage(&quot;BASH&quot;); </span><span class="cx">         \
builder.setScriptText(&quot;test&quot;); </span><span class="cx">         \
Assert.assertEquals(facade.runScriptOnResource(builder.build(), null), true); \
</span><span class="cx">     } </span><span class="cx"> 
</span><ins>+    // =======================================================================
 +    // Search Operation Test
+    // =======================================================================
+
</ins><span class="cx">     @Test
</span><span class="cx">     public void testSearch() throws Exception {
</span><del>-        ConnectorObject co = \
getFacade(testCase).getObject(ObjectClass.GROUP, new Uid(&quot;1&quot;), null); \
</del><ins>+        ConnectorObject co = getFacade(TEST_NAME).getObject(SAMPLE, new \
Uid(&quot;1&quot;), null); </ins><span class="cx">         Assert.assertNotNull(co);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     @Test
</span><span class="cx">     public void testSearch1() throws Exception {
</span><del>-        ConnectorFacade search = getFacade(testCase);
</del><ins>+        ConnectorFacade search = getFacade(TEST_NAME);
</ins><span class="cx">         List&lt;ConnectorObject&gt; result =
</span><span class="cx">                 TestHelpers.searchToList(search, new \
ObjectClass(&quot;__EMPTY__&quot;), null); </span><span class="cx">         \
Assert.assertTrue(result.isEmpty()); </span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     @Test
</span><ins>+    public void testSearch2() throws Exception {
+        ConnectorFacade search = getFacade(TEST_NAME);
+        for (int i = 0; i &lt; 100; i++) {
+            Set&lt;Attribute&gt; co = \
getTestConnectorObject(String.format(&quot;TEST%05d&quot;, i)); +            \
co.add(AttributeBuilder.build(&quot;sortKey&quot;, i)); +            \
search.create(ObjectClass.ACCOUNT, co, null); +        }
+
+
+        OperationOptionsBuilder builder = new OperationOptionsBuilder();
+        builder.setPageSize(10);
+        builder.setSortKeys(new SortKey(&quot;sortKey&quot;, false));
+        SearchResult result = null;
+
+        final Set&lt;ConnectorObject&gt; resultSet = new \
HashSet&lt;ConnectorObject&gt;(); +        int pageIndex = 0;
+
+        while ((result = search
+                .search(ObjectClass.ACCOUNT, \
FilterBuilder.startsWith(AttributeBuilder.build(Name.NAME, &quot;TEST&quot;)), +      \
new ResultsHandler() { +                            private int index = 101;
+
+                            public boolean handle(ConnectorObject connectorObject) {
+                                Integer idx = AttributeUtil.getIntegerValue(
+                                        \
connectorObject.getAttributeByName(&quot;sortKey&quot;)); +                           \
Assert.assertTrue(idx &lt; index); +                                index = idx;
+                                return resultSet.add(connectorObject);
+                            }
+                        }, builder.build()
+                )).getPagedResultsCookie() != null) {
+
+            builder = new OperationOptionsBuilder(builder.build());
+            builder.setPagedResultsCookie(result.getPagedResultsCookie());
+            Assert.assertEquals(resultSet.size(), 10 * ++pageIndex);
+        }
+        Assert.assertEquals(pageIndex, 9);
+        Assert.assertEquals(resultSet.size(), 100);
+    }
+
+    // =======================================================================
+    // Sync Operation Test
+    // =======================================================================
+
+    @Test
</ins><span class="cx">     public void testSync() throws Exception {
</span><del>-        ConnectorFacade sync = getFacade(testCase);
</del><ins>+        final ConnectorFacade facade = getFacade(TEST_NAME);
</ins><span class="cx">         final List&lt;SyncDelta&gt; result = new \
ArrayList&lt;SyncDelta&gt;(); </span><del>-        SyncToken lastToken = \
sync.sync(ObjectClass.ACCOUNT, null, new SyncResultsHandler() { </del><ins>+
+        SyncToken lastToken = facade.sync(ObjectClass.ACCOUNT, new SyncToken(0), new \
SyncResultsHandler() { </ins><span class="cx">             public boolean \
handle(SyncDelta delta) { </span><span class="cx">                 return \
result.add(delta); </span><span class="cx">             }
</span><span class="cx">         }, null);
</span><del>-        Assert.assertFalse(result.isEmpty());
</del><ins>+        Assert.assertEquals(lastToken.getValue(), 1);
+        Assert.assertEquals(result.size(), 1);
+        SyncDelta delta = result.remove(0);
+        Assert.assertEquals(delta.getDeltaType(), SyncDeltaType.CREATE);
+        Assert.assertEquals(delta.getObject().getAttributes().size(), 44);
+
+        lastToken = facade.sync(ObjectClass.ACCOUNT, lastToken, new \
SyncResultsHandler() { +            public boolean handle(SyncDelta delta) {
+                return result.add(delta);
+            }
+        }, null);
+        Assert.assertEquals(lastToken.getValue(), 2);
+        Assert.assertEquals(result.size(), 1);
+        delta = result.remove(0);
+        Assert.assertEquals(delta.getDeltaType(), SyncDeltaType.UPDATE);
+
+
+        lastToken = facade.sync(ObjectClass.ACCOUNT, lastToken, new \
SyncResultsHandler() { +            public boolean handle(SyncDelta delta) {
+                return result.add(delta);
+            }
+        }, null);
+        Assert.assertEquals(lastToken.getValue(), 3);
+        Assert.assertEquals(result.size(), 1);
+        delta = result.remove(0);
+        Assert.assertEquals(delta.getDeltaType(), SyncDeltaType.CREATE_OR_UPDATE);
+
+
+        lastToken = facade.sync(ObjectClass.ACCOUNT, lastToken, new \
SyncResultsHandler() { +            public boolean handle(SyncDelta delta) {
+                return result.add(delta);
+            }
+        }, null);
+        Assert.assertEquals(lastToken.getValue(), 4);
+        Assert.assertEquals(result.size(), 1);
+        delta = result.remove(0);
+        Assert.assertEquals(delta.getDeltaType(), SyncDeltaType.UPDATE);
+        Assert.assertEquals(delta.getPreviousUid().getUidValue(), &quot;001&quot;);
+
+
+        lastToken = facade.sync(ObjectClass.ACCOUNT, lastToken, new \
SyncResultsHandler() { +            public boolean handle(SyncDelta delta) {
+                return result.add(delta);
+            }
+        }, null);
+        Assert.assertEquals(lastToken.getValue(), 5);
+        Assert.assertEquals(result.size(), 1);
+        delta = result.remove(0);
+        Assert.assertEquals(delta.getDeltaType(), SyncDeltaType.DELETE);
+
+
+        lastToken = facade.sync(ObjectClass.ACCOUNT, lastToken, new \
SyncResultsHandler() { +            public boolean handle(SyncDelta delta) {
+                return result.add(delta);
+            }
+        }, null);
+        Assert.assertEquals(lastToken.getValue(), 10);
+        Assert.assertTrue(result.isEmpty());
+
+
+        lastToken = facade.sync(ObjectClass.ACCOUNT, lastToken, new \
SyncResultsHandler() { +            public boolean handle(SyncDelta delta) {
+                return result.add(delta);
+            }
+        }, null);
+        Assert.assertEquals(lastToken.getValue(), 17);
+        Assert.assertEquals(result.size(), 4);
+        result.clear();
+
+        lastToken = facade.sync(ObjectClass.GROUP, new SyncToken(10), new \
SyncResultsHandler() { +            public boolean handle(SyncDelta delta) {
+                return result.add(delta);
+            }
+        }, null);
+        Assert.assertEquals(lastToken.getValue(), 16);
+        Assert.assertEquals(result.size(), 3);
+
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    @Test
+    public void testSyncAll() throws Exception {
+        final ConnectorFacade facade = getFacade(TEST_NAME);
+        final List&lt;SyncDelta&gt; result = new ArrayList&lt;SyncDelta&gt;();
+
+        SyncToken lastToken = facade.sync(ObjectClass.ALL, new SyncToken(0), new \
SyncResultsHandler() { +            public boolean handle(SyncDelta delta) {
+                return result.add(delta);
+            }
+        }, null);
+        Assert.assertEquals(lastToken.getValue(), 17);
+        Assert.assertEquals(result.size(), 7);
+        int index = 10;
+        for (SyncDelta delta : result) {
+            Assert.assertEquals(index++, delta.getToken().getValue());
+            if (((int) delta.getToken().getValue()) % 2 == 0) {
+                Assert.assertEquals(delta.getObject().getObjectClass(), \
ObjectClass.ACCOUNT); +            } else {
+                Assert.assertEquals(delta.getObject().getObjectClass(), \
ObjectClass.GROUP); +            }
+        }
+    }
+
+    @Test
+    public void testSyncSample() throws Exception {
+        final ConnectorFacade facade = getFacade(TEST_NAME);
+        final List&lt;SyncDelta&gt; result = new ArrayList&lt;SyncDelta&gt;();
+
+        SyncToken lastToken = facade.sync(SAMPLE, new SyncToken(0), new \
SyncResultsHandler() { +            public boolean handle(SyncDelta delta) {
+                return result.add(delta);
+            }
+        }, null);
+        Assert.assertEquals(lastToken.getValue(), &quot;SAMPLE&quot;);
+        Assert.assertEquals(result.size(), 2);
+    }
+
+    @Test
+    public void testSyncToken() throws Exception {
+        final ConnectorFacade facade = getFacade(TEST_NAME);
+
+        SyncToken lastToken = facade.getLatestSyncToken(ObjectClass.ACCOUNT);
+        Assert.assertEquals(lastToken.getValue(), 17);
+        lastToken = facade.getLatestSyncToken(ObjectClass.GROUP);
+        Assert.assertEquals(lastToken.getValue(), 16);
+        lastToken = facade.getLatestSyncToken(ObjectClass.ALL);
+        Assert.assertEquals(lastToken.getValue(), 17);
+        lastToken = facade.getLatestSyncToken(TEST);
+        Assert.assertEquals(lastToken.getValue(), 0);
+        lastToken = facade.getLatestSyncToken(SAMPLE);
+        Assert.assertEquals(lastToken.getValue(), &quot;ANY OBJECT&quot;);
+    }
+
+    // =======================================================================
+    // Test Operation Test
+    // =======================================================================
+
</ins><span class="cx">     @Test(expectedExceptions = \
MissingResourceException.class) </span><span class="cx">     public void testTest() \
throws Exception { </span><del>-        ConnectorFacade facade = getFacade(testCase);
</del><ins>+        ConnectorFacade facade = getFacade(TEST_NAME);
</ins><span class="cx">         facade.test();
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // =======================================================================
 +    // Update Operation Test
+    // =======================================================================
+
+    @Test(expectedExceptions = UnknownUidException.class)
+    public void testDelete() throws Exception {
+        ConnectorFacade facade = getFacade(TEST_NAME);
+        facade.delete(ObjectClass.ACCOUNT, new Uid(&quot;NON_EXIST&quot;), null);
+    }
+
</ins><span class="cx">     @Test(dependsOnMethods = &quot;testCreate&quot;)
</span><span class="cx">     public void testUpdate() throws Exception {
</span><del>-        ConnectorFacade facade = getFacade(testCase);
</del><ins>+        ConnectorFacade facade = getFacade(TEST_NAME);
</ins><span class="cx">         Set&lt;Attribute&gt; updateAttributes = new \
HashSet&lt;Attribute&gt;(1); </span><span class="cx">         \
updateAttributes.add(AttributeBuilder.build(&quot;email&quot;, \
&quot;foo@example.com&quot;)); </span><span class="cx"> 
</span><span class="lines">@@ -193,23 +495,17 @@
</span><span class="cx">         Assert.assertEquals(uid.getUidValue(), \
&quot;2&quot;); </span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+
+    private Set&lt;Attribute&gt; getTestConnectorObject(String name) {
+        Set&lt;Attribute&gt; createAttributes = new HashSet&lt;Attribute&gt;(1);
+        createAttributes.add(new Name(name));
+        createAttributes.add(AttributeBuilder.build(&quot;email&quot;, name + \
&quot;@example.com&quot;)); +        return createAttributes;
+    }
+
</ins><span class="cx">     protected ConnectorFacade getFacade(String environment) {
</span><span class="cx">         if (null == facade) {
</span><del>-
-            PropertyBag propertyBag =
-                    TestHelpers.getProperties(ScriptedConnector.class, environment);
-
-            APIConfiguration impl =
-                    TestHelpers.createTestConfiguration(ScriptedConnector.class, \
                propertyBag,
-                            &quot;configuration&quot;);
-            impl.setProducerBufferSize(0);
-            impl.getResultsHandlerConfiguration().setEnableAttributesToGetSearchResultsHandler(
                
-                    false);
-            impl.getResultsHandlerConfiguration().setEnableCaseInsensitiveFilter(false);
                
-            impl.getResultsHandlerConfiguration().setEnableFilteredResultsHandler(false);
                
-            impl.getResultsHandlerConfiguration().setEnableNormalizingResultsHandler(false);
                
-
-            facade = ConnectorFacadeFactory.getInstance().newInstance(impl);
</del><ins>+            facade = createConnectorFacade(ScriptedConnector.class, \
environment); </ins><span class="cx">         }
</span><span class="cx">         return facade;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresources"></a>
<div class="propset"><h4>Property changes: \
trunk/connectors/java/scriptedcommon/src/test/resources</h4> <pre class="diff"><span>
</span></pre></div>
<a id="svnignore"></a>
<div class="addfile"><h4>Added: svn:ignore</h4></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcescrestAuthenticateScriptgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/AuthenticateScript.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/AuthenticateScript.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/crest/AuthenticateScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcescrestCreateScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/CreateScript.groovy (0 \
=> 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/CreateScript.groovy	    \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/crest/CreateScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,161 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+import org.forgerock.json.fluent.JsonValue
+import org.forgerock.json.resource.Connection
+import org.forgerock.json.resource.CreateRequest
+import org.forgerock.json.resource.QueryResult
+import org.forgerock.json.resource.Requests
+import org.forgerock.json.resource.Resource
+import org.forgerock.json.resource.RootContext
+import org.forgerock.openicf.connectors.scriptedcrest.ScriptedCRESTConfiguration
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+import org.identityconnectors.common.Base64
+import org.identityconnectors.common.logging.Log
+import org.identityconnectors.common.security.GuardedByteArray
+import org.identityconnectors.common.security.GuardedString
+import org.identityconnectors.common.security.SecurityUtil
+import org.identityconnectors.framework.common.exceptions.InvalidAttributeValueException
 +import org.identityconnectors.framework.common.objects.Attribute
+import org.identityconnectors.framework.common.objects.AttributeBuilder
+import org.identityconnectors.framework.common.objects.AttributeInfo
+import org.identityconnectors.framework.common.objects.AttributeUtil
+import org.identityconnectors.framework.common.objects.AttributesAccessor
+import org.identityconnectors.framework.common.objects.Name
+import org.identityconnectors.framework.common.objects.ObjectClass
+import org.identityconnectors.framework.common.objects.ObjectClassInfo
+import org.identityconnectors.framework.common.objects.OperationOptions
+import org.identityconnectors.framework.common.objects.OperationalAttributes
+import org.identityconnectors.framework.common.objects.Schema
+import org.identityconnectors.framework.common.objects.Uid
+import org.identityconnectors.framework.common.objects.filter.FilterBuilder
+
+def action = action as OperationType
+def createAttributes = attributes as Set&lt;Attribute&gt;
+def attributeAccessor = new AttributesAccessor(createAttributes);
+def configuration = configuration as ScriptedCRESTConfiguration
+def connection = connection as Connection
+def name = id as String
+def log = log as Log
+def objectClass = objectClass as ObjectClass
+def options = options as OperationOptions
+def schema = schema as Schema
+
+
+log.info(&quot;Entering &quot; + action + &quot; Script&quot;);
+
+ObjectClassInfo ocInfo = schema.findObjectClassInfo(objectClass.objectClassValue)
+if (null != ocInfo) {
+
+    def converter = { v -&gt;
+        if (v instanceof GuardedString) {
+            return SecurityUtil.decrypt(v as GuardedString);
+        } else if (v instanceof GuardedByteArray) {
+            return Base64.encode(SecurityUtil.decrypt(v as GuardedByteArray));
+        } else if (v instanceof byte[]) {
+            return Base64.encode(v as byte[]);
+        } else {
+            return v
+        }
+    }
+    def user = [:]
+    for (AttributeInfo attributeInfo : ocInfo.attributeInfo) {
+        if (attributeInfo.is(Name.NAME)){
+            continue
+        }
+        Attribute attribute = attributeAccessor.find(attributeInfo.name);
+        if (attributeInfo.required &amp;&amp; (null == attribute || null == \
attribute.value || attribute.value.size() == 0)) { +            throw new \
InvalidAttributeValueException(&quot;Missing required attribute:&quot; + \
attributeInfo.name); +        }
+        if (!attributeInfo.multiValued &amp;&amp; null != attribute &amp;&amp; \
attribute?.value?.size() &gt; 1) { +            throw new \
InvalidAttributeValueException(&quot;Non multivalued attribute has multiple \
values:&quot; + attributeInfo.name); +        }
+
+        def value = null;
+        if (null != attribute) {
+            if (attributeInfo.multiValued) {
+                value = attribute.value.each converter
+            } else {
+                value = converter attribute.value.first()
+            }
+        }
+
+        user[attributeInfo.name] = value
+    }
+
+    CreateRequest request = Requests.newCreateRequest(&quot;users&quot;, name, new \
JsonValue(user)) +    Resource resource = connection.create(new RootContext(), \
request) +    return new Uid(resource.getId(), resource.getRevision())
+
+} else {
+    throw UnsupportedOperationException(&quot;Create operation of type:&quot; + \
objectClass.objectClassValue) +}
+
+//switch (objectClass) {
+//    case ObjectClass.ACCOUNT:
+//        CRESTBuilder.create(&quot;users&quot;) { reg -&gt;
+//            newResourceId = &quot;dsfd&quot;
+//            content {
+//                userName '12'
+//                givenName 'John'
+//                sn 'Doe'
+//                mail 'jdoe@example.com'
+//                telephoneNumber '1-555-555-1212'
+//            }
+//        }.onSuccess{ response -&gt;
+//            new Uid(response.id, response.revision)
+//        }.onFailure{ ex -&gt;
+//            throw ex;
+//        }.execute(connection, null)
+//
+//
+//
+//        def filter = FilterBuilder.equalTo(AttributeBuilder.build(Name.name, \
&quot;123&quot;)) +//
+//        CRESTBuilder.query(&quot;users&quot;) {
+//            queryFilter = filter
+//        }.onSuccess{ QueryResult response -&gt;
+//            while (response.pagedResultsCookie != null){
+//                request.pagedResultsCookie = response.pagedResultsCookie
+//                execute()
+//            }
+//        }.onFailure{ ex -&gt;
+//            throw ex;
+//        }.execute(connection, new RootContext())
+
+//        def queryResult = builder.query(&quot;users&quot;){queryRequest -&gt;
+//
+//        }.execute(connection, context){ res -&gt;
+//            handler{
+//                uid res.id, res.revision
+//                res.content.each {
+//
+//                }
+//            }
+//        }
+//
+//        break
+//    default:
+//        throw UnsupportedOperationException(&quot;Create operation of type:&quot; \
+ objectClass) +//}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcescrestDeleteScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/DeleteScript.groovy (0 \
=> 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/DeleteScript.groovy	    \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/crest/DeleteScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcescrestResolveUsernameScriptgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/ResolveUsernameScript.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/ResolveUsernameScript.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/crest/ResolveUsernameScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcescrestSchemaScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/SchemaScript.groovy (0 \
=> 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/SchemaScript.groovy	    \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/crest/SchemaScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+
+import org.forgerock.openicf.connectors.scriptedcrest.ScriptedCRESTConfiguration
+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+import org.identityconnectors.framework.common.objects.ObjectClass
+import org.identityconnectors.framework.common.objects.OperationalAttributeInfos
+import org.identityconnectors.framework.common.objects.PredefinedAttributeInfos
+
+import static org.identityconnectors.framework.common.objects.AttributeInfo.Flags.MULTIVALUED
 +import static org.identityconnectors.framework.common.objects.AttributeInfo.Flags.NOT_CREATABLE
 +import static org.identityconnectors.framework.common.objects.AttributeInfo.Flags.NOT_READABLE
 +import static org.identityconnectors.framework.common.objects.AttributeInfo.Flags.NOT_RETURNED_BY_DEFAULT
 +import static org.identityconnectors.framework.common.objects.AttributeInfo.Flags.NOT_UPDATEABLE
 +import static org.identityconnectors.framework.common.objects.AttributeInfo.Flags.REQUIRED
 +
+def action = action as OperationType
+def configuration = configuration as ScriptedCRESTConfiguration
+def log = log as Log
+
+builder.schema({
+    objectClass {
+        type ObjectClass.ACCOUNT_NAME
+        attribute OperationalAttributeInfos.CURRENT_PASSWORD
+        attributes {
+            userName String.class, REQUIRED
+            givenName String.class, REQUIRED
+            sn String.class, REQUIRED
+            mail REQUIRED
+            telephoneNumber()
+            __NAME__()
+        }
+    }
+}
+)
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcescrestScriptOnConnectorScriptgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/ScriptOnConnectorScript.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/ScriptOnConnectorScript.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/crest/ScriptOnConnectorScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcescrestScriptOnResourceScriptgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/ScriptOnResourceScript.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/ScriptOnResourceScript.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/crest/ScriptOnResourceScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcescrestSearchScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/SearchScript.groovy (0 \
=> 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/SearchScript.groovy	    \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/crest/SearchScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcescrestSyncScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/SyncScript.groovy (0 => \
6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/SyncScript.groovy	      \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/crest/SyncScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcescrestTestScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/TestScript.groovy (0 => \
6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/TestScript.groovy	      \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/crest/TestScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+
+import groovy.json.JsonBuilder
+import org.forgerock.json.fluent.JsonValue
+import org.forgerock.json.resource.ActionRequest
+import org.forgerock.json.resource.Connection
+import org.forgerock.json.resource.Requests
+import org.forgerock.json.resource.RootContext
+import org.forgerock.openicf.connectors.scriptedcrest.ScriptedCRESTConfiguration
+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+
+def action = action as OperationType
+def configuration = configuration as ScriptedCRESTConfiguration
+def connection = connection as Connection
+def log = log as Log
+
+log.info(&quot;This is TestScript&quot;)
+
+ActionRequest request = Requests.newActionRequest(&quot;users&quot;, \
&quot;clear&quot;); +JsonValue result = connection.action(new RootContext(), \
request); +
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcescrestUpdateAttributeValuesScriptgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/UpdateAttributeValuesScript.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/UpdateAttributeValuesScript.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/crest/UpdateAttributeValuesScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcescrestUpdateScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/UpdateScript.groovy (0 \
=> 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/crest/UpdateScript.groovy	    \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/crest/UpdateScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesgroovyAuthenticateScriptgroovy"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/test/resources/groovy/AuthenticateScript.groovy \
(6504 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/case1/AuthenticateScript.groovy	2014-03-28 \
                21:41:59 UTC (rev 6504)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/groovy/AuthenticateScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -22,10 +22,11 @@
</span><span class="cx">  * &quot;Portions Copyrighted [year] [name of copyright \
owner]&quot; </span><span class="cx">  */
</span><span class="cx"> 
</span><del>-
-import org.forgerock.openicf.misc.scriptedcommon.Logger
</del><ins>+import org.forgerock.openicf.misc.scriptedcommon.OperationType
</ins><span class="cx"> import \
org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration </span><del>-import \
org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase.Action \
</del><ins>+import org.identityconnectors.common.logging.Log +import \
org.identityconnectors.common.security.GuardedString +import \
org.identityconnectors.common.security.SecurityUtil </ins><span class="cx"> import \
org.identityconnectors.framework.common.exceptions.ConnectorSecurityException \
</span><span class="cx"> import \
org.identityconnectors.framework.common.exceptions.InvalidCredentialException \
</span><span class="cx"> import \
org.identityconnectors.framework.common.exceptions.InvalidPasswordException \
</span><span class="lines">@@ -35,51 +36,45 @@ </span><span class="cx"> import \
org.identityconnectors.framework.common.objects.OperationOptions </span><span \
class="cx"> import org.identityconnectors.framework.common.objects.Uid </span><span \
class="cx">  </span><del>-def action = action as Action
</del><ins>+def action = action as OperationType
</ins><span class="cx"> def configuration = configuration as ScriptedConfiguration
</span><span class="cx"> def username = username as String
</span><del>-def log = log as Logger
</del><ins>+def log = log as Log
</ins><span class="cx"> def objectClass = objectClass as ObjectClass
</span><span class="cx"> def options = options as OperationOptions
</span><del>-def password = password as Object;
</del><ins>+def password = password as GuardedString;
</ins><span class="cx"> 
</span><del>-if (objectClass.is(ObjectClass.ACCOUNT_NAME)) {
-    if (username.equals(&quot;TEST1&quot;)) {
-        throw new ConnectorSecurityException();
-    } else if (username.equals(&quot;TEST2&quot;)) {
-        throw new InvalidCredentialException();
-    } else if (username.equals(&quot;TEST3&quot;)) {
-        throw new InvalidPasswordException();
-    } else if (username.equals(&quot;TEST4&quot;)) {
-        throw new PermissionDeniedException();
-    } else if (username.equals(&quot;TEST5&quot;)) {
-        def clearPassword
-        if (password instanceof Closure) {
-            clearPassword = password()
-        } else {
-            clearPassword = password
</del><ins>+switch (objectClass) {
+    case ObjectClass.ACCOUNT:
+        throw UnsupportedOperationException(action.name() + &quot; operation of \
type:&quot; + objectClass) +        break
+    case ObjectClass.GROUP:
+        throw UnsupportedOperationException(action.name() + &quot; operation of \
type:&quot; + objectClass) +        break
+    case ObjectClass.ALL:
+        log.error(&quot;ICF Framework MUST reject this&quot;)
+        break
+    case TestHelper.TEST:
+        if (username.equals(&quot;TEST1&quot;)) {
+            throw new ConnectorSecurityException();
+        } else if (username.equals(&quot;TEST2&quot;)) {
+            throw new InvalidCredentialException();
+        } else if (username.equals(&quot;TEST3&quot;)) {
+            throw new InvalidPasswordException();
+        } else if (username.equals(&quot;TEST4&quot;)) {
+            throw new PermissionDeniedException();
+        } else if (username.equals(&quot;TEST5&quot;)) {
+            def clearPassword = SecurityUtil.decrypt(password)
+            if (&quot;Passw0rd&quot;.equals(clearPassword)) {
+                return new Uid(username);
+            }
+            throw new InvalidPasswordException();
</ins><span class="cx">         }
</span><del>-
-        if (&quot;Passw0rd&quot;.equals(clearPassword)) {
-            return new Uid(username);
-        }
-        throw new InvalidPasswordException();
-    } else if (username.equals(&quot;TEST6&quot;)) {
-        def clearPassword
-        if (password instanceof Closure) {
-            password({ out -&gt;
-                clearPassword = out
-            })
-        } else {
-            clearPassword = password
-        }
-
-        if (&quot;Passw0rd&quot;.equals(clearPassword)) {
-            return new Uid(username);
-        }
-        throw new InvalidPasswordException();
-    }
-    throw new UnknownUidException();
-} else {
-    throw UnsupportedOperationException(&quot;Authentication is not supported on \
&quot; + objectClass); </del><ins>+        throw new UnknownUidException();
+    case TestHelper.SAMPLE:
+        throw UnsupportedOperationException(action.name() + &quot; operation of \
type:&quot; + objectClass) +        break
+    default:
+        throw UnsupportedOperationException(action.name() + &quot; operation of \
type:&quot; + objectClass) </ins><span class="cx"> }
</span><ins>+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesgroovyCreateScriptgroovy"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/test/resources/groovy/CreateScript.groovy \
(6504 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/case1/CreateScript.groovy	2014-03-28 \
                21:41:59 UTC (rev 6504)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/groovy/CreateScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -22,21 +22,21 @@
</span><span class="cx">  * &quot;Portions Copyrighted [year] [name of copyright \
owner]&quot; </span><span class="cx">  */
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> import ObjectCacheLibrary
</span><span class="cx"> import \
org.forgerock.openicf.misc.scriptedcommon.ICFObjectBuilder as ICF </span><del>-import \
org.forgerock.openicf.misc.scriptedcommon.Logger </del><ins>+import \
org.identityconnectors.common.logging.Log +import \
org.forgerock.openicf.misc.scriptedcommon.OperationType </ins><span class="cx"> \
import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration \
</span><del>-import org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase \
</del><span class="cx"> import \
org.identityconnectors.framework.common.objects.Attribute </span><span class="cx"> \
import org.identityconnectors.framework.common.objects.ObjectClass </span><span \
class="cx"> import org.identityconnectors.framework.common.objects.OperationOptions \
</span><ins>+import org.identityconnectors.framework.common.objects.Uid </ins><span \
class="cx">  </span><del>-def action = action as ScriptedConnectorBase.Action
-def createAttributes = attributes as Map&lt;String, Attribute&gt;
</del><ins>+def action = action as OperationType
+def createAttributes = attributes as Set&lt;Attribute&gt;
</ins><span class="cx"> def configuration = configuration as ScriptedConfiguration
</span><span class="cx"> def name = id as String
</span><del>-def log = log as Logger
</del><ins>+def log = log as Log
</ins><span class="cx"> def objectClass = objectClass as ObjectClass
</span><span class="cx"> def options = options as OperationOptions
</span><span class="cx"> 
</span><span class="lines">@@ -49,10 +49,32 @@
</span><span class="cx">         return ObjectCacheLibrary.instance.create(ICF.co {
</span><span class="cx">             uid UUID.randomUUID().toString()
</span><span class="cx">             id name
</span><del>-            attributes(createAttributes.values())
</del><ins>+            delegate.objectClass objectClass
+            attributes createAttributes
</ins><span class="cx">         })
</span><span class="cx">         break
</span><span class="cx">     case ObjectClass.GROUP:
</span><ins>+        return ObjectCacheLibrary.instance.create(ICF.co {
+            uid(UUID.randomUUID().toString())
+            id name
+            delegate.objectClass objectClass
+            attributes createAttributes
+        })
+        break
+    case ObjectClass.ALL:
+        log.error(&quot;ICF Framework MUST reject this&quot;)
+        break
+    case TestHelper.TEST:
+        Uid uid = new Uid(name, &quot;0&quot;)
+        return TestHelper.exceptionTest(action, objectClass, uid)
+        break
+    case TestHelper.SAMPLE:
+        return ObjectCacheLibrary.instance.create(ICF.co {
+            uid UUID.randomUUID().toString()
+            id name
+            attributes(createAttributes)
+        })
+        break
</ins><span class="cx">     default:
</span><del>-        throw UnsupportedOperationException(&quot;Create operation of \
type:&quot; + objectClass) </del><ins>+        throw \
UnsupportedOperationException(&quot;Create operation of type:&quot; + \
objectClass.objectClassValue) </ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesgroovyDeleteScriptgroovy"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/test/resources/groovy/DeleteScript.groovy \
(6504 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/case1/DeleteScript.groovy	2014-03-28 \
                21:41:59 UTC (rev 6504)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/groovy/DeleteScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -22,18 +22,19 @@
</span><span class="cx">  * &quot;Portions Copyrighted [year] [name of copyright \
owner]&quot; </span><span class="cx">  */
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> import ObjectCacheLibrary
</span><del>-import org.forgerock.openicf.misc.scriptedcommon.Logger
</del><ins>+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
</ins><span class="cx"> import \
org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration </span><del>-import \
org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase.Action \
</del><ins>+import org.identityconnectors.framework.common.exceptions.ConnectorException
 </ins><span class="cx"> import \
org.identityconnectors.framework.common.objects.ObjectClass </span><span class="cx"> \
import org.identityconnectors.framework.common.objects.OperationOptions \
</span><ins>+import org.identityconnectors.framework.common.objects.SyncToken \
</ins><span class="cx"> import org.identityconnectors.framework.common.objects.Uid \
</span><span class="cx">  </span><del>-def action = action as Action
</del><ins>+def action = action as OperationType
</ins><span class="cx"> def configuration = configuration as ScriptedConfiguration
</span><del>-def log = log as Logger
</del><ins>+def log = log as Log
</ins><span class="cx"> def objectClass = objectClass as ObjectClass
</span><span class="cx"> def options = options as OperationOptions
</span><span class="cx"> def uid = uid as Uid
</span><span class="lines">@@ -43,7 +44,18 @@
</span><span class="cx">     case ObjectClass.ACCOUNT:
</span><span class="cx">         ObjectCacheLibrary.instance.delete(objectClass, uid)
</span><span class="cx">         break
</span><ins>+    case ObjectClass.GROUP:
+        ObjectCacheLibrary.instance.delete(objectClass, uid)
+        break
+    case ObjectClass.ALL:
+        log.error(&quot;ICF Framework MUST reject this&quot;)
+        break
+    case TestHelper.TEST:
+        //Sample script for IDME-180:Support MVCC Revision attribute
+        TestHelper.exceptionTest(action, objectClass, uid)
+        break
+    case TestHelper.SAMPLE:
+        throw UnsupportedOperationException(&quot;Delete operation of type:&quot; + \
objectClass) </ins><span class="cx">     default:
</span><del>-        throw UnsupportedOperationException(&quot;Create operation of \
type:&quot; + objectClass) </del><ins>+        throw \
UnsupportedOperationException(&quot;Delete operation of type:&quot; + objectClass) \
</ins><span class="cx"> } </span><del>-
</del></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesgroovyResolveUsernameScriptgroovy"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/test/resources/groovy/ResolveUsernameScript.groovy \
(6504 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/case1/ResolveUsernameScript.groovy	2014-03-28 \
                21:41:59 UTC (rev 6504)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/groovy/ResolveUsernameScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -1,11 +1,3 @@
</span><del>-import org.forgerock.openicf.misc.scriptedcommon.Logger
-import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration
-import org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase
-import org.identityconnectors.framework.common.exceptions.UnknownUidException
-import org.identityconnectors.framework.common.objects.ObjectClass
-import org.identityconnectors.framework.common.objects.OperationOptions
-import org.identityconnectors.framework.common.objects.Uid
-
</del><span class="cx"> /*
</span><span class="cx">  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
</span><span class="cx">  *
</span><span class="lines">@@ -30,10 +22,18 @@
</span><span class="cx">  * &quot;Portions Copyrighted [year] [name of copyright \
owner]&quot; </span><span class="cx">  */
</span><span class="cx"> 
</span><del>-def action = action as ScriptedConnectorBase.Action
</del><ins>+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration
+import org.identityconnectors.framework.common.exceptions.UnknownUidException
+import org.identityconnectors.framework.common.objects.ObjectClass
+import org.identityconnectors.framework.common.objects.OperationOptions
+import org.identityconnectors.framework.common.objects.Uid
+
+def action = action as OperationType
</ins><span class="cx"> def configuration = configuration as ScriptedConfiguration
</span><span class="cx"> def username = username as String
</span><del>-def log = log as Logger
</del><ins>+def log = log as Log
</ins><span class="cx"> def objectClass = objectClass as ObjectClass
</span><span class="cx"> def options = options as OperationOptions
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesgroovySchemaScriptgroovy"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/test/resources/groovy/SchemaScript.groovy \
(6504 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/case1/SchemaScript.groovy	2014-03-28 \
                21:41:59 UTC (rev 6504)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/groovy/SchemaScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -23,11 +23,13 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-
-
-import org.forgerock.openicf.misc.scriptedcommon.Logger
</del><ins>+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
</ins><span class="cx"> import \
org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration </span><del>-import \
org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase.Action \
</del><ins>+import org.identityconnectors.common.security.GuardedByteArray +import \
org.identityconnectors.common.security.GuardedString +import \
org.identityconnectors.framework.common.objects.AttributeInfo +import \
org.identityconnectors.framework.common.objects.AttributeInfoBuilder </ins><span \
class="cx"> import org.identityconnectors.framework.common.objects.ObjectClass \
</span><span class="cx"> import \
org.identityconnectors.framework.common.objects.OperationalAttributeInfos \
</span><span class="cx"> import \
org.identityconnectors.framework.common.objects.PredefinedAttributeInfos </span><span \
class="lines">@@ -39,9 +41,9 @@ </span><span class="cx"> import static \
org.identityconnectors.framework.common.objects.AttributeInfo.Flags.NOT_UPDATEABLE \
</span><span class="cx"> import static \
org.identityconnectors.framework.common.objects.AttributeInfo.Flags.REQUIRED \
</span><span class="cx">  </span><del>-def action = action as Action
</del><ins>+def action = action as OperationType
</ins><span class="cx"> def configuration = configuration as ScriptedConfiguration
</span><del>-def log = log as Logger
</del><ins>+def log = log as Log
</ins><span class="cx"> 
</span><span class="cx"> builder.schema({
</span><span class="cx">     objectClass {
</span><span class="lines">@@ -56,18 +58,80 @@
</span><span class="cx">             active Boolean.class, NOT_UPDATEABLE
</span><span class="cx">             lastModified NOT_UPDATEABLE, NOT_CREATABLE, \
NOT_RETURNED_BY_DEFAULT </span><span class="cx">             sureName()
</span><ins>+            passwordHistory String.class, MULTIVALUED, NOT_READABLE, \
NOT_RETURNED_BY_DEFAULT </ins><span class="cx">         }
</span><ins>+
</ins><span class="cx">     }
</span><span class="cx">     objectClass {
</span><span class="cx">         type '__TEST__'
</span><span class="cx">         container()
</span><span class="cx">         attributes {
</span><del>-            username String.class, REQUIRED
-            email REQUIRED, MULTIVALUED
-            active Boolean.class, NOT_UPDATEABLE
-            lastModified NOT_UPDATEABLE, NOT_CREATABLE, NOT_RETURNED_BY_DEFAULT
-            sureName()
-            password NOT_READABLE, NOT_RETURNED_BY_DEFAULT
</del><ins>+
+            // All possible attribute types
+
+            attributeString String.class
+            attributeStringMultivalue String.class, MULTIVALUED
+
+            attributelong Long.TYPE
+            attributelongMultivalue Long.TYPE, MULTIVALUED
+
+            attributeLong Long.class
+            attributeLongMultivalue Long.class, MULTIVALUED
+
+            attributechar Character.TYPE
+            attributecharMultivalue Character.TYPE, MULTIVALUED
+
+            attributeCharacter Character.class
+            attributeCharacterMultivalue Character.class, MULTIVALUED
+
+            attributedouble Double.TYPE
+            attributedoubleMultivalue Double.TYPE, MULTIVALUED
+
+            attributeDouble Double.class
+            attributeDoubleMultivalue Double.class, MULTIVALUED
+
+            attributefloat Float.TYPE
+            attributefloatMultivalue Float.TYPE, MULTIVALUED
+
+            attributeFloat Float.class
+            attributeFloatMultivalue Float.class, MULTIVALUED
+
+            attributeint Integer.TYPE
+            attributeintMultivalue Integer.TYPE, MULTIVALUED
+
+            attributeInteger Integer.class
+            attributeIntegerMultivalue Integer.class, MULTIVALUED
+
+            attributeboolean Boolean.TYPE
+            attributebooleanMultivalue Boolean.TYPE, MULTIVALUED
+
+            attributeBoolean Boolean.class
+            attributeBooleanMultivalue Boolean.class, MULTIVALUED
+
+            attribute Byte.TYPE
+            attributeByteMultivalue Byte.TYPE, MULTIVALUED
+
+            attributeByte Byte.class
+            attributeByteMultivalued Byte.class, MULTIVALUED
+
+            attributeByteArray byte[].class
+            attributeByteArrayMultivalue byte[].class, MULTIVALUED
+
+            attributeBigDecimal BigDecimal.class
+            attributeBigDecimalMultivalue BigDecimal.class, MULTIVALUED
+
+            attributeBigInteger BigInteger.class
+            attributeBigIntegerMultivalue BigInteger.class, MULTIVALUED
+
+            attributeGuardedByteArray GuardedByteArray.class
+            attributeGuardedByteArrayMultivalue GuardedByteArray.class, MULTIVALUED
+
+            attributeGuardedString GuardedString.class
+            attributeGuardedStringMultivalue GuardedString.class, MULTIVALUED
+
+            attributeMap Map.class
+            attributeMapMultivalue Map.class, MULTIVALUED
+
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesgroovyScriptOnResourceScriptgroovy"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/test/resources/groovy/ScriptOnResourceScript.groovy \
(6504 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/case1/ScriptOnResourceScript.groovy	2014-03-28 \
                21:41:59 UTC (rev 6504)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/groovy/ScriptOnResourceScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -22,10 +22,9 @@
</span><span class="cx">  * &quot;Portions Copyrighted [year] [name of copyright \
owner]&quot; </span><span class="cx">  */
</span><span class="cx"> 
</span><del>-
-import org.forgerock.openicf.misc.scriptedcommon.Logger
</del><ins>+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
</ins><span class="cx"> import \
org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration </span><del>-import \
org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase </del><span \
class="cx"> import org.identityconnectors.framework.common.exceptions.InvalidAttributeValueException
 </span><span class="cx"> import \
org.identityconnectors.framework.common.exceptions.InvalidCredentialException \
</span><span class="cx"> import \
org.identityconnectors.framework.common.exceptions.InvalidPasswordException \
</span><span class="lines">@@ -33,9 +32,9 @@ </span><span class="cx"> 
</span><span class="cx"> import static \
org.identityconnectors.common.security.SecurityUtil.decrypt </span><span class="cx"> 
</span><del>-def action = action as ScriptedConnectorBase.Action
</del><ins>+def action = action as OperationType
</ins><span class="cx"> def configuration = configuration as ScriptedConfiguration
</span><del>-def log = log as Logger
</del><ins>+def log = log as Log
</ins><span class="cx"> def options = options as OperationOptions
</span><span class="cx"> def scriptArguments = scriptArguments as Map
</span><span class="cx"> def scriptLanguage = scriptLanguage as String
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesgroovySearchScriptgroovy"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/test/resources/groovy/SearchScript.groovy \
(6504 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/case1/SearchScript.groovy	2014-03-28 \
                21:41:59 UTC (rev 6504)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/groovy/SearchScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -22,12 +22,11 @@
</span><span class="cx">  * &quot;Portions Copyrighted [year] [name of copyright \
owner]&quot; </span><span class="cx">  */
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> import ObjectCacheLibrary
</span><span class="cx"> import \
org.forgerock.openicf.misc.scriptedcommon.ICFObjectBuilder as ICF </span><del>-import \
org.forgerock.openicf.misc.scriptedcommon.Logger </del><ins>+import \
org.identityconnectors.common.logging.Log +import \
org.forgerock.openicf.misc.scriptedcommon.OperationType </ins><span class="cx"> \
import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration \
</span><del>-import org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase \
</del><span class="cx"> import \
org.identityconnectors.framework.common.objects.Attribute </span><span class="cx"> \
import org.identityconnectors.framework.common.objects.ConnectorObject </span><span \
class="cx"> import org.identityconnectors.framework.common.objects.ObjectClass \
</span><span class="lines">@@ -35,10 +34,10 @@ </span><span class="cx"> import \
org.identityconnectors.framework.common.objects.SearchResult </span><span class="cx"> \
import org.identityconnectors.framework.common.objects.filter.Filter </span><span \
class="cx">  </span><del>-def action = action as ScriptedConnectorBase.Action
</del><ins>+def action = action as OperationType
</ins><span class="cx"> def configuration = configuration as ScriptedConfiguration
</span><span class="cx"> def filter = filter as Filter
</span><del>-def log = log as Logger
</del><ins>+def log = log as Log
</ins><span class="cx"> def objectClass = objectClass as ObjectClass
</span><span class="cx"> def options = options as OperationOptions
</span><span class="cx"> def EMPTY = new ObjectClass(&quot;__EMPTY__&quot;)
</span><span class="lines">@@ -51,6 +50,7 @@
</span><span class="cx">         // Handle the results
</span><span class="cx">         if (null != options.getPageSize()) {
</span><span class="cx">             // Paged Search
</span><ins>+            // Sample script for IDME-178
</ins><span class="cx">             final String pagedResultsCookie = \
options.getPagedResultsCookie(); </span><span class="cx">             String \
currentPagedResultsCookie = options.getPagedResultsCookie(); </span><span class="cx"> \
final Integer pagedResultsOffset = </span><span class="lines">@@ -99,11 +99,10 @@
</span><span class="cx">                     break;
</span><span class="cx">                 }
</span><span class="cx">             }
</span><del>-            return new SearchResult()
</del><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         break
</span><del>-    case ObjectClass.GROUP:
</del><ins>+    case TestHelper.SAMPLE:
</ins><span class="cx">         handler(
</span><span class="cx">                 ICF.co {
</span><span class="cx">                     uid '12'
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesgroovySyncScriptgroovy"></a>
<div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/test/resources/groovy/SyncScript.groovy \
(6504 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/case1/SyncScript.groovy	2014-03-28 \
                21:41:59 UTC (rev 6504)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/groovy/SyncScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -22,32 +22,206 @@
</span><span class="cx">  * &quot;Portions Copyrighted [year] [name of copyright \
owner]&quot; </span><span class="cx">  */
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> import \
org.forgerock.openicf.misc.scriptedcommon.ICFObjectBuilder as ICF </span><del>-import \
org.forgerock.openicf.misc.scriptedcommon.Logger </del><ins>+import \
org.identityconnectors.common.logging.Log +import \
org.forgerock.openicf.misc.scriptedcommon.OperationType </ins><span class="cx"> \
import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration \
</span><del>-import org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase.Action
 </del><span class="cx"> import \
org.identityconnectors.framework.common.exceptions.ConnectorException </span><span \
class="cx"> import org.identityconnectors.framework.common.objects.Attribute \
</span><span class="cx"> import \
org.identityconnectors.framework.common.objects.ObjectClass </span><span class="cx"> \
import org.identityconnectors.framework.common.objects.OperationOptions </span><span \
class="cx"> import org.identityconnectors.framework.common.objects.SyncToken \
</span><span class="cx">  </span><del>-def action = action as Action
</del><ins>+def action = action as OperationType
</ins><span class="cx"> def configuration = configuration as ScriptedConfiguration
</span><del>-def log = log as Logger
</del><ins>+def log = log as Log
</ins><span class="cx"> def objectClass = objectClass as ObjectClass
</span><del>-def options = options as OperationOptions
-def token = token as SyncToken
</del><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> switch (action) {
</span><del>-    case Action.SYNC:
-        handler(
-                ICF.delta {
-                    syncToken 12345
-                    UPDATE()
-                    previousUid '12'
</del><ins>+    case OperationType.SYNC:
+
+        def options = options as OperationOptions
+        def token = token as Object
+
+        switch (objectClass) {
+            case ObjectClass.ACCOUNT:
+                switch (token) {
+                    case 0:
+                        //CREATE See IDME-114
+                        handler({
+                            syncToken 1
+                            CREATE()
+                            object {
+                                uid '001'
+                                id 'foo'
+                                TestHelper.connectorObjectTemplate.each { key, value \
-&gt; +                                    attribute key, value
+                                }
+
+                            }
+                        })
+                        return new SyncToken(1);
+                        break;
+                    case 1:
+                        //UPDATE See IDME-114
+                        handler({
+                            syncToken 2
+                            UPDATE()
+                            object {
+                                uid '001'
+                                id 'foo'
+                                TestHelper.connectorObjectTemplate.each { key, value \
-&gt; +                                    attribute key, value
+                                }
+
+                            }
+                        })
+                        return new SyncToken(2);
+                        break;
+                    case 2:
+                        //UPDATE
+                        handler({
+                            syncToken 3
+                            CREATE_OR_UPDATE()
+                            object {
+                                uid '001'
+                                id 'foo'
+                                TestHelper.connectorObjectTemplate.each { key, value \
-&gt; +                                    attribute key, value
+                                }
+
+                            }
+                        })
+                        return new SyncToken(3);
+                        break;
+                    case 3:
+                        //RENAME
+                        handler({
+                            syncToken 4
+                            UPDATE()
+                            previousUid '001'
+                            object {
+                                uid '002'
+                                id 'foo'
+                                TestHelper.connectorObjectTemplate.each { key, value \
-&gt; +                                    attribute key, value
+                                }
+
+                            }
+                        })
+                        return new SyncToken(4);
+                        break;
+                    case 4:
+                        //DELETE
+                        handler({
+                            syncToken 5
+                            DELETE()
+                            object {
+                                uid '002'
+                                id 'foo'
+                                TestHelper.connectorObjectTemplate.each { key, value \
-&gt; +                                    attribute key, value
+                                }
+
+                            }
+                        })
+                        return new SyncToken(5);
+                        break;
+                    case 5..9:
+                        //Empty change range: Sample script for IDME-179
+                        log.ok(&quot;Sync empty change range&quot;)
+                        return new SyncToken(10);
+                        break;
+                    case 10..16:
+                        for (int i = 10; i &lt;= 16; i = i + 2) {
+                            handler({
+                                syncToken i
+                                CREATE_OR_UPDATE()
+                                object {
+                                    uid '002'
+                                    id 'foo'
+                                    TestHelper.connectorObjectTemplate.each { key, \
value -&gt; +                                        attribute key, value
+                                    }
+
+                                }
+                            })
+                        }
+                    default:
+                        return new SyncToken(17);
+                }
+            case ObjectClass.GROUP:
+                for (int i = 11; i &lt;= 16; i = i + 2) {
+                    handler({
+                        syncToken i
+                        CREATE_OR_UPDATE()
+                        object {
+                            uid 'group1'
+                            id 'group1'
+                            delegate.objectClass(ObjectClass.GROUP)
+                            TestHelper.connectorObjectTemplate.each { key, value \
-&gt; +                                attribute key, value
+                            }
+
+                        }
+                    })
+                }
+                return new SyncToken(16);
+            case ObjectClass.ALL:
+                // Sample script for IDME-116
+                for (int i = 10; i &lt;= 16; i++) {
+                    handler({
+                        syncToken i
+                        CREATE_OR_UPDATE()
+                        object {
+                            if (i % 2 == 0) {
+                                uid '002'
+                                id 'foo'
+                                delegate.objectClass ObjectClass.ACCOUNT
+                            } else {
+                                uid 'group1'
+                                id 'group1'
+                                delegate.objectClass ObjectClass.GROUP
+                            }
+                            TestHelper.connectorObjectTemplate.each { key, value \
-&gt; +                                attribute key, value
+                            }
+
+                        }
+                    })
+                }
+                return new SyncToken(17);
+            case TestHelper.SAMPLE:
+                handler(
+                        ICF.delta {
+                            syncToken 12345
+                            UPDATE()
+                            previousUid '12'
+                            object {
+                                uid '13'
+                                id '13'
+                                attribute {
+                                    name 'sureName'
+                                    value 'Foo'
+                                }
+                                attribute {
+                                    name 'lastName'
+                                    value 'Bar'
+                                }
+                                attribute {
+                                    name 'groups'
+                                    values 'Group1', 'Group2'
+                                }
+                                attribute 'active', true
+                                attribute 'NULL'
+                            }
+                        }
+                )
+
+                handler({
+                    syncToken 12346
+                    CREATE()
</ins><span class="cx">                     object {
</span><span class="cx">                         uid '13'
</span><span class="cx">                         id '13'
</span><span class="lines">@@ -65,44 +239,36 @@
</span><span class="cx">                         }
</span><span class="cx">                         attribute 'active', true
</span><span class="cx">                         attribute 'NULL'
</span><ins>+                        attributes(new Attribute('emails', [
+                                [
+                                        &quot;address&quot;   : \
&quot;foo@example.com&quot;, +                                        \
&quot;type&quot;      : &quot;home&quot;, +                                        \
&quot;customType&quot;: &quot;&quot;, +                                        \
&quot;primary&quot;   : true] +                        ]))
</ins><span class="cx">                     }
</span><del>-                }
-        )
</del><ins>+                })
+                return new SyncToken('SAMPLE')
+                break
+            default:
+                throw UnsupportedOperationException(&quot;Sync operation of \
type:&quot; + objectClass) +        }
</ins><span class="cx"> 
</span><del>-        handler({
-            syncToken 12346
-            CREATE()
-            object {
-                uid '13'
-                id '13'
-                attribute {
-                    name 'sureName'
-                    value 'Foo'
-                }
-                attribute {
-                    name 'lastName'
-                    value 'Bar'
-                }
-                attribute {
-                    name 'groups'
-                    values 'Group1', 'Group2'
-                }
-                attribute 'active', true
-                attribute 'NULL'
-                attributes(new Attribute('emails', [
-                        [
-                                &quot;address&quot;: &quot;foo@example.com&quot;,
-                                &quot;type&quot;: &quot;home&quot;,
-                                &quot;customType&quot;: &quot;&quot;,
-                                &quot;primary&quot;: true]
-                ]))
-            }
-        })
-
-        return new SyncToken('13')
-        break
-    case Action.GET_LATEST_SYNC_TOKEN:
-        throw new UnsupportedOperationException()
</del><ins>+    case OperationType.GET_LATEST_SYNC_TOKEN:
+        switch (objectClass) {
+            case ObjectClass.ACCOUNT:
+                return new SyncToken(17);
+            case ObjectClass.GROUP:
+                return new SyncToken(16);
+            case ObjectClass.ALL:
+                return new SyncToken(17);
+            case TestHelper.TEST:
+                return new SyncToken(0);
+            case TestHelper.SAMPLE:
+                return new SyncToken(&quot;ANY OBJECT&quot;);
+            default:
+                throw UnsupportedOperationException(&quot;Sync operation of \
type:&quot; + objectClass.objectClassValue) +        }
</ins><span class="cx">     default:
</span><span class="cx">         throw new ConnectorException(&quot;SyncScript can \
not handle action:&quot; + action.name()) </span><span class="cx"> }
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesgroovyTestHelpergroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/groovy/TestHelper.groovy (0 \
=> 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/groovy/TestHelper.groovy	     \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/groovy/TestHelper.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,195 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+import org.identityconnectors.common.security.GuardedByteArray
+import org.identityconnectors.common.security.GuardedString
+import org.identityconnectors.framework.common.exceptions.AlreadyExistsException
+import org.identityconnectors.framework.common.exceptions.InvalidAttributeValueException
 +import org.identityconnectors.framework.common.exceptions.PreconditionFailedException
 +import org.identityconnectors.framework.common.exceptions.PreconditionRequiredException
 +import org.identityconnectors.framework.common.exceptions.RetryableException
+import org.identityconnectors.framework.common.exceptions.UnknownUidException
+import org.identityconnectors.framework.common.objects.NameUtil
+import org.identityconnectors.framework.common.objects.ObjectClass
+import org.identityconnectors.framework.common.objects.Uid
+
+import java.nio.charset.Charset
+
+/**
+ *
+ */
+class TestHelper {
+
+    static final ObjectClass TEST = new \
ObjectClass(NameUtil.createSpecialName('TEST')) +    static final ObjectClass SAMPLE \
= new ObjectClass(NameUtil.createSpecialName('SAMPLE')) +
+
+    static Uid exceptionTest(OperationType operation, ObjectClass objectClass, Uid \
uid) { +        if (&quot;TEST1&quot;.equals(uid.uidValue)) {
+            if (OperationType.CREATE.equals(operation)) {
+                throw new AlreadyExistsException(
+                        &quot;Object with Uid '${uid.uidValue}' and ObjectClass \
'${objectClass.objectClassValue}' already exists!&quot;).initUid(uid); +            } \
else { +                throw new UnknownUidException(uid, objectClass);
+            }
+        } else if (&quot;TEST2&quot;.equals(uid.uidValue)) {
+            //ICF 1.4 Exception
+            if (OperationType.DELETE.equals(operation)) {
+                return uid;
+            } else {
+                throw new InvalidAttributeValueException();
+            }
+        } else if (&quot;TEST3&quot;.equals(uid.uidValue)) {
+            //ICF 1.1 Exception
+            if (OperationType.DELETE.equals(operation)) {
+                return uid;
+            } else {
+                throw new IllegalArgumentException();
+            }
+        } else if (&quot;TEST4&quot;.equals(uid.uidValue)) {
+            if (OperationType.CREATE.equals(operation)) {
+                throw RetryableException.wrap(&quot;Created but some attributes are \
not set, call update with new 'uid'!&quot;, uid); +            } else {
+                throw new PreconditionFailedException();
+            }
+        } else if (&quot;TEST5&quot;.equals(uid.uidValue)) {
+            if (OperationType.CREATE.equals(operation)) {
+                return uid;
+            } else {
+                throw new PreconditionRequiredException();
+            }
+        }
+        return uid;
+    }
+
+    static Map&lt;String, Objects&gt; getConnectorObjectTemplate() {
+
+        return [
+                attributeString                    : &quot;value&quot;,
+                attributeStringMultivalue          : [&quot;value1&quot;, \
&quot;value2&quot;] as String[], +
+                attributelongp                     : 11l,
+                attributelongpMultivalue           : [12l, 13l] as long[],
+
+                attributeLong                      : 14 as Long,
+                attributeLongMultivalue            : [15 as Long, 16 as Long] as \
Long[], +
+                attributechar                      : 'a' as char,
+                attributecharMultivalue            : ['b' as char, 'c' as char] as \
char[], +
+                attributeCharacter                 : 'd' as Character,
+                attributeCharacterMultivalue       : ['e' as Character, 'f' as \
Character] as Character[], +
+                attributedoublep                   : Double.MIN_NORMAL,
+                attributedoublepMultivalue         : [Double.MIN_VALUE, \
Double.MAX_VALUE] as double[], +
+                attributeDouble                    : 17 as Double,
+                attributeDoubleMultivalue          : [18 as Double, 19 as Double] as \
Double[], +
+                attributefloatp                    : 20F,
+                attributefloatpMultivalue          : [21F, 22F] as float[],
+
+                attributeFloat                     : 23 as Float,
+                attributeFloatMultivalue           : [24 as Float, 25 as Float] as \
Float[], +
+                attributeint                       : 26 as int,
+                attributeintMultivalue             : [27 as int, 28 as int] as \
int[], +
+                attributeInteger                   : 29 as Integer,
+                attributeIntegerMultivalue         : [30 as Integer, 31 as Integer] \
as Integer[], +
+                attributebooleanp                  : true as boolean,
+                attributebooleanpMultivalue        : [true as boolean, false as \
boolean] as boolean[], +
+                attributeBoolean                   : false as Boolean,
+                attributeBooleanMultivalue         : [true as Boolean, false as \
Boolean] as Boolean[], +
+                // Sample script for IDME-113
+                attributebytep                     : 48 as byte,
+                attributebytepMultivalue           : [49 as byte, 50 as byte] as \
byte[], +
+                // Sample script for IDME-113
+                attributeByte                      : 51 as Byte,
+                attributeByteMultivalue            : [52 as Byte, 53 as Byte] as \
Byte[], +
+                attributeByteArray                 : \
&quot;array&quot;.getBytes(Charset.forName(&quot;UTF-8&quot;)), +                \
attributeByteArrayMultivalue       : \
[&quot;item1&quot;.getBytes(Charset.forName(&quot;UTF-8&quot;)), +                    \
&quot;item2&quot;.getBytes(Charset.forName(&quot;UTF-8&quot;))] as byte[][], +
+                attributeBigDecimal                : BigDecimal.ONE,
+                attributeBigDecimalMultivalue      : [BigDecimal.ZERO, \
BigDecimal.TEN] as BigDecimal[], +
+                attributeBigInteger                : BigInteger.ONE,
+                attributeBigIntegerMultivalue      : [BigInteger.ZERO, \
BigInteger.TEN] as BigInteger[], +
+                attributeGuardedByteArray          : new \
GuardedByteArray(&quot;array&quot;.getBytes(Charset.forName(&quot;UTF-8&quot;))), +   \
attributeGuardedByteArrayMultivalue: [new \
GuardedByteArray(&quot;item1&quot;.getBytes(Charset.forName(&quot;UTF-8&quot;))), +   \
new GuardedByteArray(&quot;item2&quot;.getBytes(Charset.forName(&quot;UTF-8&quot;)))] \
+                        as GuardedByteArray[], +
+                attributeGuardedString             : new \
GuardedString(&quot;secret&quot;.toCharArray()), +                \
attributeGuardedStringMultivalue   : [new \
GuardedString(&quot;secret1&quot;.toCharArray()), +                                   \
new GuardedString(&quot;secret1&quot;.toCharArray())] as GuardedString[], +
+                // Sample script for IDME-113
+                attributeMap                       : [
+                        string     : 'String',
+                        number     : 42,
+                        trueOrFalse: true,
+                        nullValue  : null,
+                        collection : ['item1', 'item2'],
+                        object     : [
+                                key1: 'value1',
+                                key2: 'value2'
+                        ]
+                ],
+                attributeMapMultivalue             : [
+                        [
+                                string     : 'String',
+                                number     : 42,
+                                trueOrFalse: true,
+                                nullValue  : null,
+                                collection : ['item1', 'item2'],
+                                object     : [
+                                        key1: 'value1',
+                                        key2: 'value2'
+                                ]
+                        ],
+                        [
+                                string     : 'String',
+                                number     : 43,
+                                trueOrFalse: true,
+                                nullValue  : null,
+                                collection : ['item1', 'item2'],
+                                object     : [
+                                        key1: 'value1',
+                                        key2: 'value2'
+                                ]
+                        ]
+                ] as Map[]
+        ]
+    }
+}
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesgroovyTestScriptgroovy"></a>
<div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/test/resources/groovy/TestScript.groovy \
(6504 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/case1/TestScript.groovy	2014-03-28 \
                21:41:59 UTC (rev 6504)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/groovy/TestScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -22,16 +22,15 @@
</span><span class="cx">  * &quot;Portions Copyrighted [year] [name of copyright \
owner]&quot; </span><span class="cx">  */
</span><span class="cx"> 
</span><del>-import org.forgerock.openicf.misc.scriptedcommon.Logger
</del><ins>+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
</ins><span class="cx"> import \
org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration </span><del>-import \
org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase.Action </del><span \
class="cx">  </span><del>-
-def action = action as Action
</del><ins>+def action = action as OperationType
</ins><span class="cx"> def configuration = configuration as ScriptedConfiguration
</span><del>-def log = log as Logger
</del><ins>+def log = log as Log
</ins><span class="cx"> 
</span><span class="cx"> 
</span><del>-log.infoLocale(&quot;TEST&quot;, &quot;This is TestScript&quot;)
</del><ins>+log.info(&quot;This is TestScript&quot;)
</ins><span class="cx"> 
</span><span class="cx"> throw new MissingResourceException(&quot;Test Failed&quot;, \
action.name(), &quot;&quot;) </span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesgroovyUpdateScriptgroovy"></a>
 <div class="modfile"><h4>Modified: \
trunk/connectors/java/scriptedcommon/src/test/resources/groovy/UpdateScript.groovy \
(6504 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/case1/UpdateScript.groovy	2014-03-28 \
                21:41:59 UTC (rev 6504)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/groovy/UpdateScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -22,9 +22,9 @@
</span><span class="cx">  * &quot;Portions Copyrighted [year] [name of copyright \
owner]&quot; </span><span class="cx">  */
</span><span class="cx"> 
</span><del>-import org.forgerock.openicf.misc.scriptedcommon.Logger
</del><ins>+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
</ins><span class="cx"> import \
org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration </span><del>-import \
org.forgerock.openicf.misc.scriptedcommon.ScriptedConnectorBase.Action </del><span \
class="cx"> import org.identityconnectors.framework.common.exceptions.ConnectorException
 </span><span class="cx"> import \
org.identityconnectors.framework.common.exceptions.InvalidAttributeValueException \
</span><span class="cx"> import \
org.identityconnectors.framework.common.exceptions.PreconditionFailedException \
</span><span class="lines">@@ -35,38 +35,43 @@ </span><span class="cx"> import \
org.identityconnectors.framework.common.objects.OperationOptions </span><span \
class="cx"> import org.identityconnectors.framework.common.objects.Uid </span><span \
class="cx">  </span><del>-def action = action as Action
-def attributes = attributes as Map&lt;String, Attribute&gt;
</del><ins>+def action = action as OperationType
+def updateAttributes = attributes as Set&lt;Attribute&gt;
</ins><span class="cx"> def configuration = configuration as ScriptedConfiguration
</span><span class="cx"> def id = id as Attribute
</span><del>-def log = log as Logger
</del><ins>+def log = log as Log
</ins><span class="cx"> def objectClass = objectClass as ObjectClass
</span><span class="cx"> def options = options as OperationOptions
</span><span class="cx"> def uid = uid as Uid
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-log.debugLocale(&quot;scriptingLanguage.help&quot;, &quot;Default \
Message&quot;) </del><ins>+log.ok(&quot;Default Message&quot;)
</ins><span class="cx"> 
</span><span class="cx"> switch (action) {
</span><del>-    case Action.UPDATE:
-        if (objectClass.is(ObjectClass.ACCOUNT_NAME)) {
-            if (&quot;TEST1&quot;.equals(uid.uidValue)) {
-                throw new UnknownUidException(uid, objectClass);
-            } else if (&quot;TEST2&quot;.equals(uid.uidValue)) {
-                throw new InvalidAttributeValueException();
-            } else if (&quot;TEST3&quot;.equals(uid.uidValue)) {
-                throw new PreconditionFailedException();
-            } else if (&quot;TEST4&quot;.equals(uid.uidValue)) {
-                throw new PreconditionRequiredException();
-            }
-            return uid
-        } else {
-            throw new UnsupportedOperationException(&quot;Unsupported Update -&gt; \
&quot; + objectClass) </del><ins>+    case OperationType.UPDATE:
+        switch (objectClass) {
+            case ObjectClass.ACCOUNT:
+                return uid
+                break
+            case ObjectClass.GROUP:
+                return uid
+                break
+            case ObjectClass.ALL:
+                log.error(&quot;ICF Framework MUST reject this&quot;)
+                break
+            case TestHelper.TEST:
+                //Sample script for IDME-180:Support MVCC Revision attribute
+                TestHelper.exceptionTest(action, objectClass, uid)
+                break
+            case TestHelper.SAMPLE:
+                throw UnsupportedOperationException(&quot;Update operation of \
type:&quot; + objectClass) +            default:
+                throw UnsupportedOperationException(&quot;Update operation of \
type:&quot; + objectClass) </ins><span class="cx">         }
</span><span class="cx">         break
</span><del>-    case Action.ADD_ATTRIBUTE_VALUES:
</del><ins>+    case OperationType.ADD_ATTRIBUTE_VALUES:
</ins><span class="cx">         throw new UnsupportedOperationException()
</span><del>-    case Action.REMOVE_ATTRIBUTE_VALUES:
</del><ins>+    case OperationType.REMOVE_ATTRIBUTE_VALUES:
</ins><span class="cx">         throw new UnsupportedOperationException()
</span><span class="cx">     default:
</span><span class="cx">         throw new ConnectorException(&quot;UpdateScript can \
not handle action:&quot; + action.name()) </span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesrestAuthenticateScriptgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/AuthenticateScript.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/AuthenticateScript.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/rest/AuthenticateScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesrestCreateScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/CreateScript.groovy (0 \
=> 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/CreateScript.groovy	     \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/rest/CreateScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesrestDeleteScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/DeleteScript.groovy (0 \
=> 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/DeleteScript.groovy	     \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/rest/DeleteScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesrestResolveUsernameScriptgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/ResolveUsernameScript.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/ResolveUsernameScript.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/rest/ResolveUsernameScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesrestSchemaScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/SchemaScript.groovy (0 \
=> 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/SchemaScript.groovy	     \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/rest/SchemaScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesrestScriptOnConnectorScriptgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/ScriptOnConnectorScript.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/ScriptOnConnectorScript.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/rest/ScriptOnConnectorScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesrestScriptOnResourceScriptgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/ScriptOnResourceScript.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/ScriptOnResourceScript.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/rest/ScriptOnResourceScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesrestSearchScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/SearchScript.groovy (0 \
=> 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/SearchScript.groovy	     \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/rest/SearchScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesrestSyncScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/SyncScript.groovy (0 => \
6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/SyncScript.groovy	       \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/rest/SyncScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesrestTestScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/TestScript.groovy (0 => \
6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/TestScript.groovy	       \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/rest/TestScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+
+import groovyx.net.http.RESTClient
+import org.forgerock.openicf.connectors.scriptedrest.ScriptedRESTConfiguration
+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+
+import static groovyx.net.http.ContentType.JSON
+import static groovyx.net.http.Method.POST
+
+def action = action as OperationType
+def configuration = configuration as ScriptedRESTConfiguration
+def connection = connection as RESTClient
+def log = log as Log
+
+connection.handler.failure = { resp -&gt;
+    log.ok &quot;Unexpected failure: ${resp.statusLine}&quot;
+}
+
+def cleared = connection.post(
+        path: &quot;/rest/users&quot;,
+        contentType: JSON,
+        requestContentType: JSON,
+        query: [
+                _action: &quot;clear&quot;
+        ],
+        body: 'null'
+)
+
+
+cleared = connection.request(POST, JSON) {  req -&gt;
+    uri.path = '/rest/users'
+    uri.query = [_action : 'clear']
+    send JSON, 'null'
+
+    //requestContentType = JSON
+    //body = 'null'
+
+    response.success = { resp, json -&gt;
+        assert json.size() == 1
+        println &quot;Query response: &quot;
+        json.responseData.each() { key, value -&gt;
+            log.debug &quot;  ${key} : ${value}&quot;
+        }
+    }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesrestUpdateAttributeValuesScriptgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/UpdateAttributeValuesScript.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/UpdateAttributeValuesScript.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/rest/UpdateAttributeValuesScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcesrestUpdateScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/UpdateScript.groovy (0 \
=> 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/rest/UpdateScript.groovy	     \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/rest/UpdateScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcessqlAuthenticateScriptgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/AuthenticateScript.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/AuthenticateScript.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/sql/AuthenticateScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+
+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration
+import org.identityconnectors.framework.common.objects.ObjectClass
+import org.identityconnectors.framework.common.objects.OperationOptions
+
+def action = action as OperationType
+def configuration = configuration as ScriptedConfiguration
+def username = username as String
+def log = log as Log
+def objectClass = objectClass as ObjectClass
+def options = options as OperationOptions
+def password = password as Object;
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcessqlCreateScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/CreateScript.groovy (0 => \
6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/CreateScript.groovy	      \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/sql/CreateScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration
+import org.identityconnectors.framework.common.objects.Attribute
+import org.identityconnectors.framework.common.objects.ObjectClass
+import org.identityconnectors.framework.common.objects.OperationOptions
+
+def action = action as OperationType
+def createAttributes = attributes as Map&lt;String, Attribute&gt;
+def configuration = configuration as ScriptedConfiguration
+def name = id as String
+def log = log as Log
+def objectClass = objectClass as ObjectClass
+def options = options as OperationOptions
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcessqlDeleteScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/DeleteScript.groovy (0 => \
6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/DeleteScript.groovy	      \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/sql/DeleteScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+
+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration
+import org.identityconnectors.framework.common.objects.ObjectClass
+import org.identityconnectors.framework.common.objects.OperationOptions
+import org.identityconnectors.framework.common.objects.Uid
+
+def action = action as OperationType
+def configuration = configuration as ScriptedConfiguration
+def log = log as Log
+def objectClass = objectClass as ObjectClass
+def options = options as OperationOptions
+def uid = uid as Uid
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcessqlResolveUsernameScriptgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/ResolveUsernameScript.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/ResolveUsernameScript.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/sql/ResolveUsernameScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+
+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration
+import org.identityconnectors.framework.common.objects.ObjectClass
+import org.identityconnectors.framework.common.objects.OperationOptions
+
+def action = action as OperationType
+def configuration = configuration as ScriptedConfiguration
+def username = username as String
+def log = log as Log
+def objectClass = objectClass as ObjectClass
+def options = options as OperationOptions
+
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcessqlSchemaScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/SchemaScript.groovy (0 => \
6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/SchemaScript.groovy	      \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/sql/SchemaScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+
+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration
+
+def action = action as OperationType
+def configuration = configuration as ScriptedConfiguration
+def log = log as Log
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcessqlScriptOnResourceScriptgroovy"></a>
 <div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/ScriptOnResourceScript.groovy \
(0 => 6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/ScriptOnResourceScript.groovy	 \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/sql/ScriptOnResourceScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+
+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration
+import org.identityconnectors.framework.common.objects.OperationOptions
+
+def action = action as OperationType
+def configuration = configuration as ScriptedConfiguration
+def log = log as Log
+def options = options as OperationOptions
+def scriptArguments = scriptArguments as Map
+def scriptLanguage = scriptLanguage as String
+def scriptText = scriptText as String
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcessqlSearchScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/SearchScript.groovy (0 => \
6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/SearchScript.groovy	      \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/sql/SearchScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration
+import org.identityconnectors.framework.common.objects.ObjectClass
+import org.identityconnectors.framework.common.objects.OperationOptions
+import org.identityconnectors.framework.common.objects.filter.Filter
+
+def action = action as OperationType
+def configuration = configuration as ScriptedConfiguration
+def filter = filter as Filter
+def log = log as Log
+def objectClass = objectClass as ObjectClass
+def options = options as OperationOptions
+def EMPTY = new ObjectClass(&quot;__EMPTY__&quot;)
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcessqlSyncScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/SyncScript.groovy (0 => \
6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/SyncScript.groovy	        \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/sql/SyncScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration
+import org.identityconnectors.framework.common.objects.ObjectClass
+import org.identityconnectors.framework.common.objects.OperationOptions
+import org.identityconnectors.framework.common.objects.SyncToken
+
+def action = action as OperationType
+def configuration = configuration as ScriptedConfiguration
+def log = log as Log
+def objectClass = objectClass as ObjectClass
+def options = options as OperationOptions
+def token = token as SyncToken
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcessqlTestScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/TestScript.groovy (0 => \
6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/TestScript.groovy	        \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/sql/TestScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+import groovy.sql.Sql
+import org.forgerock.openicf.connectors.scriptedsql.ScriptedSQLConfiguration
+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+
+import java.sql.Connection
+
+
+def action = action as OperationType
+def configuration = configuration as ScriptedSQLConfiguration
+def connection = new Sql(connection as Connection)
+def log = log as Log
+
+
+log.info(&quot;This is TestScript&quot;)
+
+def rows = connection.rows(&quot;SELECT ID FROM INFORMATION_SCHEMA.TABLES WHERE \
TABLE_NAME = 'USERS' AND TABLE_TYPE = 'TABLE'&quot;) +assert rows.size() == 1
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcessqlUpdateScriptgroovy"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/UpdateScript.groovy (0 => \
6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/UpdateScript.groovy	      \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/sql/UpdateScript.groovy	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2014 ForgeRock AS. All Rights Reserved
+ *
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * http://forgerock.org/license/CDDLv1.0.html
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at http://forgerock.org/license/CDDLv1.0.html
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * &quot;Portions Copyrighted [year] [name of copyright owner]&quot;
+ */
+
+
+import org.identityconnectors.common.logging.Log
+import org.forgerock.openicf.misc.scriptedcommon.OperationType
+import org.forgerock.openicf.misc.scriptedcommon.ScriptedConfiguration
+import org.identityconnectors.framework.common.exceptions.ConnectorException
+import org.identityconnectors.framework.common.objects.Attribute
+import org.identityconnectors.framework.common.objects.ObjectClass
+import org.identityconnectors.framework.common.objects.OperationOptions
+import org.identityconnectors.framework.common.objects.Uid
+
+def action = action as OperationType
+def attributes = attributes as Map&lt;String, Attribute&gt;
+def configuration = configuration as ScriptedConfiguration
+def id = id as Attribute
+def log = log as Log
+def objectClass = objectClass as ObjectClass
+def options = options as OperationOptions
+def uid = uid as Uid
+
+
+log.ok(&quot;Default Message&quot;)
+
+switch (action) {
+    case OperationType.UPDATE:
+        throw new UnsupportedOperationException()
+    case OperationType.ADD_ATTRIBUTE_VALUES:
+        throw new UnsupportedOperationException()
+    case OperationType.REMOVE_ATTRIBUTE_VALUES:
+        throw new UnsupportedOperationException()
+    default:
+        throw new ConnectorException(&quot;UpdateScript can not handle action:&quot; \
+ action.name()) +}
+
+
+
+
+
+
</ins></span></pre></div>
<a id="trunkconnectorsjavascriptedcommonsrctestresourcessqltestDatabaseddl"></a>
<div class="addfile"><h4>Added: \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/testDatabase.ddl (0 => \
6509)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/connectors/java/scriptedcommon/src/test/resources/sql/testDatabase.ddl	         \
                (rev 0)
+++ trunk/connectors/java/scriptedcommon/src/test/resources/sql/testDatabase.ddl	2014-04-15 \
09:47:57 UTC (rev 6509) </span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+DROP TABLE IF EXISTS Users;
+DROP TABLE IF EXISTS Groups;
+DROP TABLE IF EXISTS Organizations;
+
+CREATE TABLE GROUPS
+(
+    ID INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
+    GID VARCHAR(32) NOT NULL,
+    NAME VARCHAR(32) DEFAULT '' NOT NULL,
+    DESCRIPTION VARCHAR(32),
+    TIMESTAMP TIMESTAMP
+);
+CREATE TABLE ORGANIZATIONS
+(
+    ID INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
+    NAME VARCHAR(32) DEFAULT '' NOT NULL,
+    DESCRIPTION VARCHAR(32),
+    TIMESTAMP TIMESTAMP
+);
+CREATE TABLE USERS
+(
+    ID INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
+    UID VARCHAR(32) NOT NULL,
+    FIRSTNAME VARCHAR(32) DEFAULT '' NOT NULL,
+    LASTNAME VARCHAR(32) DEFAULT '' NOT NULL,
+    DISPLAYNAME VARCHAR(64),
+    EMAIL VARCHAR(64),
+    EMPLOYEENUMBER VARCHAR(32),
+    EMPLOYEETYPE VARCHAR(32),
+    DESCRIPTION VARCHAR(64),
+    MOBILEPHONE VARCHAR(64),
+    TIMESTAMP TIMESTAMP
+);
+INSERT INTO Users(UID,FIRSTNAME,LASTNAME,DISPLAYNAME,EMAIL,EMPLOYEENUMBER,EMPLOYEETYPE,DESCRIPTION,MOBILEPHONE,TIMESTAMP) \
VALUES ('bob','Bob', 'Fleming','Bob \
Fleming','Bob.Fleming@example.com','100','employee','Employee Bob \
Fleming','123-456-789',CURRENT_TIMESTAMP); +INSERT INTO \
Users(UID,FIRSTNAME,LASTNAME,DISPLAYNAME,EMAIL,EMPLOYEENUMBER,EMPLOYEETYPE,DESCRIPTION,MOBILEPHONE,TIMESTAMP) \
VALUES ('rowley','Rowley','Birkin','Rowley \
Birkin','Rowley.Birkin@example.com','101','employee','Employee Rowley \
Birkin','345-234-543',CURRENT_TIMESTAMP); +INSERT INTO \
Users(UID,FIRSTNAME,LASTNAME,DISPLAYNAME,EMAIL,EMPLOYEENUMBER,EMPLOYEETYPE,DESCRIPTION,MOBILEPHONE,TIMESTAMP) \
VALUES ('louis','Louis', 'Balfour','Louis \
Balfour','Louis.Balfour@example.com','102','employee','Employee Louis \
Balfour','876-678-098',CURRENT_TIMESTAMP); +INSERT INTO \
Users(UID,FIRSTNAME,LASTNAME,DISPLAYNAME,EMAIL,EMPLOYEENUMBER,EMPLOYEETYPE,DESCRIPTION,MOBILEPHONE,TIMESTAMP) \
VALUES ('john','John', 'Smith','John \
Smith','John.Smith@example.com','103','employee','Employee John \
Smith','634-123-456',CURRENT_TIMESTAMP); +INSERT INTO \
Users(UID,FIRSTNAME,LASTNAME,DISPLAYNAME,EMAIL,EMPLOYEENUMBER,EMPLOYEETYPE,DESCRIPTION,MOBILEPHONE,TIMESTAMP) \
VALUES ('jdoe','John', 'Doe','John \
Doe','John.Doe@example.com','104','employee','Employee John \
Doe','125-785-645',CURRENT_TIMESTAMP); +INSERT INTO \
Users(UID,FIRSTNAME,LASTNAME,DISPLAYNAME,EMAIL,EMPLOYEENUMBER,EMPLOYEETYPE,DESCRIPTION,MOBILEPHONE,TIMESTAMP) \
VALUES ('chris','Chris', 'Crafty','Chris \
Crafty','Chris.Crafty@example.com','105','contractor','Employee Chris \
Crafty','888-666-555',CURRENT_TIMESTAMP); +
+INSERT INTO Groups(GID,NAME,DESCRIPTION,TIMESTAMP) VALUES ('100','admin','Admin \
group',CURRENT_TIMESTAMP); +INSERT INTO Groups(GID,NAME,DESCRIPTION,TIMESTAMP) VALUES \
('101','users','Users group',CURRENT_TIMESTAMP); +INSERT INTO \
Groups(GID,NAME,DESCRIPTION,TIMESTAMP) VALUES ('102','security','Security \
group',CURRENT_TIMESTAMP); +
+INSERT INTO Organizations(NAME,DESCRIPTION,TIMESTAMP) VALUES ('HR','HR \
organization',CURRENT_TIMESTAMP); +INSERT INTO \
Organizations(NAME,DESCRIPTION,TIMESTAMP) VALUES ('SALES','Sales \
organization',CURRENT_TIMESTAMP); +INSERT INTO \
Organizations(NAME,DESCRIPTION,TIMESTAMP) VALUES ('SUPPORT','Support \
organization',CURRENT_TIMESTAMP); +INSERT INTO \
Organizations(NAME,DESCRIPTION,TIMESTAMP) VALUES ('ENG','Engineering \
organization',CURRENT_TIMESTAMP); +INSERT INTO \
Organizations(NAME,DESCRIPTION,TIMESTAMP) VALUES ('OPERATIONS','Operations \
organization',CURRENT_TIMESTAMP); +
</ins></span></pre>
</div>
</div>
<div id="footer">Copyright (c) by ForgeRock. All rights reserved.</div>

</body>
</html>



_______________________________________________
Commitopenicf mailing list
Commitopenicf@forgerock.org
https://lists.forgerock.org/mailman/listinfo/commitopenicf


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic