|
| 1 | +/* ******************************************************************** |
| 2 | + Licensed to Jasig under one or more contributor license |
| 3 | + agreements. See the NOTICE file distributed with this work |
| 4 | + for additional information regarding copyright ownership. |
| 5 | + Jasig licenses this file to you under the Apache License, |
| 6 | + Version 2.0 (the "License"); you may not use this file |
| 7 | + except in compliance with the License. You may obtain a |
| 8 | + copy of the License at: |
| 9 | +
|
| 10 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +
|
| 12 | + Unless required by applicable law or agreed to in writing, |
| 13 | + software distributed under the License is distributed on |
| 14 | + an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | + KIND, either express or implied. See the License for the |
| 16 | + specific language governing permissions and limitations |
| 17 | + under the License. |
| 18 | +*/ |
| 19 | +package org.bedework.indexer; |
| 20 | + |
| 21 | +import org.bedework.calfacade.configs.IndexProperties; |
| 22 | +import org.bedework.calfacade.indexing.IndexStatsResponse; |
| 23 | +import org.bedework.util.jmx.ConfBaseMBean; |
| 24 | +import org.bedework.util.jmx.MBeanInfo; |
| 25 | + |
| 26 | +import java.util.List; |
| 27 | + |
| 28 | +/** |
| 29 | + * @author douglm |
| 30 | + * |
| 31 | + */ |
| 32 | +public interface BwIndexCtlMBean extends ConfBaseMBean, IndexProperties { |
| 33 | + /** |
| 34 | + * @return number of messages processed |
| 35 | + */ |
| 36 | + long getMessageCount(); |
| 37 | + |
| 38 | + /** |
| 39 | + * @return count processed |
| 40 | + */ |
| 41 | + long getCollectionsUpdated(); |
| 42 | + |
| 43 | + /** |
| 44 | + * @return count processed |
| 45 | + */ |
| 46 | + long getCollectionsDeleted(); |
| 47 | + |
| 48 | + /** |
| 49 | + * @return count processed |
| 50 | + */ |
| 51 | + long getEntitiesUpdated(); |
| 52 | + |
| 53 | + /** |
| 54 | + * @return count processed |
| 55 | + */ |
| 56 | + long getEntitiesDeleted(); |
| 57 | + |
| 58 | + /** Get the current status of the reindexing process |
| 59 | + * |
| 60 | + * @return messages as a list |
| 61 | + */ |
| 62 | + List<String> rebuildStatus(); |
| 63 | + |
| 64 | + /** Crawl the db data and create indexes - listener should have been stopped. |
| 65 | + * |
| 66 | + * @return message |
| 67 | + */ |
| 68 | + String rebuildIndex(); |
| 69 | + |
| 70 | + /** Crawl the db data and reindex the resources - this is done in place. |
| 71 | + * |
| 72 | + * @return message |
| 73 | + */ |
| 74 | + String rebuildEntityIndex(String docType); |
| 75 | + |
| 76 | + /** Creates a new index for use by reindex |
| 77 | + * |
| 78 | + * @return index name. |
| 79 | + */ |
| 80 | + String newIndexes(); |
| 81 | + |
| 82 | + /** Reindex the current docType index into a new index. Used for schema |
| 83 | + * changes etc. |
| 84 | + * |
| 85 | + * @return result. |
| 86 | + */ |
| 87 | + String reindex(String docType); |
| 88 | + |
| 89 | + /** Move the production index alias to the given index |
| 90 | + * |
| 91 | + * @param indexName name of index to be aliased |
| 92 | + * @return result. |
| 93 | + */ |
| 94 | + String setProdAlias(final String indexName); |
| 95 | + |
| 96 | + /** Move the production index aliases to the latest index |
| 97 | + * |
| 98 | + * @return result. |
| 99 | + */ |
| 100 | + String makeAllProd(); |
| 101 | + |
| 102 | + IndexStatsResponse indexStats(String indexName); |
| 103 | + |
| 104 | + /** |
| 105 | + * @return list of indexes maintained by indexer. |
| 106 | + */ |
| 107 | + String listIndexes(); |
| 108 | + |
| 109 | + /** |
| 110 | + * @return list of purged indexes. |
| 111 | + */ |
| 112 | + String purgeIndexes(); |
| 113 | + |
| 114 | + /** Start the indexer |
| 115 | + * |
| 116 | + */ |
| 117 | + void start(); |
| 118 | + |
| 119 | + /** Stop the indexer |
| 120 | + * |
| 121 | + */ |
| 122 | + void stop(); |
| 123 | + |
| 124 | + /** Lifecycle |
| 125 | + * |
| 126 | + * @return true if started |
| 127 | + */ |
| 128 | + boolean isStarted(); |
| 129 | + |
| 130 | + /** (Re)load the configuration |
| 131 | + * |
| 132 | + * @return status |
| 133 | + */ |
| 134 | + @MBeanInfo("(Re)load the configuration") |
| 135 | + String loadConfig(); |
| 136 | +} |
0 commit comments