Fixed client due to is model reorganization

master
Luca Frosini 4 years ago
parent aea7494006
commit c0517db9b8

@ -20,7 +20,8 @@ public interface ResourceRegistrySchemaClient {
throws SchemaException, ResourceRegistryException;
public <ISM extends ISManageable> List<TypeDefinition<ISM>> read(Class<ISM> clz, Boolean polymorphic)
@SuppressWarnings("rawtypes")
public <ISM extends ISManageable> List<TypeDefinition> read(Class<ISM> clz, Boolean polymorphic)
throws SchemaNotFoundException, ResourceRegistryException;
public String read(String type, Boolean polymorphic)

@ -36,6 +36,7 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC
}
@SuppressWarnings("unchecked")
@Override
public <ISM extends ISManageable> TypeDefinition<ISM> create(Class<ISM> clz)
throws SchemaException, ResourceRegistryException {
@ -55,6 +56,7 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC
public String create(String baseType, String typeDefinitition) throws ContextAlreadyPresentException, ResourceRegistryException {
try {
logger.trace("Going to create: {}", typeDefinitition);
@SuppressWarnings("unchecked")
TypeDefinition<? extends ISManageable> typeDefinitionObj = TypeBinder.deserializeTypeDefinition(typeDefinitition);
GXHTTPStringRequest gxHTTPStringRequest = GXHTTPStringRequest.newRequest(address);
@ -78,8 +80,9 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC
}
@SuppressWarnings("rawtypes")
@Override
public <ISM extends ISManageable> List<TypeDefinition<ISM>> read(Class<ISM> clz, Boolean polymorphic)
public <ISM extends ISManageable> List<TypeDefinition> read(Class<ISM> clz, Boolean polymorphic)
throws SchemaNotFoundException, ResourceRegistryException {
try {
String type = Utility.getType(clz);

@ -30,12 +30,13 @@ public class ResourceRegistrySchemaClientTest extends ContextTest {
logger.debug("{}", td);
}
@SuppressWarnings({"rawtypes", "unchecked"})
@Test
public void testRead() throws Exception {
ResourceRegistrySchemaClient resourceRegistrySchemaClient = ResourceRegistrySchemaClientFactory.create();
List<TypeDefinition<Facet>> types = resourceRegistrySchemaClient.read(Facet.class, true);
List<TypeDefinition> types = resourceRegistrySchemaClient.read(Facet.class, true);
Assert.assertTrue(types.size()>1);
for(TypeDefinition<Facet> td : types) {
for(TypeDefinition td : types) {
logger.debug("{}", td);
}

Loading…
Cancel
Save