Fixed code to comply with uuid property rename to id
This commit is contained in:
parent
b04623028e
commit
34a2dd7959
|
@ -253,7 +253,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
||||||
context = getContextFromServer(ContextPath.CURRENT_CONTEXT_PATH_PART);
|
context = getContextFromServer(ContextPath.CURRENT_CONTEXT_PATH_PART);
|
||||||
contextCache.cleanCache();
|
contextCache.cleanCache();
|
||||||
contextCache.refreshContextsIfNeeded();
|
contextCache.refreshContextsIfNeeded();
|
||||||
Context c = contextCache.getContextByUUID(context.getUUID());
|
Context c = contextCache.getContextByUUID(context.getID());
|
||||||
if(c!=null){
|
if(c!=null){
|
||||||
context = c;
|
context = c;
|
||||||
}else {
|
}else {
|
||||||
|
@ -272,7 +272,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
||||||
context = getContextFromServer(ContextPath.CURRENT_CONTEXT_PATH_PART);
|
context = getContextFromServer(ContextPath.CURRENT_CONTEXT_PATH_PART);
|
||||||
contextCache.cleanCache();
|
contextCache.cleanCache();
|
||||||
contextCache.refreshContextsIfNeeded();
|
contextCache.refreshContextsIfNeeded();
|
||||||
Context c = contextCache.getContextByUUID(context.getUUID());
|
Context c = contextCache.getContextByUUID(context.getID());
|
||||||
if(c!=null){
|
if(c!=null){
|
||||||
context = c;
|
context = c;
|
||||||
}else {
|
}else {
|
||||||
|
@ -584,7 +584,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
||||||
public <R extends Resource, C extends ConsistsOf<?,?>, F extends Facet> List<R> getResourcesFromReferenceFacet(
|
public <R extends Resource, C extends ConsistsOf<?,?>, F extends Facet> List<R> getResourcesFromReferenceFacet(
|
||||||
Class<R> resourceClass, Class<C> consistsOfClass, F referenceFacet,
|
Class<R> resourceClass, Class<C> consistsOfClass, F referenceFacet,
|
||||||
boolean polymorphic) throws ResourceRegistryException {
|
boolean polymorphic) throws ResourceRegistryException {
|
||||||
UUID referenceFacetUUID = referenceFacet.getUUID();
|
UUID referenceFacetUUID = referenceFacet.getID();
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Class<F> facetClass = (Class<F>) referenceFacet.getClass();
|
Class<F> facetClass = (Class<F>) referenceFacet.getClass();
|
||||||
return getResourcesFromReferenceFacet(resourceClass, consistsOfClass, facetClass, referenceFacetUUID,
|
return getResourcesFromReferenceFacet(resourceClass, consistsOfClass, facetClass, referenceFacetUUID,
|
||||||
|
@ -639,7 +639,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
||||||
public <R extends Resource, I extends IsRelatedTo<?,?>, RR extends Resource> List<R> getRelatedResourcesFromReferenceResource(
|
public <R extends Resource, I extends IsRelatedTo<?,?>, RR extends Resource> List<R> getRelatedResourcesFromReferenceResource(
|
||||||
Class<R> resourceClass, Class<I> isRelatedToClass, RR referenceResource,
|
Class<R> resourceClass, Class<I> isRelatedToClass, RR referenceResource,
|
||||||
Direction direction, boolean polymorphic) throws ResourceRegistryException {
|
Direction direction, boolean polymorphic) throws ResourceRegistryException {
|
||||||
UUID referenceResourceUUID = referenceResource.getUUID();
|
UUID referenceResourceUUID = referenceResource.getID();
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Class<RR> referenceResourceClass = (Class<RR>) referenceResource.getClass();
|
Class<RR> referenceResourceClass = (Class<RR>) referenceResource.getClass();
|
||||||
return getRelatedResourcesFromReferenceResource(resourceClass, isRelatedToClass, referenceResourceClass,
|
return getRelatedResourcesFromReferenceResource(resourceClass, isRelatedToClass, referenceResourceClass,
|
||||||
|
@ -719,7 +719,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
||||||
protected <E extends Entity, R extends Relation<?,?>, RE extends Entity> List<E> getRelated(Class<E> entityClass,
|
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,
|
Class<R> relationClass, Class<RE> referenceEntityClass, RE referenceEntity, Direction direction,
|
||||||
boolean polymorphic) throws ResourceRegistryException {
|
boolean polymorphic) throws ResourceRegistryException {
|
||||||
UUID referenceEntityUUID = referenceEntity.getUUID();
|
UUID referenceEntityUUID = referenceEntity.getID();
|
||||||
return getRelated(entityClass, relationClass, referenceEntityClass, referenceEntityUUID, direction,
|
return getRelated(entityClass, relationClass, referenceEntityClass, referenceEntityUUID, direction,
|
||||||
polymorphic);
|
polymorphic);
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,7 +133,7 @@ public class ResourceRegistryClientTest extends ContextTest {
|
||||||
public void testGetRelatedResourcesFromReferenceResourceByClasses() throws Exception {
|
public void testGetRelatedResourcesFromReferenceResourceByClasses() throws Exception {
|
||||||
UUID uuid = UUIDUtility.fromString("b0d15e45-62af-4221-b785-7d014f10e631");
|
UUID uuid = UUIDUtility.fromString("b0d15e45-62af-4221-b785-7d014f10e631");
|
||||||
HostingNode hostingNode = new HostingNodeImpl();
|
HostingNode hostingNode = new HostingNodeImpl();
|
||||||
hostingNode.setUUID(uuid);
|
hostingNode.setID(uuid);
|
||||||
Metadata metadata = new MetadataImpl();
|
Metadata metadata = new MetadataImpl();
|
||||||
hostingNode.setMetadata(metadata);
|
hostingNode.setMetadata(metadata);
|
||||||
List<EService> eServices = resourceRegistryClient.getRelatedResourcesFromReferenceResource(EService.class,
|
List<EService> eServices = resourceRegistryClient.getRelatedResourcesFromReferenceResource(EService.class,
|
||||||
|
@ -157,7 +157,7 @@ public class ResourceRegistryClientTest extends ContextTest {
|
||||||
// @Test
|
// @Test
|
||||||
public void testGetResourcesFromReferenceFacet() throws ResourceRegistryException, JsonProcessingException {
|
public void testGetResourcesFromReferenceFacet() throws ResourceRegistryException, JsonProcessingException {
|
||||||
SoftwareFacet softwareFacet = new SoftwareFacetImpl();
|
SoftwareFacet softwareFacet = new SoftwareFacetImpl();
|
||||||
softwareFacet.setUUID(UUIDManager.getInstance().generateValidUUID());
|
softwareFacet.setID(UUIDManager.getInstance().generateValidUUID());
|
||||||
Metadata metadata = new MetadataImpl();
|
Metadata metadata = new MetadataImpl();
|
||||||
softwareFacet.setMetadata(metadata);
|
softwareFacet.setMetadata(metadata);
|
||||||
List<EService> eServices = resourceRegistryClient.getResourcesFromReferenceFacet(EService.class, IsIdentifiedBy.class, softwareFacet, true);
|
List<EService> eServices = resourceRegistryClient.getResourcesFromReferenceFacet(EService.class, IsIdentifiedBy.class, softwareFacet, true);
|
||||||
|
@ -177,11 +177,11 @@ public class ResourceRegistryClientTest extends ContextTest {
|
||||||
|
|
||||||
|
|
||||||
for(Context c : contexts) {
|
for(Context c : contexts) {
|
||||||
UUID uuid = c.getUUID();
|
UUID uuid = c.getID();
|
||||||
if(c.getParent()!=null) {
|
if(c.getParent()!=null) {
|
||||||
IsParentOf isParentOf = c.getParent();
|
IsParentOf isParentOf = c.getParent();
|
||||||
Context parentContext = isParentOf.getSource();
|
Context parentContext = isParentOf.getSource();
|
||||||
UUID parentUUID = parentContext.getUUID();
|
UUID parentUUID = parentContext.getID();
|
||||||
Assert.assertEquals(parentContext, contextCache.getContextByUUID(parentUUID));
|
Assert.assertEquals(parentContext, contextCache.getContextByUUID(parentUUID));
|
||||||
List<IsParentOf> children = parentContext.getChildren();
|
List<IsParentOf> children = parentContext.getChildren();
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
|
@ -192,9 +192,9 @@ public class ResourceRegistryClientTest extends ContextTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Assert.assertTrue(found);
|
Assert.assertTrue(found);
|
||||||
logger.debug("{} : {} (parent {} : {})", c.getUUID(), contextCache.getContextFullNameByUUID(uuid), parentUUID, contextCache.getContextFullNameByUUID(parentUUID));
|
logger.debug("{} : {} (parent {} : {})", c.getID(), contextCache.getContextFullNameByUUID(uuid), parentUUID, contextCache.getContextFullNameByUUID(parentUUID));
|
||||||
}else {
|
}else {
|
||||||
logger.debug("{} : {}", c.getUUID(), contextCache.getContextFullNameByUUID(uuid));
|
logger.debug("{} : {}", c.getID(), contextCache.getContextFullNameByUUID(uuid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ public class ResourceRegistryClientTest extends ContextTest {
|
||||||
logger.debug("Current context : {}", currentContext);
|
logger.debug("Current context : {}", currentContext);
|
||||||
|
|
||||||
for(Context c : contexts) {
|
for(Context c : contexts) {
|
||||||
UUID uuid = c.getUUID();
|
UUID uuid = c.getID();
|
||||||
Context context = resourceRegistryClient.getContext(uuid);
|
Context context = resourceRegistryClient.getContext(uuid);
|
||||||
String fullName = ContextCache.getInstance().getContextFullNameByUUID(uuid);
|
String fullName = ContextCache.getInstance().getContextFullNameByUUID(uuid);
|
||||||
logger.debug("{} - {} : {}", uuid, fullName, context);
|
logger.debug("{} - {} : {}", uuid, fullName, context);
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class ResourceRegistryClientTestWikiExamples extends ContextTest {
|
||||||
public void testExample2Alt() throws ResourceRegistryException, Exception{
|
public void testExample2Alt() throws ResourceRegistryException, Exception{
|
||||||
SoftwareFacet softwareFacetInstance = new SoftwareFacetImpl();
|
SoftwareFacet softwareFacetInstance = new SoftwareFacetImpl();
|
||||||
UUID uuid = UUIDUtility.fromString("97984812-90e6-4eb7-b804-50a9ad3fe4fb");
|
UUID uuid = UUIDUtility.fromString("97984812-90e6-4eb7-b804-50a9ad3fe4fb");
|
||||||
softwareFacetInstance.setUUID(uuid);
|
softwareFacetInstance.setID(uuid);
|
||||||
List<EService> list = resourceRegistryClient.getResourcesFromReferenceFacet(EService.class, IsIdentifiedBy.class, softwareFacetInstance, true);
|
List<EService> list = resourceRegistryClient.getResourcesFromReferenceFacet(EService.class, IsIdentifiedBy.class, softwareFacetInstance, true);
|
||||||
logger.debug("{}", list);
|
logger.debug("{}", list);
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ public class ResourceRegistryClientTestWikiExamples extends ContextTest {
|
||||||
public void testExample8Alt() throws Exception{
|
public void testExample8Alt() throws Exception{
|
||||||
HostingNode hostingNodeInstance = new HostingNodeImpl();
|
HostingNode hostingNodeInstance = new HostingNodeImpl();
|
||||||
UUID uuid = UUIDUtility.fromString("16032d09-3823-444e-a1ff-a67de4f350a");
|
UUID uuid = UUIDUtility.fromString("16032d09-3823-444e-a1ff-a67de4f350a");
|
||||||
hostingNodeInstance.setUUID(uuid);
|
hostingNodeInstance.setID(uuid);
|
||||||
List<EService> list = resourceRegistryClient.getRelatedResourcesFromReferenceResource(EService.class, Hosts.class, hostingNodeInstance, Direction.IN, true);
|
List<EService> list = resourceRegistryClient.getRelatedResourcesFromReferenceResource(EService.class, Hosts.class, hostingNodeInstance, Direction.IN, true);
|
||||||
logger.debug("{}", list);
|
logger.debug("{}", list);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue