Added CHANGELOG in IdentifierFacet

This commit is contained in:
Luca Frosini 2020-12-14 09:30:08 +01:00
parent fc0abecedf
commit 860fe8e974
3 changed files with 28 additions and 0 deletions

View File

@ -3,8 +3,12 @@
*/
package org.gcube.resourcemanagement.model.impl.entities.facets;
import java.util.Map;
import org.gcube.com.fasterxml.jackson.annotation.JsonTypeName;
import org.gcube.informationsystem.model.impl.entities.FacetImpl;
import org.gcube.informationsystem.types.impl.TypeImpl;
import org.gcube.informationsystem.utils.TypeVersion;
import org.gcube.resourcemanagement.model.reference.entities.facets.IdentifierFacet;
/**
@ -18,6 +22,13 @@ public class IdentifierFacetImpl extends FacetImpl implements IdentifierFacet {
*/
private static final long serialVersionUID = 5711870008624673728L;
public static final Map<TypeVersion, String> CHANGELOG;
static {
CHANGELOG = TypeImpl.DEFAULT_CHANGELOG_MAP;
CHANGELOG.put(new TypeVersion(IdentifierFacet.VERSION), "Added STRING in IdentificationType");
}
protected String value;
protected IdentificationType type;
protected boolean persistent;

View File

@ -3,9 +3,12 @@
*/
package org.gcube.resourcemanagement.model.reference.entities.facets;
import java.util.Map;
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.gcube.informationsystem.model.reference.entities.Facet;
import org.gcube.informationsystem.types.annotations.ISProperty;
import org.gcube.informationsystem.utils.TypeVersion;
import org.gcube.resourcemanagement.model.impl.entities.facets.IdentifierFacetImpl;
/**
@ -28,6 +31,7 @@ public interface IdentifierFacet extends Facet {
public static final String DESCRIPTION = "This facet collects "
+ "information on Identifiers that can be attached to a resource. ";
public static final String VERSION = "1.0.1";
public static final Map<TypeVersion, String> CHANGELOG = IdentifierFacetImpl.CHANGELOG;
public static final String VALUE_PROPERTY = "value";
public static final String TYPE_PROPERTY = "type";
@ -50,4 +54,5 @@ public interface IdentifierFacet extends Facet {
public boolean isPersistent();
public void setPersistent(boolean persistent);
}

View File

@ -15,7 +15,9 @@ import org.gcube.informationsystem.model.reference.entities.Facet;
import org.gcube.informationsystem.model.reference.entities.Resource;
import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
import org.gcube.informationsystem.types.TypeMapper;
import org.gcube.informationsystem.types.reference.entities.FacetType;
import org.gcube.informationsystem.utils.ElementMapper;
import org.gcube.informationsystem.utils.TypeVersion;
import org.gcube.resourcemanagement.model.impl.entities.facets.CPUFacetImpl;
import org.gcube.resourcemanagement.model.impl.entities.facets.ContactFacetImpl;
import org.gcube.resourcemanagement.model.impl.entities.resources.HostingNodeImpl;
@ -163,4 +165,14 @@ public class Serializer {
logger.trace("Deserialized Context : {} ", c);
}
@Test
public void testTypeSerialization() throws Exception {
String serialized = TypeMapper.serializeType(IdentifierFacet.class);
logger.info(serialized);
FacetType propertyType = (FacetType) TypeMapper.deserializeTypeDefinition(serialized);
TypeVersion typeVersion = propertyType.getVersion();
logger.debug("Version {}", typeVersion.toString());
logger.info(ElementMapper.marshal(propertyType));
}
}