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 legal-notices/CDDLv1_0.txt 010 * or http://forgerock.org/license/CDDLv1.0.html. 011 * See the License for the specific language governing permissions 012 * and limitations under the License. 013 * 014 * When distributing Covered Code, include this CDDL HEADER in each 015 * file and include the License file at legal-notices/CDDLv1_0.txt. 016 * If applicable, add the following below this CDDL HEADER, with the 017 * fields enclosed by brackets "[]" replaced with your own identifying 018 * information: 019 * Portions Copyright [yyyy] [name of copyright owner] 020 * 021 * CDDL HEADER END 022 * 023 * 024 * Copyright 2008-2009 Sun Microsystems, Inc. 025 * Portions Copyright 2013-2015 ForgeRock AS. 026 */ 027package org.opends.server.tools.dsreplication; 028 029import java.util.LinkedList; 030import java.util.List; 031 032/** 033 * This class is used to store the information provided by the user in the 034 * replication command line. It is required because when we are in interactive 035 * mode the ReplicationCliArgumentParser is not enough. 036 */ 037public abstract class ReplicationUserData 038{ 039 private final LinkedList<String> baseDNs = new LinkedList<>(); 040 private String adminUid; 041 private String adminPwd; 042 043 /** 044 * Returns the Global Administrator password. 045 * @return the Global Administrator password. 046 */ 047 public String getAdminPwd() 048 { 049 return adminPwd; 050 } 051 052 /** 053 * Sets the Global Administrator password. 054 * @param adminPwd the Global Administrator password. 055 */ 056 public void setAdminPwd(String adminPwd) 057 { 058 this.adminPwd = adminPwd; 059 } 060 061 /** 062 * Returns the Global Administrator UID. 063 * @return the Global Administrator UID. 064 */ 065 public String getAdminUid() 066 { 067 return adminUid; 068 } 069 070 /** 071 * Sets the Global Administrator UID. 072 * @param adminUid the Global Administrator UID. 073 */ 074 public void setAdminUid(String adminUid) 075 { 076 this.adminUid = adminUid; 077 } 078 079 /** 080 * Returns the Base DNs to replicate. 081 * @return the Base DNs to replicate. 082 */ 083 public List<String> getBaseDNs() 084 { 085 return new LinkedList<>(baseDNs); 086 } 087 088 /** 089 * Sets the Base DNs to replicate. 090 * @param baseDNs the Base DNs to replicate. 091 */ 092 public void setBaseDNs(List<String> baseDNs) 093 { 094 this.baseDNs.clear(); 095 this.baseDNs.addAll(baseDNs); 096 } 097}