<commit_before>/*
 *   Licensed to the Apache Software Foundation (ASF) under one
 *   or more contributor license agreements.  See the NOTICE file
 *   distributed with this work for additional information
 *   regarding copyright ownership.  The ASF licenses this file
 *   to you under the Apache License, Version 2.0 (the
 *   "License"); you may not use this file except in compliance
 *   with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing,
 *   software distributed under the License is distributed on an
 *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *   KIND, either express or implied.  See the License for the
 *   specific language governing permissions and limitations
 *   under the License.
 *
 */

package org.apache.directory.server.ldap.replication;


import javax.naming.InvalidNameException;

import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.util.LdapURL;
import org.apache.directory.shared.ldap.util.StringTools;

/**
 * A configuration for a replica peer. We may have many replications relation
 * set for a server, each one of them being described with this structure. 
 *
 * @org.apache.xbean.XBean
 * @author <a href="mailto:<EMAIL>">Apache Directory Project</a>
 * @version $Rev$, $Date$
 */
public class ReplicaPeerConfiguration
{
    /** A flag used when the replication use the RefreshOnly system */
    private boolean refreshOnly;
    
    /** The time to wait between two consecutive RefreshOnly replication*/
    private long interval;
    
    /** Default interval is 5 minutes */
    private static final long DEFAULT_INTERVAL = 1000L*5L*60L;
    
    /** The default host */
    private static final String DEFAULT_HOST = "localhost";
    
    /** The default ssl port */
    private static final int DEFAULT_PORT = 10389;
    
    /** The default port */
    private static final int DEFAULT_SSL_PORT = 10686;
    
    /** The producer we want to replicate */
    private LdapURL producer;
    
    /** The principal to use to connect to the producer */
    private LdapDN principalDN;
    
    /** The principal's password */
    private String password;
    
    /** The producer's host */
    private String host;
    
    /** The producer's port */
    private int port;<commit_msg>o Fixed a NPE when no server.xml is provided o Fixed another NPE : LDAPS was not correctly initialized when the default config is used.  o Replaced 686 by 636 everywhere it was used by mistake<commit_after>/*
 *   Licensed to the Apache Software Foundation (ASF) under one
 *   or more contributor license agreements.  See the NOTICE file
 *   distributed with this work for additional information
 *   regarding copyright ownership.  The ASF licenses this file
 *   to you under the Apache License, Version 2.0 (the
 *   "License"); you may not use this file except in compliance
 *   with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing,
 *   software distributed under the License is distributed on an
 *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *   KIND, either express or implied.  See the License for the
 *   specific language governing permissions and limitations
 *   under the License.
 *
 */

package org.apache.directory.server.ldap.replication;


import javax.naming.InvalidNameException;

import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.util.LdapURL;
import org.apache.directory.shared.ldap.util.StringTools;

/**
 * A configuration for a replica peer. We may have many replications relation
 * set for a server, each one of them being described with this structure. 
 *
 * @org.apache.xbean.XBean
 * @author <a href="mailto:<EMAIL>">Apache Directory Project</a>
 * @version $Rev$, $Date$
 */
public class ReplicaPeerConfiguration
{
    /** A flag used when the replication use the RefreshOnly system */
    private boolean refreshOnly;
    
    /** The time to wait between two consecutive RefreshOnly replication*/
    private long interval;
    
    /** Default interval is 5 minutes */
    private static final long DEFAULT_INTERVAL = 1000L*5L*60L;
    
    /** The default host */
    private static final String DEFAULT_HOST = "localhost";
    
    /** The default ssl port */
    private static final int DEFAULT_PORT = 10389;
    
    /** The default port */
    private static final int DEFAULT_SSL_PORT = 10636;
    
    /** The producer we want to replicate */
    private LdapURL producer;
    
    /** The principal to use to connect to the producer */
    private LdapDN principalDN;
    
    /** The principal's password */
    private String password;
    
    /** The producer's host */
    private String host;
    
    /** The producer's port */
    private int port;
{'fraction_non_alphanumeric': 0.07982132452903476, 'fraction_numerical': 0.009710623422023694, 'mean_word_length': 3.1768045417680453, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6208210', 'n_tokens_mistral': 1410, 'n_tokens_neox': 1367, 'n_words': 563}