Rimosso caricamento profili allo start.
Aggiunto ulteriore controllo su licenza
This commit is contained in:
parent
d142f0c868
commit
a2d165d475
@ -0,0 +1,8 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
public class NotValidLicenseException extends Exception {
|
||||||
|
|
||||||
|
public NotValidLicenseException() {
|
||||||
|
super("Licenza non valida");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -5,6 +5,7 @@ import android.util.Log;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.exception.NotValidLicenseException;
|
||||||
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
||||||
import it.integry.integrywmsnative.core.rest.model.EsitoType;
|
import it.integry.integrywmsnative.core.rest.model.EsitoType;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
@ -41,7 +42,9 @@ public class _BaseRESTConsumer {
|
|||||||
if (response.code() == 404) {
|
if (response.code() == 404) {
|
||||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url().toString() + ")");
|
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url().toString() + ")");
|
||||||
onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")"));
|
onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")"));
|
||||||
} else {
|
} else if (response.code() == 550)
|
||||||
|
onFailed.run(new NotValidLicenseException());
|
||||||
|
else {
|
||||||
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||||
onFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
|
onFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,8 +91,8 @@ public class SettingsManager {
|
|||||||
onProgress.run("dati azienda");
|
onProgress.run("dati azienda");
|
||||||
loadDatiAzienda(() -> {
|
loadDatiAzienda(() -> {
|
||||||
|
|
||||||
onProgress.run("profili");
|
// onProgress.run("profili");
|
||||||
loadAvailableProfiles(() -> {
|
// loadAvailableProfiles(() -> {
|
||||||
|
|
||||||
onProgress.run("depositi");
|
onProgress.run("depositi");
|
||||||
loadAvailableCodMdeps(() -> {
|
loadAvailableCodMdeps(() -> {
|
||||||
@ -104,7 +104,7 @@ public class SettingsManager {
|
|||||||
loadGestSetupValues(tmpOnComplete, tmpOnFailed);
|
loadGestSetupValues(tmpOnComplete, tmpOnFailed);
|
||||||
}, tmpOnFailed);
|
}, tmpOnFailed);
|
||||||
}, tmpOnFailed);
|
}, tmpOnFailed);
|
||||||
}, tmpOnFailed);
|
// }, tmpOnFailed);
|
||||||
}, tmpOnFailed);
|
}, tmpOnFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import java.net.InetSocketAddress;
|
|||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.net.SocketAddress;
|
import java.net.SocketAddress;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.exception.NotValidLicenseException;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.gest.login.exception.ServerNotReachableException;
|
import it.integry.integrywmsnative.gest.login.exception.ServerNotReachableException;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
@ -53,7 +54,7 @@ public class UtilityServer {
|
|||||||
else if (response.code() == 404)
|
else if (response.code() == 404)
|
||||||
onFailed.run(new ServerNotReachableException(serverAddress, serverTCPport, null));
|
onFailed.run(new ServerNotReachableException(serverAddress, serverTCPport, null));
|
||||||
else if (response.code() == 550)
|
else if (response.code() == 550)
|
||||||
onFailed.run(new Exception("Licenza non valida"));
|
onFailed.run(new NotValidLicenseException());
|
||||||
else onFailed.run(new Exception("Errore non identificato (STATUS: " + response.code() + ")"));
|
else onFailed.run(new Exception("Errore non identificato (STATUS: " + response.code() + ")"));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
onFailed.run(new ServerNotReachableException(serverAddress, serverTCPport, e));
|
onFailed.run(new ServerNotReachableException(serverAddress, serverTCPport, e));
|
||||||
|
|||||||
@ -55,8 +55,6 @@ public class LoginViewModel {
|
|||||||
|
|
||||||
mLoginRESTConsumer.authenticate(host, port, username, password, loginDTO -> {
|
mLoginRESTConsumer.authenticate(host, port, username, password, loginDTO -> {
|
||||||
|
|
||||||
SettingsManager.iDB().setAvailableProfiles(loginDTO.getAvailableProfiles());
|
|
||||||
|
|
||||||
SettingsManager.i().createUserSession();
|
SettingsManager.i().createUserSession();
|
||||||
SettingsManager.i().getUser().setFullname(!UtilityString.isNullOrEmpty(loginDTO.getFull_name()) ? loginDTO.getFull_name() : username);
|
SettingsManager.i().getUser().setFullname(!UtilityString.isNullOrEmpty(loginDTO.getFull_name()) ? loginDTO.getFull_name() : username);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user