/*
 * 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.camel.component.keycloak.springboot;

import org.apache.camel.component.keycloak.KeycloakConfiguration;
import org.apache.camel.component.keycloak.KeycloakOperations;
import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
import org.keycloak.admin.client.Keycloak;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * Manage Keycloak instances via Admin API.
 * 
 * Generated by camel-package-maven-plugin - do not edit this file!
 */
@ConfigurationProperties(prefix = "camel.component.keycloak")
public class KeycloakComponentConfiguration
        extends
            ComponentConfigurationPropertiesCommon {

    /**
     * Whether to enable auto configuration of the keycloak component. This is
     * enabled by default.
     */
    private Boolean enabled;
    /**
     * Pre-obtained access token for authentication. When provided, this token
     * will be used directly instead of obtaining one through username/password
     * or client credentials flow.
     */
    private String accessToken;
    /**
     * Filter admin events by authentication client ID
     */
    private String authClient;
    /**
     * Filter admin events by authentication IP address
     */
    private String authIpAddress;
    /**
     * Keycloak realm to authenticate against. If not specified, the realm
     * parameter is used for authentication. This is useful when you want to
     * authenticate against one realm (e.g., master) but perform operations on
     * another realm.
     */
    private String authRealm = "master";
    /**
     * Filter admin events by authentication realm
     */
    private String authRealmFilter;
    /**
     * Filter admin events by authentication user ID
     */
    private String authUser;
    /**
     * Filter events by client ID
     */
    private String client;
    /**
     * Keycloak client ID
     */
    private String clientId;
    /**
     * Keycloak client secret
     */
    private String clientSecret;
    /**
     * Component configuration. The option is a
     * org.apache.camel.component.keycloak.KeycloakConfiguration type.
     */
    private KeycloakConfiguration configuration;
    /**
     * Filter events by start date/time in milliseconds since epoch
     */
    private String dateFrom;
    /**
     * Filter events by end date/time in milliseconds since epoch
     */
    private String dateTo;
    /**
     * Type of events to consume: events or admin-events
     */
    private String eventType = "events";
    /**
     * Offset for pagination (first result index)
     */
    private Integer first = 0;
    /**
     * Enable caching of token introspection results to reduce API calls to
     * Keycloak
     */
    private Boolean introspectionCacheEnabled = true;
    /**
     * Time-to-live for cached introspection results in seconds
     */
    private Long introspectionCacheTtl = 60L;
    /**
     * Filter events by IP address
     */
    private String ipAddress;
    /**
     * To use an existing configured Keycloak admin client. The option is a
     * org.keycloak.admin.client.Keycloak type.
     */
    private Keycloak keycloakClient;
    /**
     * Maximum number of events to retrieve per poll
     */
    private Integer maxResults = 100;
    /**
     * The operation to perform
     */
    private KeycloakOperations operation;
    /**
     * Filter admin events by operation types (comma-separated list, e.g.,
     * CREATE,UPDATE,DELETE)
     */
    private String operationTypes;
    /**
     * Keycloak password
     */
    private String password;
    /**
     * If we want to use a POJO request as body or not
     */
    private Boolean pojoRequest = false;
    /**
     * Keycloak realm, the default is master because usually all the operations
     * are done starting from the master realm
     */
    private String realm = "master";
    /**
     * Filter admin events by resource path
     */
    private String resourcePath;
    /**
     * Keycloak server URL
     */
    private String serverUrl;
    /**
     * Filter events by event types (comma-separated list, e.g., LOGIN,LOGOUT)
     */
    private String types;
    /**
     * Filter events by user ID
     */
    private String user;
    /**
     * Keycloak username
     */
    private String username;
    /**
     * Enable OAuth 2.0 token introspection for real-time token validation. When
     * enabled, tokens are validated by calling Keycloak's introspection
     * endpoint instead of local JWT parsing. This allows detecting revoked
     * tokens before expiration.
     */
    private Boolean useTokenIntrospection = false;
    /**
     * Allows for bridging the consumer to the Camel routing Error Handler,
     * which mean any exceptions (if possible) occurred while the Camel consumer
     * is trying to pickup incoming messages, or the likes, will now be
     * processed as a message and handled by the routing Error Handler.
     * Important: This is only possible if the 3rd party component allows Camel
     * to be alerted if an exception was thrown. Some components handle this
     * internally only, and therefore bridgeErrorHandler is not possible. In
     * other situations we may improve the Camel component to hook into the 3rd
     * party component and make this possible for future releases. By default
     * the consumer will use the org.apache.camel.spi.ExceptionHandler to deal
     * with exceptions, that will be logged at WARN or ERROR level and ignored.
     */
    private Boolean bridgeErrorHandler = false;
    /**
     * Whether the producer should be started lazy (on the first message). By
     * starting lazy you can use this to allow CamelContext and routes to
     * startup in situations where a producer may otherwise fail during starting
     * and cause the route to fail being started. By deferring this startup to
     * be lazy then the startup failure can be handled during routing messages
     * via Camel's routing error handlers. Beware that when the first message is
     * processed then creating and starting the producer may take a little time
     * and prolong the total processing time of the processing.
     */
    private Boolean lazyStartProducer = false;
    /**
     * Whether autowiring is enabled. This is used for automatic autowiring
     * options (the option must be marked as autowired) by looking up in the
     * registry to find if there is a single instance of matching type, which
     * then gets configured on the component. This can be used for automatic
     * configuring JDBC data sources, JMS connection factories, AWS Clients,
     * etc.
     */
    private Boolean autowiredEnabled = true;

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public String getAuthClient() {
        return authClient;
    }

    public void setAuthClient(String authClient) {
        this.authClient = authClient;
    }

    public String getAuthIpAddress() {
        return authIpAddress;
    }

    public void setAuthIpAddress(String authIpAddress) {
        this.authIpAddress = authIpAddress;
    }

    public String getAuthRealm() {
        return authRealm;
    }

    public void setAuthRealm(String authRealm) {
        this.authRealm = authRealm;
    }

    public String getAuthRealmFilter() {
        return authRealmFilter;
    }

    public void setAuthRealmFilter(String authRealmFilter) {
        this.authRealmFilter = authRealmFilter;
    }

    public String getAuthUser() {
        return authUser;
    }

    public void setAuthUser(String authUser) {
        this.authUser = authUser;
    }

    public String getClient() {
        return client;
    }

    public void setClient(String client) {
        this.client = client;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getClientSecret() {
        return clientSecret;
    }

    public void setClientSecret(String clientSecret) {
        this.clientSecret = clientSecret;
    }

    public KeycloakConfiguration getConfiguration() {
        return configuration;
    }

    public void setConfiguration(KeycloakConfiguration configuration) {
        this.configuration = configuration;
    }

    public String getDateFrom() {
        return dateFrom;
    }

    public void setDateFrom(String dateFrom) {
        this.dateFrom = dateFrom;
    }

    public String getDateTo() {
        return dateTo;
    }

    public void setDateTo(String dateTo) {
        this.dateTo = dateTo;
    }

    public String getEventType() {
        return eventType;
    }

    public void setEventType(String eventType) {
        this.eventType = eventType;
    }

    public Integer getFirst() {
        return first;
    }

    public void setFirst(Integer first) {
        this.first = first;
    }

    public Boolean getIntrospectionCacheEnabled() {
        return introspectionCacheEnabled;
    }

    public void setIntrospectionCacheEnabled(Boolean introspectionCacheEnabled) {
        this.introspectionCacheEnabled = introspectionCacheEnabled;
    }

    public Long getIntrospectionCacheTtl() {
        return introspectionCacheTtl;
    }

    public void setIntrospectionCacheTtl(Long introspectionCacheTtl) {
        this.introspectionCacheTtl = introspectionCacheTtl;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public Keycloak getKeycloakClient() {
        return keycloakClient;
    }

    public void setKeycloakClient(Keycloak keycloakClient) {
        this.keycloakClient = keycloakClient;
    }

    public Integer getMaxResults() {
        return maxResults;
    }

    public void setMaxResults(Integer maxResults) {
        this.maxResults = maxResults;
    }

    public KeycloakOperations getOperation() {
        return operation;
    }

    public void setOperation(KeycloakOperations operation) {
        this.operation = operation;
    }

    public String getOperationTypes() {
        return operationTypes;
    }

    public void setOperationTypes(String operationTypes) {
        this.operationTypes = operationTypes;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Boolean getPojoRequest() {
        return pojoRequest;
    }

    public void setPojoRequest(Boolean pojoRequest) {
        this.pojoRequest = pojoRequest;
    }

    public String getRealm() {
        return realm;
    }

    public void setRealm(String realm) {
        this.realm = realm;
    }

    public String getResourcePath() {
        return resourcePath;
    }

    public void setResourcePath(String resourcePath) {
        this.resourcePath = resourcePath;
    }

    public String getServerUrl() {
        return serverUrl;
    }

    public void setServerUrl(String serverUrl) {
        this.serverUrl = serverUrl;
    }

    public String getTypes() {
        return types;
    }

    public void setTypes(String types) {
        this.types = types;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Boolean getUseTokenIntrospection() {
        return useTokenIntrospection;
    }

    public void setUseTokenIntrospection(Boolean useTokenIntrospection) {
        this.useTokenIntrospection = useTokenIntrospection;
    }

    public Boolean getBridgeErrorHandler() {
        return bridgeErrorHandler;
    }

    public void setBridgeErrorHandler(Boolean bridgeErrorHandler) {
        this.bridgeErrorHandler = bridgeErrorHandler;
    }

    public Boolean getLazyStartProducer() {
        return lazyStartProducer;
    }

    public void setLazyStartProducer(Boolean lazyStartProducer) {
        this.lazyStartProducer = lazyStartProducer;
    }

    public Boolean getAutowiredEnabled() {
        return autowiredEnabled;
    }

    public void setAutowiredEnabled(Boolean autowiredEnabled) {
        this.autowiredEnabled = autowiredEnabled;
    }
}