All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dk.grinn.keycloak.migration.jpa.MigrationJpaEntityProvider Maven / Gradle / Ivy

package dk.grinn.keycloak.migration.jpa;

/*-
 * #%L
 * Keycloak : Migrate : Spi
 * %%
 * Copyright (C) 2019 Jonas Grann & Kim Jersin
 * %%
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 * #L%
 */

import dk.grinn.keycloak.migration.entities.GkcadmRealmAttribute;
import dk.grinn.keycloak.migration.entities.RealmHistory;
import dk.grinn.keycloak.migration.entities.RealmHistoryLock;

import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList;
import java.util.List;

import org.keycloak.connections.jpa.entityprovider.JpaEntityProvider;


public class MigrationJpaEntityProvider implements JpaEntityProvider {

    @Override
    public List> getEntities() {
        return unmodifiableList(asList(
                RealmHistory.class,
                RealmHistoryLock.class,
                GkcadmRealmAttribute.class
        ));
    }

    @Override
    public String getChangelogLocation() {
        return "META-INF/dk/grinn/keycloak/migrate/changelog.xml";
    }

    @Override
    public String getFactoryId() {
        return MigrationJpaEntityProviderFactory.ID;
    }

    @Override
    public void close() {
        // Example code
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy