ReindexView.java
1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package org.legrog.web.xyz;
import org.legrog.web.account.AccountService;
import org.legrog.web.publisher.PublisherService;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
import java.io.Serializable;
/**
* View for reindex.xhtml
*/
@Named
@RequestScoped
public class ReindexView implements Serializable {
private int indexedAccountsNumber;
private int indexedPublishersNumber;
private PublisherService publisherService;
private AccountService accountService;
@Inject
ReindexView(PublisherService publisherService, AccountService accountService) {
this.publisherService = publisherService;
this.accountService = accountService;
}
ReindexView() {
//no args constructor to make it proxyable
}
public void reindexAll() {
indexedPublishersNumber = publisherService.reindexAllPublishers();
indexedAccountsNumber = accountService.reindexAllAccounts();
}
public int getIndexedAccountsNumber() {
return indexedAccountsNumber;
}
public void setIndexedAccountsNumber(int indexedAccountsNumber) {
this.indexedAccountsNumber = indexedAccountsNumber;
}
public int getIndexedPublishersNumber() {
return indexedPublishersNumber;
}
public void setIndexedPublishersNumber(int indexedPublishersNumber) {
this.indexedPublishersNumber = indexedPublishersNumber;
}
}