Package org.gcube.documentstore.records
Interface Record
-
- All Superinterfaces:
Comparable<Record>,Serializable
- All Known Subinterfaces:
AggregatedRecord<A,R>
- All Known Implementing Classes:
AbstractRecord
public interface Record extends Comparable<Record>, Serializable
- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description static StringCREATION_TIMEKEY : The instant when theRecordwas created.static StringIDKEY : The unique identifier for theRecordThe ID SHOULD automatically created by the implementation class.static StringRECORD_TYPE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<String>getComputedFields()CalendargetCreationTime()Return the instant when thisRecordwas created.StringgetId()Return the unique id for thisRecordSortedSet<String>getQuerableKeys()StringgetRecordType()Return theRecordTypeSet<String>getRequiredFields()Map<String,Serializable>getResourceProperties()Return all resource-specific properties.SerializablegetResourceProperty(String key)Return the value of the given resource property.voidremoveResourceProperty(String key)Remove a property from Record.voidsetCreationTime(Calendar creationTime)The CreationTime is automatically created by the implementation Class.voidsetId(String id)The ID SHOULD be automatically created by the implementation Class.voidsetResourceProperties(Map<String,? extends Serializable> resourceSpecificProperties)Set all resource-specific properties, replacing existing onesvoidsetResourceProperty(String key, Serializable value)Set the value of the given resource property.voidvalidate()Validate the Resource Record.-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Field Detail
-
RECORD_TYPE
static final String RECORD_TYPE
- See Also:
- Constant Field Values
-
ID
static final String ID
KEY : The unique identifier for theRecordThe ID SHOULD automatically created by the implementation class.- See Also:
- Constant Field Values
-
CREATION_TIME
static final String CREATION_TIME
KEY : The instant when theRecordwas created. The value MUST be recorded in UTC milliseconds from the epoch.- See Also:
- Constant Field Values
-
-
Method Detail
-
getRequiredFields
Set<String> getRequiredFields()
- Returns:
- a Set containing the keys of required fields The returned Set MUST be a copy of the internal representation. Any modification to the returned Set MUST not affect the object
-
getComputedFields
Set<String> getComputedFields()
- Returns:
- a Set containing the keys of computed fields The returned Set MUST be a copy of the internal representation. Any modification to the returned Set MUST not affect the object
-
getQuerableKeys
SortedSet<String> getQuerableKeys() throws Exception
- Returns:
- Querable Keys as SortedSet
- Throws:
Exception
-
setId
void setId(String id) throws InvalidValueException
The ID SHOULD be automatically created by the implementation Class. Set the ID only if you really know what you are going to do. Set the unique id for thisRecord- Parameters:
id- Unique ID- Throws:
InvalidValueException
-
getCreationTime
Calendar getCreationTime()
Return the instant when thisRecordwas created.- Returns:
- the creation time for this
Record
-
setCreationTime
void setCreationTime(Calendar creationTime) throws InvalidValueException
The CreationTime is automatically created by the implementation Class. Set the CreationTime only if you really know what you are going to do. Set the instant when thisRecordwas created.- Parameters:
creationTime- Creation Time- Throws:
InvalidValueException
-
getResourceProperties
Map<String,Serializable> getResourceProperties()
Return all resource-specific properties. The returned Map is a copy of the internal representation. Any modification to the returned Map MUST not affect the object- Returns:
- a Map containing the properties
-
setResourceProperties
void setResourceProperties(Map<String,? extends Serializable> resourceSpecificProperties) throws InvalidValueException
Set all resource-specific properties, replacing existing ones- Throws:
InvalidValueException
-
getResourceProperty
Serializable getResourceProperty(String key)
Return the value of the given resource property.- Parameters:
key- the key of the requested property- Returns:
- the value of the given resource property
-
setResourceProperty
void setResourceProperty(String key, Serializable value) throws InvalidValueException
Set the value of the given resource property. If the key has the value of one of the predefined property, the value is validated.- Parameters:
key- the key of the requested propertyvalue- the value of the given resource property- Throws:
InvalidValueException
-
removeResourceProperty
void removeResourceProperty(String key)
Remove a property from Record. This API is intended for intern use only.- Parameters:
key- the key of the requested property to remove
-
validate
void validate() throws InvalidValueExceptionValidate the Resource Record. The validation check if all the Required Field are set and has valid value.- Throws:
InvalidValueException
-
-