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 2011-2014 UnboundID Corp. 026 */ 027 package com.unboundid.directory.sdk.sync.types; 028 029 import java.util.Collection; 030 import java.util.List; 031 032 /** 033 * This interface represents the matched Sync Class for a {@link SyncOperation}. 034 * While several Sync Classes may be defined for a Sync Pipe, an operation will 035 * only match at most one of them. This can be used to obtain some of the 036 * configured values for a particular Sync Class. 037 */ 038 public interface SyncClass 039 { 040 /** 041 * Returns the name of this Sync Class. 042 * 043 * @return a String representing the name of this Sync Class. This will never 044 * be null. 045 */ 046 String getName(); 047 048 049 /** 050 * Returns the configured description for this Sync Class. 051 * 052 * @return a String representing the description for this Sync Class. This 053 * may be null if no description is configured. 054 */ 055 String getDescription(); 056 057 058 /** 059 * Returns the set(s) of destination correlation attributes that are 060 * configured on this Sync Class. When multiple attribute sets are configured, 061 * the server iterates through them and uses the 062 * first one that matches a single entry. Note that if the 063 * <i>destination-correlation-attributes-on-delete</i> property 064 * is set, then only those attributes will be used when correlating deleted 065 * entries. 066 * 067 * @return a List of attribute sets. This will never be null. 068 */ 069 List<Collection<String>> getDestinationCorrelationAttributes(); 070 071 072 /** 073 * Returns the set(s) of destination correlation attributes that are 074 * configured on this Sync Class for DELETE operations. When multiple 075 * attribute sets are configured, the server iterates through them and uses 076 * the first one that matches a single entry. Note that if the 077 * <i>destination-correlation-attributes-on-delete</i> property 078 * is not set, then the standard destination correlation attributes will be 079 * used to correlate deleted entries. 080 * 081 * @return a List of attribute sets. This will never be null. 082 */ 083 List<Collection<String>> getDestinationCorrelationAttributesOnDelete(); 084 085 086 /** 087 * Returns the set of attributes that are never allowed to be modified once 088 * an entry is created. 089 * 090 * @return a Collection of attribute names. This will never be null. 091 */ 092 Collection<String> getDestinationCreateOnlyAttributes(); 093 094 095 /** 096 * Returns whether this Sync Class will prevent writes to the destination that 097 * contain empty (zero-length) values. Some servers do not allow this 098 * behavior. 099 * 100 * @return true if this Sync Class is configured to ignore zero-length values 101 * (e.g. prevent them from being written), or false otherwise. 102 */ 103 boolean isIgnoreZeroLengthValues(); 104 105 106 /** 107 * Returns whether this Sync Class will use the ADD/DELETE modification type 108 * or the REPLACE modification type when making modifications on the 109 * destination. 110 * 111 * @return true if the ADD/DELETE modification types will be use, false if the 112 * REPLACE modification type will be used. 113 */ 114 boolean isUseReversibleForm(); 115 116 117 /** 118 * Returns whether this Sync class will convert modify operations into create 119 * operations if the destination entry to be modified does not exist. 120 * 121 * @return true if the Sync Class will allow modifies to be converted to 122 * creates, false otherwise. 123 */ 124 boolean isModifiesAsCreates(); 125 126 127 /** 128 * Returns whether this Sync class will convert create operations into modify 129 * operations if the destination entry to be modified already exists. 130 * 131 * @return true if the Sync Class will allow creates to be converted to 132 * modifies, false otherwise. 133 */ 134 boolean isCreatesAsModifies(); 135 136 }