Class CachingPolicy
- java.lang.Object
-
- oracle.spatial.network.lod.config.CachingPolicy
-
- All Implemented Interfaces:
java.lang.Cloneable
public class CachingPolicy extends java.lang.Object implements java.lang.Cloneable
The caching policy for a network at certain link level.- Since:
- 11gR1
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
HANDLER_CLASS_NAME_LRU
-
Constructor Summary
Constructors Constructor Description CachingPolicy()
Creates a default caching policy instance, whose caching handler is oracle.spatial.network.lod.LRUCachingHandler, and the maximum number of nodes allowed in the cache is 500000.CachingPolicy(java.lang.String cachingHandlerClassName, int maxNodes)
Constructs a caching policy instance.CachingPolicy(CachingPolicy policy)
Copy constructorCachingPolicy(org.w3c.dom.Element elem)
Constructs a caching policy instance according to the configuration specified in the xml element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addResidentPartition(int partitionId)
Adds a resident partition to the caching policy.java.lang.Object
clone()
Supports clone().CachingHandler
getCachingHandler()
Returns the caching handler object.int
getMaxNumberOfNodes()
Returns the maximum number of nodes allowed in the cache for this network level.int[]
getResidentPartitionArray()
Returns the resident partition ID array.java.util.HashSet<java.lang.Integer>
getResidentPartitions()
Returns the resident partition IDs.boolean
isResidentPartition(int partitionId)
Checks whether the specified partition is a resident partition.void
setCachingHandler(java.lang.String cachingHandlerClassName)
Sets the caching handler.void
setCachingHandler(CachingHandler cachingHander)
Sets the caching handler.void
setMaxNumberOfNodes(int maxNumberOfNodes)
Sets the maximum number of nodes allowed in the cache for this network level.
-
-
-
Field Detail
-
HANDLER_CLASS_NAME_LRU
public static final java.lang.String HANDLER_CLASS_NAME_LRU
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CachingPolicy
public CachingPolicy()
Creates a default caching policy instance, whose caching handler is oracle.spatial.network.lod.LRUCachingHandler, and the maximum number of nodes allowed in the cache is 500000.
-
CachingPolicy
public CachingPolicy(java.lang.String cachingHandlerClassName, int maxNodes)
Constructs a caching policy instance.- Parameters:
cachingHandlerClassName
- caching handler class namemaxNodes
- maximum number of nodes allowed in the cache before some partitions must be flushed out
-
CachingPolicy
public CachingPolicy(CachingPolicy policy)
Copy constructor- Parameters:
policy
- caching policy
-
CachingPolicy
public CachingPolicy(org.w3c.dom.Element elem) throws LODConfigException
Constructs a caching policy instance according to the configuration specified in the xml element.- Parameters:
elem
- xml element containing the caching policy configuration- Throws:
LODConfigException
-
-
Method Detail
-
setCachingHandler
public void setCachingHandler(java.lang.String cachingHandlerClassName)
Sets the caching handler.- Parameters:
cachingHandlerClassName
- full class name, including the package names, of the caching handler
-
setCachingHandler
public void setCachingHandler(CachingHandler cachingHander)
Sets the caching handler.- Parameters:
cachingHander
- caching handler
-
getCachingHandler
public CachingHandler getCachingHandler()
Returns the caching handler object.- Returns:
- caching handler
-
isResidentPartition
public boolean isResidentPartition(int partitionId)
Checks whether the specified partition is a resident partition. A resident partition is a partition that never gets flushed out of the cache once loaded.- Parameters:
partitionId
- partition ID- Returns:
- true, if the partition is a resident partition; false, otherwise.
-
getMaxNumberOfNodes
public int getMaxNumberOfNodes()
Returns the maximum number of nodes allowed in the cache for this network level. Some partitions will be flushed out of the cache when the number of nodes in the cache exceeds the maximum allowed number of nodes.- Returns:
- the maximum number of nodes allowed in the cache
-
setMaxNumberOfNodes
public void setMaxNumberOfNodes(int maxNumberOfNodes)
Sets the maximum number of nodes allowed in the cache for this network level.- Parameters:
maxNumberOfNodes
-
-
getResidentPartitions
public java.util.HashSet<java.lang.Integer> getResidentPartitions()
Returns the resident partition IDs.- Returns:
- resident partition IDs
-
getResidentPartitionArray
public int[] getResidentPartitionArray()
Returns the resident partition ID array.- Returns:
- resident partition IDs
-
addResidentPartition
public void addResidentPartition(int partitionId)
Adds a resident partition to the caching policy.- Parameters:
partitionId
- ID of the resident partition
-
clone
public java.lang.Object clone()
Supports clone().- Overrides:
clone
in classjava.lang.Object
- Returns:
- a copy of this caching policy.
-
-