UMA data export, closes #811
parent
a3360e9561
commit
bcd8a96b5d
|
@ -48,12 +48,14 @@ import javax.persistence.TemporalType;
|
|||
@Entity
|
||||
@Table(name = "permission_ticket")
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = PermissionTicket.QUERY_TICKET, query = "select p from PermissionTicket p where p.ticket = :" + PermissionTicket.PARAM_TICKET)
|
||||
@NamedQuery(name = PermissionTicket.QUERY_TICKET, query = "select p from PermissionTicket p where p.ticket = :" + PermissionTicket.PARAM_TICKET),
|
||||
@NamedQuery(name = PermissionTicket.QUERY_ALL, query = "select p from PermissionTicket p")
|
||||
})
|
||||
public class PermissionTicket {
|
||||
|
||||
public static final String QUERY_TICKET = "PermissionTicket.queryByTicket";
|
||||
public static final String PARAM_TICKET = "ticket";
|
||||
public static final String QUERY_ALL = "PermissionTicket.queryAll";
|
||||
|
||||
private Long id;
|
||||
private Permission permission;
|
||||
|
|
|
@ -40,12 +40,14 @@ import javax.persistence.Table;
|
|||
@Table(name = "resource_set")
|
||||
@NamedQueries ({
|
||||
@NamedQuery(name = ResourceSet.QUERY_BY_OWNER, query = "select r from ResourceSet r where r.owner = :" + ResourceSet.PARAM_OWNER),
|
||||
@NamedQuery(name = ResourceSet.QUERY_BY_OWNER_AND_CLIENT, query = "select r from ResourceSet r where r.owner = :" + ResourceSet.PARAM_OWNER + " and r.clientId = :" + ResourceSet.PARAM_CLIENTID)
|
||||
@NamedQuery(name = ResourceSet.QUERY_BY_OWNER_AND_CLIENT, query = "select r from ResourceSet r where r.owner = :" + ResourceSet.PARAM_OWNER + " and r.clientId = :" + ResourceSet.PARAM_CLIENTID),
|
||||
@NamedQuery(name = ResourceSet.QUERY_ALL, query = "select r from ResourceSet r")
|
||||
})
|
||||
public class ResourceSet {
|
||||
|
||||
public static final String QUERY_BY_OWNER = "ResourceSet.queryByOwner";
|
||||
public static final String QUERY_BY_OWNER_AND_CLIENT = "ResourceSet.queryByOwnerAndClient";
|
||||
public static final String QUERY_ALL = "ResourceSet.queryAll";
|
||||
|
||||
public static final String PARAM_OWNER = "owner";
|
||||
public static final String PARAM_CLIENTID = "clientId";
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
package org.mitre.uma.repository;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.mitre.uma.model.PermissionTicket;
|
||||
|
||||
/**
|
||||
|
@ -42,4 +44,9 @@ public interface PermissionRepository {
|
|||
*/
|
||||
public PermissionTicket getByTicket(String ticket);
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public Collection<PermissionTicket> getAll();
|
||||
|
||||
}
|
||||
|
|
|
@ -37,4 +37,6 @@ public interface ResourceSetRepository {
|
|||
|
||||
public Collection<ResourceSet> getAllForOwnerAndClient(String owner, String clientId);
|
||||
|
||||
public Collection<ResourceSet> getAll();
|
||||
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package org.mitre.uma.service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import org.mitre.uma.model.PermissionTicket;
|
||||
|
@ -55,4 +56,9 @@ public interface PermissionService {
|
|||
*/
|
||||
public PermissionTicket updateTicket(PermissionTicket ticket);
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public Collection<PermissionTicket> getAll();
|
||||
|
||||
}
|
||||
|
|
|
@ -41,4 +41,6 @@ public interface ResourceSetService {
|
|||
|
||||
public Collection<ResourceSet> getAllForOwnerAndClient(String owner, String authClientId);
|
||||
|
||||
public Collection<ResourceSet> getAll();
|
||||
|
||||
}
|
||||
|
|
|
@ -64,4 +64,9 @@ public class DummyResourceSetService implements ResourceSetService {
|
|||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ResourceSet> getAll() {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -215,7 +215,7 @@ public class MITREidDataService_1_2 extends MITREidDataServiceSupport implements
|
|||
writeSystemScopes(writer);
|
||||
writer.endArray();
|
||||
|
||||
writer.endObject(); // end mitreid-connect-1.1
|
||||
writer.endObject(); // end mitreid-connect-1.2
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -17,6 +17,8 @@
|
|||
|
||||
package org.mitre.uma.repository.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.TypedQuery;
|
||||
|
@ -53,4 +55,13 @@ public class JpaPermissionRepository implements PermissionRepository {
|
|||
return JpaUtil.getSingleResult(query.getResultList());
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.mitre.uma.repository.PermissionRepository#getAll()
|
||||
*/
|
||||
@Override
|
||||
public Collection<PermissionTicket> getAll() {
|
||||
TypedQuery<PermissionTicket> query = em.createNamedQuery(PermissionTicket.QUERY_ALL, PermissionTicket.class);
|
||||
return query.getResultList();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -78,5 +78,11 @@ public class JpaResourceSetRepository implements ResourceSetRepository {
|
|||
query.setParameter(ResourceSet.PARAM_CLIENTID, clientId);
|
||||
return query.getResultList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ResourceSet> getAll() {
|
||||
TypedQuery<ResourceSet> query = em.createNamedQuery(ResourceSet.QUERY_ALL, ResourceSet.class);
|
||||
return query.getResultList();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
package org.mitre.uma.service.impl;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -92,6 +93,14 @@ public class DefaultPermissionService implements PermissionService {
|
|||
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.mitre.uma.service.PermissionService#getAll()
|
||||
*/
|
||||
@Override
|
||||
public Collection<PermissionTicket> getAll() {
|
||||
return repository.getAll();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -115,5 +115,13 @@ public class DefaultResourceSetService implements ResourceSetService {
|
|||
// we've checked everything, we're good
|
||||
return true;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.mitre.uma.service.ResourceSetService#getAll()
|
||||
*/
|
||||
@Override
|
||||
public Collection<ResourceSet> getAll() {
|
||||
return repository.getAll();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
package org.mitre.uma.service.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.TypedQuery;
|
||||
|
@ -80,5 +82,13 @@ public class JpaRegisteredClientService implements RegisteredClientService {
|
|||
SavedRegisteredClient saved = JpaUtil.getSingleResult(query.getResultList());
|
||||
return saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public Collection<SavedRegisteredClient> getAll() {
|
||||
TypedQuery<SavedRegisteredClient> query = em.createQuery("SELECT c from SavedRegisteredClient c", SavedRegisteredClient.class);
|
||||
return query.getResultList();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue