Purpose.java 1.81 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
package org.jivesoftware.openfire.keystore;

/**
 * Potential intended usages for keystores
 *
 * @author Guus der Kinderen, guus.der.kinderen@gmail.com
 */
public enum Purpose
{
    /**
     * Identification of this Openfire instance used by regular socket-based connections.
     */
    SOCKETBASED_IDENTITYSTORE( false ),

    /**
     * Identification of remote servers that you choose to trust, applies to server-to-server federation via regular socket-based connections.
     */
    SOCKETBASED_S2S_TRUSTSTORE( true ),

    /**
     * Identification of clients that you choose to trust, applies to mutual authentication via regular socket-based connections.
     */
    SOCKETBASED_C2S_TRUSTSTORE( true ),

    /**
     * Identification of this Openfire instance used by regular BOSH (HTTP-bind) connections.
     */
    BOSHBASED_IDENTITYSTORE( false ),

    /**
     * Identification of clients that you choose to trust, applies to mutual authentication via BOSH (HTTP-bind) connections.
     */
    BOSHBASED_C2S_TRUSTSTORE( true ),

    /**
     * Identification of this Openfire instance used by connections to administrative services (eg: user providers).
     */
    ADMINISTRATIVE_IDENTITYSTORE( false ),

    /**
     * Identification of remote applications/servers that provide administrative functionality (eg: user providers).
     */
    ADMINISTRATIVE_TRUSTSTORE( true ),

    /**
     * Openfire web-admin console.
     */
    WEBADMIN_IDENTITYSTORE( false ),

    /**
     * Openfire web-admin console.
     */
    WEBADMIN_TRUSTSTORE( true );

    private final boolean isTrustStore;

    Purpose( boolean isTrustStore )
    {
        this.isTrustStore = isTrustStore;
    }

    public boolean isIdentityStore()
    {
        return !isTrustStore;
    }

    public boolean isTrustStore()
    {
        return isTrustStore;
    }
}