Class TypesKnowledge
- java.lang.Object
-
- org.gcube.informationsystem.types.knowledge.TypesKnowledge
-
public class TypesKnowledge extends Object
Manages the knowledge about types.- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description protected CalendarcreationTimeThe creation time.static longDEFAULT_EXPIRING_TIMEOUTThe default expiring timeout.protected CalendarexpiringTimeThe expiring time.intexpiringTimeoutThe expiring timeout.protected booleaninitializedA flag indicating whether the knowledge has been initialized.protected ModelKnowledge<Type,TypeInformation>modelKnowledgeThe model knowledge.protected TypesDiscoverer<Type>typesDiscovererThe types discoverer.
-
Constructor Summary
Constructors Constructor Description TypesKnowledge()Constructs a newTypesKnowledge.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddiscover()This method do nothing if TypesDiscoverer was not set.static TypesKnowledgegetInstance()Returns the singleton instance of this class.ModelKnowledge<Type,TypeInformation>getModelKnowledge()Returns the model knowledge.TypesDiscoverer<Type>getTypesDiscoverer()Returns the types discoverer.protected voidinit(boolean forceReinitialization)Initializes the knowledge.voidrenew()Force reinitialization ofvoidsetExpiringTimeout(int expiringTimeout)Sets the expiring timeout.voidsetTypesDiscoverer(TypesDiscoverer<Type> typesDiscoverer)Sets the types discoverer.
-
-
-
Field Detail
-
DEFAULT_EXPIRING_TIMEOUT
public static final long DEFAULT_EXPIRING_TIMEOUT
The default expiring timeout.
-
initialized
protected boolean initialized
A flag indicating whether the knowledge has been initialized.
-
expiringTimeout
public int expiringTimeout
The expiring timeout.
-
creationTime
protected Calendar creationTime
The creation time.
-
expiringTime
protected Calendar expiringTime
The expiring time.
-
modelKnowledge
protected ModelKnowledge<Type,TypeInformation> modelKnowledge
The model knowledge.
-
typesDiscoverer
protected TypesDiscoverer<Type> typesDiscoverer
The types discoverer.
-
-
Method Detail
-
getInstance
public static TypesKnowledge getInstance()
Returns the singleton instance of this class.- Returns:
- The singleton instance.
-
setExpiringTimeout
public void setExpiringTimeout(int expiringTimeout)
Sets the expiring timeout.- Parameters:
expiringTimeout- The expiring timeout in milliseconds.
-
getTypesDiscoverer
public TypesDiscoverer<Type> getTypesDiscoverer()
Returns the types discoverer.- Returns:
- The types discoverer.
-
setTypesDiscoverer
public void setTypesDiscoverer(TypesDiscoverer<Type> typesDiscoverer)
Sets the types discoverer.- Parameters:
typesDiscoverer- The types discoverer.
-
getModelKnowledge
public ModelKnowledge<Type,TypeInformation> getModelKnowledge()
Returns the model knowledge.- Returns:
- The model knowledge.
-
init
protected void init(boolean forceReinitialization)
Initializes the knowledge.- Parameters:
forceReinitialization- A flag indicating whether to force reinitialization.
-
discover
public void discover()
This method do nothing if TypesDiscoverer was not set. Otherwise initialized the ModelKnowledge if it was not already initialized. To enforce rediscovery use renew method.
-
renew
public void renew()
Force reinitialization of
-
-