Skip to content

Commit

Permalink
Merge pull request #138 from openbase/137-improve-autostart-handling
Browse files Browse the repository at this point in the history
Improve Autostart handling
  • Loading branch information
lhuxohl authored Mar 26, 2024
2 parents 81b0618 + c9c888a commit 80d787a
Show file tree
Hide file tree
Showing 29 changed files with 1,900 additions and 1,891 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
Expand All @@ -34,7 +34,6 @@
import org.openbase.jul.communication.iface.RPCServer;
import org.openbase.jul.exception.CouldNotPerformException;
import org.openbase.jul.exception.InitializationException;
import org.openbase.jul.exception.InstantiationException;
import org.openbase.jul.exception.NotAvailableException;
import org.openbase.jul.extension.type.processing.MetaConfigPool;
import org.openbase.jul.extension.type.processing.MetaConfigVariableProvider;
Expand Down Expand Up @@ -65,14 +64,12 @@ public class CloudConnectorApp extends AbstractAppController implements CloudCon
private static final Logger LOGGER = LoggerFactory.getLogger(CloudConnectorApp.class);

private final CloudConnectorTokenStore tokenStore;
private final JsonParser jsonParser;
private final Map<String, SocketWrapper> userIdSocketMap;

public CloudConnectorApp() throws InstantiationException {
public CloudConnectorApp() {
super();
this.userIdSocketMap = new HashMap<>();
this.tokenStore = new CloudConnectorTokenStore();
this.jsonParser = new JsonParser();
}

@Override
Expand Down Expand Up @@ -235,7 +232,8 @@ public Future<AuthenticatedValue> connect(final AuthenticatedValue authenticated
socketWrapper.activate();
socketWrapper.getLoginFuture().get(10, TimeUnit.SECONDS);
}
} catch (CouldNotPerformException | ExecutionException | InterruptedException | TimeoutException ex) {
} catch (CouldNotPerformException | ExecutionException | InterruptedException |
TimeoutException ex) {
if (ex instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
Expand Down Expand Up @@ -278,7 +276,7 @@ public Future<AuthenticatedValue> register(AuthenticatedValue authenticatedValue

try {
// parse string as json
final JsonObject params = jsonParser.parse(jsonString).getAsJsonObject();
final JsonObject params = JsonParser.parseString(jsonString).getAsJsonObject();

// validate that password hash is available
if (!params.has(PASSWORD_HASH_KEY)) {
Expand Down

This file was deleted.

Loading

0 comments on commit 80d787a

Please sign in to comment.