-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
41 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 7 additions & 5 deletions
12
...edu/internet2/tier/shibboleth/admin/ui/configuration/EntitiesVersioningConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.configuration; | ||
|
||
import edu.internet2.tier.shibboleth.admin.ui.service.EntityDescriptorService; | ||
import edu.internet2.tier.shibboleth.admin.ui.service.EntityDescriptorVersionService; | ||
import edu.internet2.tier.shibboleth.admin.ui.service.EnversEntityDescriptorVersionService; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import javax.persistence.EntityManager; | ||
|
||
@Configuration | ||
public class EntitiesVersioningConfiguration { | ||
|
||
//@Bean | ||
EntityDescriptorVersionService entityDescriptorVersionService(EntityDescriptorService entityDescriptorService) { | ||
//TODO create real impl when available | ||
return null; | ||
@Bean | ||
EntityDescriptorVersionService entityDescriptorVersionService(EntityManager entityManager) { | ||
return new EnversEntityDescriptorVersionService(entityManager); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
.../edu/internet2/tier/shibboleth/admin/ui/service/EnversEntityDescriptorVersionService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.service; | ||
|
||
import edu.internet2.tier.shibboleth.admin.ui.domain.frontend.EntityDescriptorRepresentation; | ||
import edu.internet2.tier.shibboleth.admin.ui.domain.versioning.Version; | ||
import org.hibernate.envers.AuditReader; | ||
import org.hibernate.envers.AuditReaderFactory; | ||
|
||
import javax.persistence.EntityManager; | ||
import java.util.List; | ||
|
||
/** | ||
* Hibernate Envers based implementation of {@link EntityDescriptorVersionService}. | ||
*/ | ||
public class EnversEntityDescriptorVersionService implements EntityDescriptorVersionService { | ||
|
||
private AuditReader auditReader; | ||
|
||
public EnversEntityDescriptorVersionService(EntityManager em) { | ||
|
||
this.auditReader = AuditReaderFactory.get(em); | ||
} | ||
|
||
@Override | ||
public List<Version> findVersionsForEntityDescriptor(String resourceId) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public EntityDescriptorRepresentation findSpecificVersionOfEntityDescriptor(String resourceId, String versionId) { | ||
return null; | ||
} | ||
} |