Openbravo Issue Tracking System - Retail Modules |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0036044 | Retail Modules | StoreServer | public | 2017-05-18 18:23 | 2017-06-16 17:36 |
|
Reporter | AugustoMauch | |
Assigned To | mtaal | |
Priority | normal | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | RR17Q3 | |
Merge Request Status | |
Review Assigned To | mtaal |
OBNetwork customer | No |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0036044: Logical duplication in the MobileServerTransitionToOnlineHandler and CheckServerOfflineHandler classes |
Description | The purpose of the CheckServerOfflineHandler and MobileServerTransitionToOnlineHandler classes is very similar:
- CheckServerOfflineHandler is used by the ServerStateBackground process to know if a server must go offline
- MobileServerTransitionToOnlineHandler is used by the MobileServerController.TransitionToOnline to know if a server can go online
In most cases, maybe in all, if for some reason a server must go offline, for that same reason the server cannot go online.
It would be better if we could remove the duplication in logic that there in these two classes. |
Steps To Reproduce | - |
Proposed Solution | |
Additional Information | |
Tags | No tags attached. |
Relationships | |
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2017-05-18 18:23 | AugustoMauch | New Issue | |
2017-05-18 18:23 | AugustoMauch | Assigned To | => StoreServer |
2017-05-18 18:23 | AugustoMauch | OBNetwork customer | => No |
2017-05-18 18:23 | AugustoMauch | Triggers an Emergency Pack | => No |
2017-05-18 18:23 | AugustoMauch | Assigned To | StoreServer => mtaal |
2017-05-21 21:24 | mtaal | Note Added: 0096688 | |
2017-05-22 15:46 | mtaal | Note Added: 0096715 | |
2017-06-08 10:15 | mtaal | Review Assigned To | => AugustoMauch |
2017-06-08 13:44 | hgbot | Checkin | |
2017-06-08 13:44 | hgbot | Note Added: 0097218 | |
2017-06-08 13:44 | hgbot | Status | new => resolved |
2017-06-08 13:44 | hgbot | Resolution | open => fixed |
2017-06-08 13:44 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/746e879cffeed5352f18f39ffeefcd9830f9d209 [^] |
2017-06-14 18:31 | AugustoMauch | Review Assigned To | AugustoMauch => mtaal |
2017-06-15 09:53 | AugustoMauch | Note Added: 0097407 | |
2017-06-16 17:36 | mtaal | Note Added: 0097454 | |
2017-06-16 17:36 | mtaal | Status | resolved => closed |
2017-06-16 17:36 | mtaal | Fixed in Version | => RR17Q3 |
Notes |
|
(0096688)
|
mtaal
|
2017-05-21 21:24
|
|
The two mentioned classes have different purposes:
- CheckServerOfflineHandler: is called to determine if transition to online can be done
- MobileServerTransitionToOnlineHandler: are called when transition to online is possible because servers are reachable. Is used to execute integrations/transactions during transition.
So the purpose of these classes is different, one is called to determine if transition to online can be done, the other is called to execute transition to online.
Having said this it makes sense to again check the CheckServerOfflineHandler instances during transition to online to be sure that transition to online is possible/valid.
http://wiki.openbravo.com/wiki/How_to_implement_custom_offline_checking [^]
http://wiki.openbravo.com/wiki/How_to_Write_Online_Transition_Handlers [^] |
|
|
(0096715)
|
mtaal
|
2017-05-22 15:46
|
|
To test the changes you can add this code somewhere to force offline:
public static class LocalOfflineChecker extends CheckServerOfflineHandler {
@Override
public boolean isServerOffline() {
return true;
}
}
public static class LocalTransitionToOnlineHandler extends MobileServerTransitionToOnlineHandler {
@Override
public void processTransactions() {
// do it
}
@Override
public boolean isReadyToGoOnline() {
return false;
}
@Override
public String getOfflineLog() {
return super.getOfflineLog();
}
} |
|
|
(0097218)
|
hgbot
|
2017-06-08 13:44
|
|
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 746e879cffeed5352f18f39ffeefcd9830f9d209
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Thu Jun 08 13:43:54 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/746e879cffeed5352f18f39ffeefcd9830f9d209 [^]
Fixes issue 36044: Logical duplication in the MobileServerTransitionToOnlineHandler and CheckServerOfflineHandler classes
Also use the offline handlers in the transition to online code
---
M src/org/openbravo/mobile/core/servercontroller/MobileServerController.java
---
|
|
|
|
|
|
(0097454)
|
mtaal
|
2017-06-16 17:36
|
|
|