|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.services.StandardManager
wt.index.StandardIndexPolicyManager
Interface containing methods for the mainpulation of index policy rules and lists, as well as event dispatching.
Use the newStandardIndexPolicyManager
static factory method(s),
not the StandardIndexPolicyManager
constructor, to construct
instances of this class. Instances must be constructed using the static
factory(s), in order to ensure proper initialization of the instance.
Supported API: false
Extendable: false
Nested Class Summary | |
(package private) class |
StandardIndexPolicyManager.ContentListener
|
(package private) class |
StandardIndexPolicyManager.DomainListener
|
(package private) class |
StandardIndexPolicyManager.IdentityListener
|
(package private) class |
StandardIndexPolicyManager.IndexEventListener
|
(package private) class |
StandardIndexPolicyManager.VCListener
|
Fields inherited from class wt.services.StandardManager |
|
Fields inherited from interface wt.services.Manager |
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE |
Constructor Summary | |
StandardIndexPolicyManager()
|
Method Summary | |
IndexPolicyRule |
addIndexPolicyRule(Selector selector)
Creates and adds a new index policy rule for the given selector. |
private static void |
addItemsToCache(WTCollection indexableCollection)
|
Enumeration |
allIndexers()
Returns all available indexers. |
private String |
collectionsToString(Enumeration collections)
|
private static IndexerSet |
constructIndexerSet(Selector selector)
Constructs an indexer set for the given selector. |
void |
createIndexingRule(AdminDomainRef domain_ref,
String type_id,
String state_key,
Vector collections)
Creates an indexing rule defining which collections objects of a specified type should be entered into when the objects move to a specified life cycle state, within a domain. |
private static IndexPolicyList |
createIndexPolicyList(Selector selector)
Creates index policy list for the given selector. |
void |
deleteIndexingRule(AdminDomainRef domain_ref,
String type_id,
String state_key)
Deletes an indexing rule defining which collections objects of a specified type should be entered into when the objects move to a specified life cycle state, within a domain. |
void |
deleteIndexingRules(AdminDomainRef domain_ref)
Deletes all indexing rules within a domain. |
private void |
deleteIndexPolicyLists(AdminDomainRef domain_ref)
Deletes the index policy lists for a domain. |
private static void |
editItemCache(Object key,
Object value)
|
protected com.objectspace.jgl.OrderedSet |
eventsToListenTo()
Returns all events that must be subscribed to at startup. |
String |
getConceptualClassname()
Deprecated. |
protected static IndexListCache |
getIndexCache()
Returns (creates if necessary) index list cache. |
IndexPolicyList |
getIndexPolicyList(Selector selector)
Supported API: false |
protected static IndexPolicyList |
getIndexPolicyList(String event_type,
Object target_object)
Returns the index policy list containing all indexers that apply to the specified object for the specified event type. |
static IndexPolicyList |
getIndexPolicyListStatic(Selector selector)
|
IndexPolicyRule |
getIndexPolicyRule(Selector selector)
Returns the index policy rule for the specified selector. |
Enumeration |
getIndexPolicyRules(AdminDomainRef domain_ref)
Returns all the index policy rules for the specified domain in the form of an enumeration. |
private static Object |
getItemFromCache(Object obj)
|
private static String |
getObjectInfo(Persistable object)
|
private static WTPrincipal |
getPrincipal()
|
private static Object |
getPropValueObj(ClassInfo objInfo,
String propStr,
Persistable object)
|
private Selector |
getRuleSelector(AdminDomainRef domain_ref,
String type_id,
String state_key)
Gets an indexing rule selector for the specified domain, type, and state. |
private Selector |
getSelector(long domainRef,
String type)
|
void |
index(Indexable targetObject)
Supported API: false |
void |
index(WTCollection targetCollection)
Index targetCollection . |
private static void |
Log(String s)
|
private static void |
LogBulkIndex(String message,
boolean tee,
boolean override)
|
private static void |
LogBulkIndex(Throwable t)
|
static StandardIndexPolicyManager |
newStandardIndexPolicyManager()
Constructor. |
protected boolean |
objectHasRules(ObjectReference or,
long domainRef)
|
protected boolean |
objectHasRules(VersionReference vr,
long domainRef)
|
protected void |
performStartupProcess()
Initialization process: mostly subscribing to events contained in the rules. |
private void |
printWTCollection(KeyedEvent keyedEvent,
WTCollection indexableCollection)
|
static HashMap |
processRwareRequest(WTCollection targetCollection,
boolean bulkIndex)
|
protected void |
queueRequest(WTCollection targetCollection,
Boolean index)
Queues the result of an event as a Collection of possible events. |
static void |
removeFromIndexer(LinkedList targetCollection,
IndexerSet libraries)
Method that does an update of an objects entry in a Windchill defined collection. |
void |
removeIndex(Indexable targetObject)
Supported API: false |
void |
removeIndex(WTCollection targetCollection)
Remove targetObject from indexes. |
IndexPolicyRule |
removeIndexPolicyRule(Selector selector)
Removes the index policy rule for the given selector. |
void |
subscribe(com.objectspace.jgl.OrderedSet event_list)
Subscribe to the events contained in the set. |
void |
testIndexToRware(String refString)
Supported API: false |
Void |
testUpdateIndex(String oid,
String collection_name)
Supported API: false |
void |
unsubscribe(com.objectspace.jgl.OrderedSet event_list)
Removes the subscription to the events in the list. |
static void |
updateIndexer(WTCollection targetCollection)
Method that does an update of an objects entry in a Windchill defined collection. |
void |
updateIndexingRule(AdminDomainRef domain_ref,
String type_id,
String state_key,
Vector collections)
Updates an indexing rule defining which collections objects of a specified type should be entered into when the objects move to a specified life cycle state, within a domain. |
private void |
updateIndexPolicyList(IndexPolicyList list)
Updates the specified index policy list. |
private void |
updateIndexPolicyLists(AdminDomainRef domain_ref)
Updates all existing index policy lists for the domain passed as argument and its descendents. |
void |
updateIndexPolicyLists(Selector selector)
Updates the policy list for the given selector and all lists whose selector is more specific than the given one. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private KeyedEventListener listener
private static final String INDEX_QUEUE_NAME
private static final String BULK_INDEX_QUEUE
private static IndexListCache indexCache
private ProcessingQueue indexQueue
private static final String ADMIN_RESOURCE
private static boolean VERBOSE_POLICY
private static boolean bulkLog
private static long tempTimer
private static PrintWriter bulkIndexLog
private static final int NRETRIES
private static final int SLEEPTIME
private static boolean USE_QUEUE
private static long QUEUE_INTERVAL
private static boolean INDEX_ENABLED
private static final String DELETE_EVENT
private static String LINE_SEPARATOR
private static String FILE_SEPARATOR
private static SimpleDateFormat DATE_FORMAT
private static ProcessingQueue bulkIndexQueue
private static WTPrincipal principal
private KeyedEventListener vcListener
private KeyedEventListener contentListener
private KeyedEventListener identityListener
private static HashMap contentCache
private static HashMap libraryCache
private static IndexServiceDelegateFactory delegateFactory
Constructor Detail |
public StandardIndexPolicyManager()
Method Detail |
public String getConceptualClassname()
getConceptualClassname
in interface NetFactor
getConceptualClassname
in class StandardManager
protected void queueRequest(WTCollection targetCollection, Boolean index) throws WTException, IOException, WTPropertyVetoException
targetCollection
- index
-
WTException
IOException
WTPropertyVetoException
public static void updateIndexer(WTCollection targetCollection) throws WTException
targetCollection
-
WTException
protected static IndexPolicyList getIndexPolicyList(String event_type, Object target_object) throws WTException
event_type
- Event type used to look up index policy list. Leave this null to get an index policy list requardless of event type. In this case, an index policy list is selected based only on the target object and of that set, one is arbitrarily chosen.target_object
-
WTException
protected void performStartupProcess() throws ManagerException
performStartupProcess
in class StandardManager
ManagerException
public static StandardIndexPolicyManager newStandardIndexPolicyManager() throws WTException
WTException
protected static IndexListCache getIndexCache()
public void index(Indexable targetObject) throws WTException
index
in interface IndexPolicyManager
targetObject
-
WTException
public static void removeFromIndexer(LinkedList targetCollection, IndexerSet libraries) throws WTException
targetCollection
- libraries
-
WTException
public void createIndexingRule(AdminDomainRef domain_ref, String type_id, String state_key, Vector collections) throws WTException
createIndexingRule
in interface IndexPolicyManager
domain_ref
- reference to the domain the rule is fortype_id
- logical or persisted type identifierstate_key
- life cycle state key (State.toString()
value, or null for all states)collections
- collection names (Vector
of String
)
WTException
public void deleteIndexingRule(AdminDomainRef domain_ref, String type_id, String state_key) throws WTException
deleteIndexingRule
in interface IndexPolicyManager
domain_ref
- reference to the domain the rule is fortype_id
- logical or persisted type identifierstate_key
- life cycle state key (State.toString()
value, or null for all states)
WTException
public void deleteIndexingRules(AdminDomainRef domain_ref) throws WTException
This method is intended for testing purposes only, to support automated
tests that need to reinitialize the testing environment.
Supported API: false
deleteIndexingRules
in interface IndexPolicyManager
domain_ref
- reference to the domain the rule is for
WTException
public void updateIndexingRule(AdminDomainRef domain_ref, String type_id, String state_key, Vector collections) throws WTException
updateIndexingRule
in interface IndexPolicyManager
domain_ref
- reference to the domain the rule is fortype_id
- logical or persisted type identifierstate_key
- life cycle state key (State.toString()
value, or null for all states)collections
- collection names (Vector
of String
)
WTException
public void updateIndexPolicyLists(Selector selector) throws WTException
updateIndexPolicyLists
in interface IndexPolicyManager
selector
-
WTException
public IndexPolicyRule addIndexPolicyRule(Selector selector) throws WTException
addIndexPolicyRule
in interface IndexPolicyManager
selector
-
WTException
public IndexPolicyRule getIndexPolicyRule(Selector selector) throws WTException
getIndexPolicyRule
in interface IndexPolicyManager
selector
-
WTException
public Enumeration getIndexPolicyRules(AdminDomainRef domain_ref) throws WTException
getIndexPolicyRules
in interface IndexPolicyManager
domain_ref
-
WTException
public IndexPolicyRule removeIndexPolicyRule(Selector selector) throws WTException
removeIndexPolicyRule
in interface IndexPolicyManager
selector
-
WTException
public Enumeration allIndexers() throws WTException
allIndexers
in interface IndexPolicyManager
WTException
public void subscribe(com.objectspace.jgl.OrderedSet event_list) throws WTException
subscribe
in interface IndexPolicyManager
event_list
-
WTException
public void unsubscribe(com.objectspace.jgl.OrderedSet event_list) throws WTException
unsubscribe
in interface IndexPolicyManager
event_list
-
WTException
public Void testUpdateIndex(String oid, String collection_name) throws WTException, WTPropertyVetoException, IOException
testUpdateIndex
in interface IndexPolicyManager
oid
- collection_name
-
WTException
WTPropertyVetoException
IOException
public void testIndexToRware(String refString) throws WTException
testIndexToRware
in interface IndexPolicyManager
refString
-
WTException
public void index(WTCollection targetCollection) throws WTException
targetCollection
. This is the method that is called
when an event occurs (e.g. check-in) that requires indexing to be
performed. It can also be called at any time to force indexing, although
this is not recommended practice. The recommended practice is to
allow the event listeners to index objects at the correct time, or
by running the BulkIndexTool.
index
in interface IndexPolicyManager
targetCollection
- The targetCollection is the collection of objects that are going to be indexed based on an event or from the bulk index tool
WTException
public void removeIndex(WTCollection targetCollection) throws WTException
targetObject
from indexes. This is the method
that is called when an Indexable object is deleted. This method assumes
targetObject
has been deleted and should only be called
when that is the case. Otherwise, indexing and the indexing rules
will be inconsistent.
removeIndex
in interface IndexPolicyManager
targetCollection
- The targetCollection is the collection of objects that are going to be removed from the indexes based on an event
WTException
public void removeIndex(Indexable targetObject) throws WTException
removeIndex
in interface IndexPolicyManager
targetObject
-
WTException
public IndexPolicyList getIndexPolicyList(Selector selector) throws WTException
getIndexPolicyList
in interface IndexPolicyManager
selector
-
WTException
protected com.objectspace.jgl.OrderedSet eventsToListenTo() throws WTException
WTException
private Selector getRuleSelector(AdminDomainRef domain_ref, String type_id, String state_key) throws WTException
domain_ref
- reference to the domain the rule is fortype_id
- logical or persisted type identifierstate_key
- life cycle state key (State.toString()
value, or null for all states)
WTException
private String collectionsToString(Enumeration collections)
private static IndexerSet constructIndexerSet(Selector selector) throws WTException
selector
- selector.
WTException
- if the selector is not appropriate for a list or
if there was a problem retrieving or creating the list.private static IndexPolicyList createIndexPolicyList(Selector selector) throws WTException
selector
- selector to be associated with the list.
WTException
- if the selector is not appropriate for a list or
if there was a problem retrieving or creating the list.private void deleteIndexPolicyLists(AdminDomainRef domain_ref) throws WTException
domain_ref
-
WTException
private void updateIndexPolicyList(IndexPolicyList list) throws WTException
list
-
WTException
- if there was a problem retrieving or creating
the list.private void updateIndexPolicyLists(AdminDomainRef domain_ref) throws WTException
domain_ref
-
WTException
private static void Log(String s)
private static String getObjectInfo(Persistable object) throws WTIntrospectionException, WTException
WTIntrospectionException
WTException
private static Object getPropValueObj(ClassInfo objInfo, String propStr, Persistable object) throws WTException
WTException
protected boolean objectHasRules(VersionReference vr, long domainRef) throws WTException
WTException
protected boolean objectHasRules(ObjectReference or, long domainRef) throws WTException
WTException
private Selector getSelector(long domainRef, String type) throws WTException
WTException
private static void LogBulkIndex(String message, boolean tee, boolean override)
private static void LogBulkIndex(Throwable t)
private static WTPrincipal getPrincipal() throws IndexPolicyException, WTException
IndexPolicyException
WTException
public static IndexPolicyList getIndexPolicyListStatic(Selector selector) throws WTException
WTException
public static HashMap processRwareRequest(WTCollection targetCollection, boolean bulkIndex) throws WTException
WTException
private void printWTCollection(KeyedEvent keyedEvent, WTCollection indexableCollection)
private static void addItemsToCache(WTCollection indexableCollection) throws WTException, PropertyVetoException
WTException
PropertyVetoException
private static void editItemCache(Object key, Object value)
private static Object getItemFromCache(Object obj)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |