Refs #11902: Use new REST interface in Resource Registry Client
Task-Url: https://support.d4science.org/issues/11902 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry-client@169061 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
296d22363e
commit
9056e3ec82
|
@ -7,12 +7,10 @@ import java.util.UUID;
|
|||
import org.gcube.informationsystem.model.ER;
|
||||
import org.gcube.informationsystem.model.ISManageable;
|
||||
import org.gcube.informationsystem.model.entity.Context;
|
||||
import org.gcube.informationsystem.model.entity.Entity;
|
||||
import org.gcube.informationsystem.model.entity.Facet;
|
||||
import org.gcube.informationsystem.model.entity.Resource;
|
||||
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
||||
import org.gcube.informationsystem.model.relation.IsRelatedTo;
|
||||
import org.gcube.informationsystem.model.relation.Relation;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.AvailableInAnotherContextException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||
|
@ -84,11 +82,11 @@ public interface ResourceRegistryClient {
|
|||
public String getRelatedResources(String resourceType, String isRelatedToType, String referenceResourceType,
|
||||
Direction direction, boolean polymorphic) throws ResourceRegistryException;
|
||||
|
||||
/*
|
||||
public <E extends Entity, R extends Relation<?,?>, RE extends Entity> List<E> getRelated(Class<E> entityClass,
|
||||
Class<R> relationClass, Class<RE> referenceEntityClass, Direction direction, boolean polymorphic,
|
||||
Map<String,Object> map) throws ResourceRegistryException;
|
||||
|
||||
|
||||
public String getRelated(String entityType, String relationType, String referenceEntityType, Direction direction,
|
||||
boolean polymorphic, Map<String,Object> map) throws ResourceRegistryException;
|
||||
|
||||
|
@ -102,7 +100,7 @@ public interface ResourceRegistryClient {
|
|||
|
||||
public String getRelated(String entityType, String relationType, String referenceEntityType, UUID referenceEntity,
|
||||
Direction direction, boolean polymorphic) throws ResourceRegistryException;
|
||||
|
||||
*/
|
||||
|
||||
|
||||
public String query(final String query, final int limit, final String fetchPlan)
|
||||
|
|
|
@ -351,7 +351,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
|||
stringWriter.append(PATH_SEPARATOR);
|
||||
stringWriter.append(referenceEntityType);
|
||||
|
||||
Map<String,Object> parameters = new HashMap<>(map);
|
||||
Map<String,Object> parameters = new HashMap<>();
|
||||
parameters.put(AccessPath.DIRECTION_PARAM, direction);
|
||||
parameters.put(AccessPath.POLYMORPHIC_PARAM, polymorphic);
|
||||
|
||||
|
@ -501,8 +501,8 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <E extends Entity, R extends Relation<?,?>, RE extends Entity> List<E> getRelated(Class<E> entityClass,
|
||||
// @Override
|
||||
protected <E extends Entity, R extends Relation<?,?>, RE extends Entity> List<E> getRelated(Class<E> entityClass,
|
||||
Class<R> relationClass, Class<RE> referenceEntityClass, Direction direction, boolean polymorphic,
|
||||
Map<String,Object> map) throws ResourceRegistryException {
|
||||
String entityType = Utility.getType(entityClass);
|
||||
|
@ -516,14 +516,14 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRelated(String entityType, String relationType, String referenceEntityType, Direction direction,
|
||||
// @Override
|
||||
protected String getRelated(String entityType, String relationType, String referenceEntityType, Direction direction,
|
||||
boolean polymorphic, Map<String,Object> map) throws ResourceRegistryException {
|
||||
return getRelated(entityType, relationType, referenceEntityType, null, direction, polymorphic, map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <E extends Entity, R extends Relation<?,?>, RE extends Entity> List<E> getRelated(Class<E> entityClass,
|
||||
// @Override
|
||||
protected <E extends Entity, R extends Relation<?,?>, RE extends Entity> List<E> getRelated(Class<E> entityClass,
|
||||
Class<R> relationClass, Class<RE> referenceEntityClass, RE referenceEntity, Direction direction,
|
||||
boolean polymorphic) throws ResourceRegistryException {
|
||||
UUID referenceEntityUUID = referenceEntity.getHeader().getUUID();
|
||||
|
@ -532,8 +532,8 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <E extends Entity, R extends Relation<?,?>, RE extends Entity> List<E> getRelated(Class<E> entityClass,
|
||||
// @Override
|
||||
protected <E extends Entity, R extends Relation<?,?>, RE extends Entity> List<E> getRelated(Class<E> entityClass,
|
||||
Class<R> relationClass, Class<RE> referenceEntityClass, UUID referenceEntityUUID, Direction direction,
|
||||
boolean polymorphic) throws ResourceRegistryException {
|
||||
String entityType = Utility.getType(entityClass);
|
||||
|
@ -548,8 +548,8 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRelated(String entityType, String relationType, String referenceEntityType, UUID referenceEntity,
|
||||
// @Override
|
||||
protected String getRelated(String entityType, String relationType, String referenceEntityType, UUID referenceEntity,
|
||||
Direction direction, boolean polymorphic) throws ResourceRegistryException {
|
||||
return getRelated(entityType, relationType, referenceEntityType, referenceEntity, direction, polymorphic, null);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue