|
|
|
@ -7,8 +7,8 @@ import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import org.gcube.common.gxhttp.reference.GXConnection;
|
|
|
|
|
import org.gcube.common.gxhttp.request.GXHTTPStringRequest;
|
|
|
|
|
import org.gcube.informationsystem.model.reference.AccessType;
|
|
|
|
|
import org.gcube.informationsystem.model.reference.ISManageable;
|
|
|
|
|
import org.gcube.informationsystem.base.reference.AccessType;
|
|
|
|
|
import org.gcube.informationsystem.base.reference.ISManageable;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextAlreadyPresentException;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
|
|
|
@ -18,7 +18,7 @@ import org.gcube.informationsystem.resourceregistry.api.rest.TypePath;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.rest.httputils.HTTPUtility;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.utils.Utility;
|
|
|
|
|
import org.gcube.informationsystem.types.TypeBinder;
|
|
|
|
|
import org.gcube.informationsystem.types.TypeBinder.TypeDefinition;
|
|
|
|
|
import org.gcube.informationsystem.types.reference.TypeDefinition;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
|
@ -37,7 +37,7 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <ISM extends ISManageable> TypeDefinition create(Class<ISM> clz)
|
|
|
|
|
public <ISM extends ISManageable> TypeDefinition<ISM> create(Class<ISM> clz)
|
|
|
|
|
throws SchemaException, ResourceRegistryException {
|
|
|
|
|
try {
|
|
|
|
|
String typeDefinition = TypeBinder.serializeType(clz);
|
|
|
|
@ -55,7 +55,7 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC
|
|
|
|
|
public String create(String baseType, String typeDefinitition) throws ContextAlreadyPresentException, ResourceRegistryException {
|
|
|
|
|
try {
|
|
|
|
|
logger.trace("Going to create: {}", typeDefinitition);
|
|
|
|
|
TypeDefinition typeDefinitionObj = TypeBinder.deserializeTypeDefinition(typeDefinitition);
|
|
|
|
|
TypeDefinition<? extends ISManageable> typeDefinitionObj = TypeBinder.deserializeTypeDefinition(typeDefinitition);
|
|
|
|
|
|
|
|
|
|
GXHTTPStringRequest gxHTTPStringRequest = GXHTTPStringRequest.newRequest(address);
|
|
|
|
|
gxHTTPStringRequest.from(ResourceRegistrySchemaClient.class.getSimpleName());
|
|
|
|
@ -79,7 +79,7 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <ISM extends ISManageable> List<TypeDefinition> read(Class<ISM> clz, Boolean polymorphic)
|
|
|
|
|
public <ISM extends ISManageable> List<TypeDefinition<ISM>> read(Class<ISM> clz, Boolean polymorphic)
|
|
|
|
|
throws SchemaNotFoundException, ResourceRegistryException {
|
|
|
|
|
try {
|
|
|
|
|
String type = Utility.getType(clz);
|
|
|
|
|