001/* 002 * The contents of this file are subject to the terms of the Common Development and 003 * Distribution License (the License). You may not use this file except in compliance with the 004 * License. 005 * 006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the 007 * specific language governing permission and limitations under the License. 008 * 009 * When distributing Covered Software, include this CDDL Header Notice in each file and include 010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL 011 * Header, with the fields enclosed by brackets [] replaced by your own identifying 012 * information: "Portions Copyright [year] [name of copyright owner]". 013 * 014 * Copyright 2008-2009 Sun Microsystems, Inc. 015 * Portions Copyright 2013-2015 ForgeRock AS. 016 */ 017package org.opends.server.tools.dsreplication; 018 019import java.util.LinkedList; 020import java.util.List; 021 022/** 023 * This class is used to store the information provided by the user in the 024 * replication command line. It is required because when we are in interactive 025 * mode the ReplicationCliArgumentParser is not enough. 026 */ 027public abstract class ReplicationUserData 028{ 029 private final LinkedList<String> baseDNs = new LinkedList<>(); 030 private String adminUid; 031 private String adminPwd; 032 033 /** 034 * Returns the Global Administrator password. 035 * @return the Global Administrator password. 036 */ 037 public String getAdminPwd() 038 { 039 return adminPwd; 040 } 041 042 /** 043 * Sets the Global Administrator password. 044 * @param adminPwd the Global Administrator password. 045 */ 046 public void setAdminPwd(String adminPwd) 047 { 048 this.adminPwd = adminPwd; 049 } 050 051 /** 052 * Returns the Global Administrator UID. 053 * @return the Global Administrator UID. 054 */ 055 public String getAdminUid() 056 { 057 return adminUid; 058 } 059 060 /** 061 * Sets the Global Administrator UID. 062 * @param adminUid the Global Administrator UID. 063 */ 064 public void setAdminUid(String adminUid) 065 { 066 this.adminUid = adminUid; 067 } 068 069 /** 070 * Returns the Base DNs to replicate. 071 * @return the Base DNs to replicate. 072 */ 073 public List<String> getBaseDNs() 074 { 075 return new LinkedList<>(baseDNs); 076 } 077 078 /** 079 * Sets the Base DNs to replicate. 080 * @param baseDNs the Base DNs to replicate. 081 */ 082 public void setBaseDNs(List<String> baseDNs) 083 { 084 this.baseDNs.clear(); 085 this.baseDNs.addAll(baseDNs); 086 } 087}