001/*
002 * Copyright 2015-2024 the original author or authors
003 *
004 * This software is licensed under the Apache License, Version 2.0,
005 * the GNU Lesser General Public License version 2 or later ("LGPL")
006 * and the WTFPL.
007 * You may choose either license to govern your use of this software only
008 * upon the condition that you accept all of the terms of either
009 * the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
010 */
011package org.minidns.hla.srv;
012
013import org.minidns.dnslabel.DnsLabel;
014
015public enum SrvService {
016
017    // @formatter:off
018    xmpp_client,
019    xmpp_server,
020
021    /**
022     * XMPP client-to-server (c2s) connections using implicit TLS (also known as "Direct TLS").
023     *
024     * @see <a href="https://xmpp.org/extensions/xep-0368.html">XEP-0368: SRV records for XMPP over TLS</a>
025     */
026    xmpps_client,
027
028    /**
029     * XMPP server-to-server (s2s) connections using implicit TLS (also known as "Direct TLS").
030     *
031     * @see <a href="https://xmpp.org/extensions/xep-0368.html">XEP-0368: SRV records for XMPP over TLS</a>
032     */
033    xmpps_server,
034    ;
035    // @formatter:on
036
037    public final DnsLabel dnsLabel;
038
039    SrvService() {
040        String enumName = name().replaceAll("_", "-");
041        dnsLabel = DnsLabel.from('_' + enumName);
042    }
043}