Added CHANGELOG in IdentifierFacet
This commit is contained in:
parent
fc0abecedf
commit
860fe8e974
|
@ -3,8 +3,12 @@
|
||||||
*/
|
*/
|
||||||
package org.gcube.resourcemanagement.model.impl.entities.facets;
|
package org.gcube.resourcemanagement.model.impl.entities.facets;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.gcube.com.fasterxml.jackson.annotation.JsonTypeName;
|
import org.gcube.com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
import org.gcube.informationsystem.model.impl.entities.FacetImpl;
|
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;
|
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;
|
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 String value;
|
||||||
protected IdentificationType type;
|
protected IdentificationType type;
|
||||||
protected boolean persistent;
|
protected boolean persistent;
|
||||||
|
|
|
@ -3,9 +3,12 @@
|
||||||
*/
|
*/
|
||||||
package org.gcube.resourcemanagement.model.reference.entities.facets;
|
package org.gcube.resourcemanagement.model.reference.entities.facets;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
import org.gcube.informationsystem.model.reference.entities.Facet;
|
import org.gcube.informationsystem.model.reference.entities.Facet;
|
||||||
import org.gcube.informationsystem.types.annotations.ISProperty;
|
import org.gcube.informationsystem.types.annotations.ISProperty;
|
||||||
|
import org.gcube.informationsystem.utils.TypeVersion;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.IdentifierFacetImpl;
|
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 "
|
public static final String DESCRIPTION = "This facet collects "
|
||||||
+ "information on Identifiers that can be attached to a resource. ";
|
+ "information on Identifiers that can be attached to a resource. ";
|
||||||
public static final String VERSION = "1.0.1";
|
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 VALUE_PROPERTY = "value";
|
||||||
public static final String TYPE_PROPERTY = "type";
|
public static final String TYPE_PROPERTY = "type";
|
||||||
|
@ -50,4 +54,5 @@ public interface IdentifierFacet extends Facet {
|
||||||
public boolean isPersistent();
|
public boolean isPersistent();
|
||||||
|
|
||||||
public void setPersistent(boolean persistent);
|
public void setPersistent(boolean persistent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.entities.Resource;
|
||||||
import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
|
import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
|
||||||
import org.gcube.informationsystem.types.TypeMapper;
|
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.ElementMapper;
|
||||||
|
import org.gcube.informationsystem.utils.TypeVersion;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.facets.CPUFacetImpl;
|
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.facets.ContactFacetImpl;
|
||||||
import org.gcube.resourcemanagement.model.impl.entities.resources.HostingNodeImpl;
|
import org.gcube.resourcemanagement.model.impl.entities.resources.HostingNodeImpl;
|
||||||
|
@ -163,4 +165,14 @@ public class Serializer {
|
||||||
logger.trace("Deserialized Context : {} ", c);
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue