/*
 * Password Management Servlets (PWM)
 * http://www.pwm-project.org
 *
 * Copyright (c) 2006-2009 Novell, Inc.
 * Copyright (c) 2009-2021 The PWM Project
 *
 * Licensed 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 password.pwm.util.logging;

import org.slf4j.Marker;

import java.util.Collections;
import java.util.Iterator;

/**
 * Simple marker instance used to indicate an event was generated by a PwmLogger instance.
 */
public class PwmLogbackMarker implements Marker
{
    private static final PwmLogbackMarker SINGLETON = new PwmLogbackMarker();

    static Marker singleton()
    {
        return SINGLETON;
    }

    private PwmLogbackMarker()
    {
    }

    @Override
    public String getName()
    {
        return PwmLogbackMarker.class.getName();
    }

    @Override
    public void add( final Marker reference )
    {

    }

    @Override
    public boolean remove( final Marker reference )
    {
        return false;
    }

    @Override
    public boolean hasChildren()
    {
        return false;
    }

    @Override
    public boolean hasReferences()
    {
        return false;
    }

    @Override
    public Iterator<Marker> iterator()
    {
        return Collections.emptyIterator();
    }

    @Override
    public boolean contains( final Marker other )
    {
        return false;
    }

    @Override
    public boolean contains( final String name )
    {
        return false;
    }

    @Override
    public int hashCode()
    {
        return 0;
    }

    @Override
    public boolean equals( final Object obj )
    {
        return obj instanceof PwmLogbackMarker;
    }
}
