DeleteScript.groovy.template revision a5c4e019584526e990bdb898f84300d790ebc708
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering * Copyright (c) 2015 ForgeRock AS. All Rights Reserved
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering * The contents of this file are subject to the terms
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering * of the Common Development and Distribution License
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering * (the License). You may not use this file except in
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering * compliance with the License.
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering * You can obtain a copy of the License at
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering * http://forgerock.org/license/CDDLv1.0.html
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering * See the License for the specific language governing
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering * permission and limitations under the License.
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering * When distributing Covered Code, include this CDDL
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering * Header Notice in each file and include the License file
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering * at http://forgerock.org/license/CDDLv1.0.html
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering * If applicable, add the following below the CDDL Header,
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering * with the fields enclosed by brackets [] replaced by
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering * your own identifying information:
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering * "Portions Copyrighted [year] [name of copyright owner]"
dfdebb1b925332352966804303b2516a6506a429Zbigniew Jędrzejewski-Szmek * Version {{version}}
dfdebb1b925332352966804303b2516a6506a429Zbigniew Jędrzejewski-Szmek * Author {{author}}
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poetteringpackage org.forgerock.openicf.connectors.{{lower packageName}}
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poetteringimport org.forgerock.openicf.connectors.{{lower packageName}}.{{packageName}}Configuration
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poetteringimport org.forgerock.openicf.misc.scriptedcommon.OperationType
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poetteringimport org.identityconnectors.common.logging.Log
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poetteringimport org.identityconnectors.framework.common.objects.ObjectClass
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poetteringimport org.identityconnectors.framework.common.objects.Uid
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering * Built-in accessible objects
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering// OperationType is DELETE for this script
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poetteringdef operation = operation as OperationType
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering// The configuration class created specifically for this connector
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poetteringdef configuration = configuration as {{packageName}}Configuration
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering// Default logging facility
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering// The Uid of the object to be deleted
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering// The objectClass of the object to be deleted, e.g. ACCOUNT or GROUP
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poetteringdef objectClass = objectClass as ObjectClass
870c4365cf3d407270788abe14d216a636ecf6c3Zbigniew Jędrzejewski-Szmek * Script action - Customizable
870c4365cf3d407270788abe14d216a636ecf6c3Zbigniew Jędrzejewski-Szmek * Delete an object in the external source. Connectors that do not support this should
870c4365cf3d407270788abe14d216a636ecf6c3Zbigniew Jędrzejewski-Szmek * throw an UnsupportedOperationException.
870c4365cf3d407270788abe14d216a636ecf6c3Zbigniew Jędrzejewski-Szmek * This script has no return value but should throw an exception is something goes wrong
1fd961211df69ce672252d543bf4777738647048Zbigniew Jędrzejewski-Szmek/* Log something to demonstrate this script executed */
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poetteringlog.info("Delete script, operation = " + operation.toString());
5aded369782f28255bc6b494ca905d7acaea7a56Zbigniew Jędrzejewski-Szmek throw new UnsupportedOperationException(operation.name() + " operation of type:" +
8f7a3c1402a8de36b2c63935358a53510d2fe7c1Lennart Poettering objectClass.objectClassValue + " is not supported.")