|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.folder.DefaultFolderCache
Default implementation of FolderCache
Supported API: false
Extendable: false
Nested Class Summary | |
(package private) static class |
DefaultFolderCache.FolderCacheMessage
|
static class |
DefaultFolderCache.FolderCacheMessenger
|
(package private) static class |
DefaultFolderCache.Singleton
|
(package private) static class |
DefaultFolderCache.WindchillPDMCabinets
Preserve the behavior of the old folder cache, for Windchill PDM. |
(package private) static class |
DefaultFolderCache.WindchillPDMMessage
Contains the oids of Windchill PDM cabinets to add to the cache, and those that have been removed |
static class |
DefaultFolderCache.WindchillPDMMessenger
Sends messages about Windchill PDM cabinets |
Nested classes inherited from class wt.folder.FolderCache |
FolderCache.NamesToFoldersKey |
Constructor Summary | |
private |
DefaultFolderCache()
Wire together the messenger with th4 various local caches, and register event listeners |
Method Summary | |
private static void |
addCabinetToResultBuffer(FolderCache.NamesToFoldersKey key,
Map to_query,
List result_buffer,
Cabinet cabinet,
boolean read_only)
Utility method that adds the Cabinet with the given key to result_buffer, removing it from to_query |
(package private) void |
addToReferenceCache(WTCollection c)
Update the reference cache with the given collection of Persistables |
private void |
cleanupSubFolderLinks(WTKeyedMap objects_to_links)
React to a local REMOVE event |
(package private) void |
clear()
Clear all contents from the cache |
(package private) static Folder |
clone(Folder f)
Clone the persistent state of the given folder |
WTList |
getCabinetsByName(WTList ordered_containers,
List ordered_cabinet_names,
boolean read_only)
Get the cabinets in the given parent containers with the given names. |
(package private) List |
getCabinetsByName(WTList ordered_containers,
List ordered_cabinet_names,
boolean read_only,
boolean throw_fnfe)
Utility version of getCabinetsByName that can either throw FolderNotFoundExceptions or leave those slots null |
WTValuedMap |
getChildToParentMap(WTCollection children,
boolean read_only)
Get the parents of the given child folders |
WTKeyedMap |
getContainerToCabinetMap(WTCollection containers,
boolean shared_only,
boolean read_only)
Get all of the cabinets that are in the given containers |
private long[] |
getIdsFromOids(Collection oids)
Get an array of long ids from the given Collection of ObjectIdentifiers |
(package private) static DefaultFolderCache |
getInstance()
|
private ObjectIdentifier |
getOid(Object[] row)
Create an ObjectIdentifier from the raw query data |
WTKeyedMap |
getParentToSubFoldersMap(WTCollection parents,
boolean read_only)
Get all the subfolders of the given parent folders |
private Cabinet |
getSpecialCabinet(ObjectIdentifier container_oid,
String cabinet_name)
Utility method that determines if the cabinet with the given name is either the system or default cabinet for the given container. |
WTList |
getSubFoldersByName(WTList ordered_parents,
List ordered_child_names,
boolean read_only)
Get the children of the given parents with the given names. |
WTValuedMap |
getUserToCabinetMap(WTCollection users,
boolean read_only)
Get the personal cabinets for the given |
(package private) void |
inflateFromReferenceCache(WTCollection c,
boolean read_only)
Inflate the given collection |
private void |
postChangeFolder(WTKeyedMap sources_to_targets,
WTKeyedMap destinations_to_targets)
React to a local POST_CHANGE_FOLDER event |
private void |
postChangeIdentities(WTKeyedMap identifieds_to_old_identities)
React to a local POST_CHANGE_IDENTITY event |
private void |
postChangeOwnership(WTCollection objects,
Ownership new_ownership)
React to a local POST_CHANGE_OWNERSHIP event |
private void |
postStoreCabinets(WTCollection cabinets)
React to a local POST_STORE event |
private void |
postStoreSubFolderLinks(WTCollection subfolder_links)
React to a local POST_STORE event |
private void |
removeCabinets(WTCollection cabinets)
React to a local REMOVE event |
(package private) void |
sendMessage(DefaultFolderCache.FolderCacheMessage message)
Notify remote caches of the given message |
private boolean |
tooManyFolders(int num_folders)
Decides whether or not to cache inflated SubFolders based on whether
their number is fewer than half of MAX_SUBFOLDERS. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private static final boolean DEBUG
private static final DebugWriter LOG
private static final Object CONTEXT_KEY
private static final String OWNER_ID
private static final int MAX_SUBFOLDERS
private static final int CONTAINERS_TO_CABINETS_SIZE
private static final int NAMES_TO_CABINETS_SIZE
private static final int NAMES_TO_SUBFOLDERS_SIZE
private static final int PARENTS_TO_SUBFOLDERS_SIZE
private static final int SUBFOLDERS_TO_PARENTS_SIZE
private static final int USERS_TO_CABINETS_SIZE
private static final RefreshSpec INFLATE_READ_ONLY
private static final int WINDCHILL_PDM_CABINETS_TO_CACHE
private static final int WINDCHILL_PDM_ALL_CABINETS
private static final int WINDCHILL_PDM_SHARED_CABINETS
private static final int WINDCHILL_PDM_NO_CABINETS
final DefaultFolderCache.FolderCacheMessenger messenger
final DirtyMap containersToCabinets
final DirtyMap namesToCabinets
final DirtyMap namesToSubFolders
final DirtyMap parentsToSubFolders
final DirtyMap subFoldersToParents
final DirtyMap usersToCabinets
final DefaultFolderCache.WindchillPDMCabinets windchillPDMCabinets
Constructor Detail |
private DefaultFolderCache() throws WTException
Method Detail |
static DefaultFolderCache getInstance()
void sendMessage(DefaultFolderCache.FolderCacheMessage message) throws WTException
message
-
WTException
void clear()
void addToReferenceCache(WTCollection c) throws WTException
WTException
void inflateFromReferenceCache(WTCollection c, boolean read_only) throws WTException
c
- read_only
-
WTException
public WTValuedMap getChildToParentMap(WTCollection children, boolean read_only) throws WTException
getChildToParentMap
in interface FolderCache
children
- A collection of child folders. The implementation will not
inflate the childrenread_only
- Whether or not to return the cached instances of the parent folders
WTException
public WTList getSubFoldersByName(WTList ordered_parents, List ordered_child_names, boolean read_only) throws WTException
getSubFoldersByName
in interface FolderCache
ordered_parents
- A list of the parent folders to query in. This list may
either have the same number of elemnts as ordered_child_names
,
or it may have 1 element that is used with every nameordered_child_names
- A list of child names to find subfolders for within
the corresponding parent folderread_only
- Whether or not to return the cached instances of
the subfolders
FolderNotFoundException
- If any of the subfolders couldn't be found
WTException
public WTList getCabinetsByName(WTList ordered_containers, List ordered_cabinet_names, boolean read_only) throws WTException
getCabinetsByName
in interface FolderCache
ordered_containers
- A list of the containers to query in. This list may
either have as many elements as ordered_cabinet_names
or 1 element that is used with each name.ordered_cabinet_names
- A list of cabinet names to find cabinets for within
the corresponding containerread_only
- Whether or not to return the cached instances of
the cabinets
FolderNotFoundException
- If any of the cabinets couldn't be found
WTException
List getCabinetsByName(WTList ordered_containers, List ordered_cabinet_names, boolean read_only, boolean throw_fnfe) throws WTException
ordered_containers
- ordered_cabinet_names
- read_only
-
WTException
private static void addCabinetToResultBuffer(FolderCache.NamesToFoldersKey key, Map to_query, List result_buffer, Cabinet cabinet, boolean read_only) throws WTException
key
- The key for the cabinetto_query
- Mapping of NamesToFoldersKey objects to either a single Integer result index
or a List of result indicesresult_buffer
- The list to add the cabinet tocabinet
- The cabinetread_only
- Whether or not to clone the cabinet into result_buffer
WTException
private Cabinet getSpecialCabinet(ObjectIdentifier container_oid, String cabinet_name) throws WTException
cabinet_name
-
WTException
public WTValuedMap getUserToCabinetMap(WTCollection users, boolean read_only) throws WTException
getUserToCabinetMap
in interface FolderCache
users
- The users to find personal cabinets forread_only
- Whether or not to return the cached instances of
the cabinets
FolderNotFoundException
- If the personal cabinet can't be found for any of the users
WTException
public WTKeyedMap getContainerToCabinetMap(WTCollection containers, boolean shared_only, boolean read_only) throws WTException
getContainerToCabinetMap
in interface FolderCache
containers
- The containers to search inshared_only
- Whether or not to only return shared cabinetsread_only
- Whether or not to return the cached instances of
the cabinets
WTException
public WTKeyedMap getParentToSubFoldersMap(WTCollection parents, boolean read_only) throws WTException
getParentToSubFoldersMap
in interface FolderCache
parents
- The parent folders to find children forread_only
- Whether or not to return the cached instances of
the subfolders
WTException
private long[] getIdsFromOids(Collection oids)
oids
- A Collection of ObjectIdentifiers
private ObjectIdentifier getOid(Object[] row)
row
- The first element is class name, the second a Number
private boolean tooManyFolders(int num_folders)
SubFolders
based on whether
their number is fewer than half of MAX_SUBFOLDERS. This will prevent
the reference cache from overflowing because it was filled up by a single large
set of SubFolders
.
num_folders
- the number of SubFolders
to be cached
true
if num_folders
is less
than half of MAX_SUBFOLDERSprivate void postStoreCabinets(WTCollection cabinets) throws WTException
cabinets
- Newly stored cabinets
WTException
private void postStoreSubFolderLinks(WTCollection subfolder_links) throws WTException
subfolder_links
- Newly stored SubFolderLinks
WTException
private void removeCabinets(WTCollection cabinets) throws WTException
cabinets
- Newly removed cabinets
WTException
private void cleanupSubFolderLinks(WTKeyedMap objects_to_links) throws WTException
WTException
private void postChangeIdentities(WTKeyedMap identifieds_to_old_identities) throws WTException
identifieds_to_old_identities
- Mapping of identitieds to their old IdentificationObjects
WTException
private void postChangeFolder(WTKeyedMap sources_to_targets, WTKeyedMap destinations_to_targets) throws WTException
sources_to_targets
- destinations_to_targets
-
WTException
private void postChangeOwnership(WTCollection objects, Ownership new_ownership) throws WTException
objects
- new_ownership
-
WTException
static Folder clone(Folder f)
f
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |