001/* 002 * CDDL HEADER START 003 * 004 * The contents of this file are subject to the terms of the 005 * Common Development and Distribution License, Version 1.0 only 006 * (the "License"). You may not use this file except in compliance 007 * with the License. 008 * 009 * You can obtain a copy of the license at 010 * docs/licenses/cddl.txt 011 * or http://www.opensource.org/licenses/cddl1.php. 012 * See the License for the specific language governing permissions 013 * and limitations under the License. 014 * 015 * When distributing Covered Code, include this CDDL HEADER in each 016 * file and include the License file at 017 * docs/licenses/cddl.txt. If applicable, 018 * add the following below this CDDL HEADER, with the fields enclosed 019 * by brackets "[]" replaced with your own identifying information: 020 * Portions Copyright [yyyy] [name of copyright owner] 021 * 022 * CDDL HEADER END 023 * 024 * 025 * Copyright 2010-2021 Ping Identity Corporation 026 */ 027package com.unboundid.directory.sdk.sync.types; 028 029 030 031import com.unboundid.directory.sdk.common.types.ServerContext; 032import com.unboundid.ldap.sdk.Entry; 033import com.unboundid.ldap.sdk.LDAPException; 034import com.unboundid.util.NotExtensible; 035import com.unboundid.util.ThreadSafety; 036import com.unboundid.util.ThreadSafetyLevel; 037 038import java.util.Collection; 039import java.util.Set; 040 041 042/** 043 * This interface may be used to obtain information about the 044 * Data Sync Server in which an extension is running. 045 */ 046@NotExtensible() 047@ThreadSafety(level=ThreadSafetyLevel.INTERFACE_THREADSAFE) 048public interface SyncServerContext 049 extends ServerContext 050{ 051 /** 052 * Returns an entry that has had the DN and attributes mapped according to the 053 * maps specified by dnMapNames and attributeMapNames. 054 * 055 * @param sourceEntry 056 * The source entry to map. 057 * 058 * @param dnMapNames 059 * The names of the DN maps in the configuration that should be 060 * applied. This list can be empty if no DN maps should be applied. 061 * Multiple DN maps can be specified if source DNs might match 062 * different DN patterns. The most specific patterns should be 063 * specified first. 064 * 065 * @param attributeMapNames 066 * The names of the attribute maps in the configuration that should 067 * be applied. This list can be empty if no attribute mappings 068 * should be applied. This parameter works in conjunction with the 069 * autoMappedSrcAttributes and excludedAutoMapAttributes parameters. 070 * 071 * @param autoMappedSrcAttributes 072 * The set of source attribute names that should be automatically 073 * mapped to a destination attribute with the same name. You can 074 * use the special values '-all-' to auto-map every Sync Source 075 * attribute, and '-none-' to not auto-map any Sync Source 076 * attributes. 077 * 078 * @param excludedAutoMapAttributes 079 * The set of source attribute names that should not be automatically 080 * mapped to a destination attribute with the same name. 081 * 082 * @param excludedAutoMapAttributeRegex 083 * A set of regular expressions that match source attribute names 084 * that should not be automatically mapped to a destination 085 * attribute with the same name. 086 * 087 * @return An entry that has had the DN and attributes mapped according to 088 * the information given above. 089 * 090 * @throws LDAPException 091 * If the mapping fails. 092 */ 093 Entry applyMaps(final Entry sourceEntry, 094 final Collection<String> dnMapNames, 095 final Collection<String> attributeMapNames, 096 final Set<String> autoMappedSrcAttributes, 097 final Set<String> excludedAutoMapAttributes, 098 final Set<String> excludedAutoMapAttributeRegex) 099 throws LDAPException; 100}