Skip to content

Commit

Permalink
Merge pull request #3264 from Coduz/feature-inventoryV1
Browse files Browse the repository at this point in the history
[Feature] Device Management INVENTORY-V1
  • Loading branch information
Coduz authored Mar 15, 2021
2 parents 874d57c + 99e9674 commit a3db71e
Show file tree
Hide file tree
Showing 250 changed files with 6,742 additions and 1,052 deletions.
2 changes: 2 additions & 0 deletions assembly/broker/descriptors/kapua-broker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@
<include>${pom.groupId}:kapua-device-management-command-internal</include>
<include>${pom.groupId}:kapua-device-management-configuration-api</include>
<include>${pom.groupId}:kapua-device-management-configuration-internal</include>
<include>${pom.groupId}:kapua-device-management-inventory-api</include>
<include>${pom.groupId}:kapua-device-management-inventory-internal</include>
<include>${pom.groupId}:kapua-device-management-job-api</include>
<include>${pom.groupId}:kapua-device-management-job-internal</include>
<include>${pom.groupId}:kapua-device-management-packages-api</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ public enum GwtKapuaErrorCode {
INVALID_XSRF_TOKEN,
LOCKED_USER,
OVER_RULE_LIMIT,
BUNDLE_GET_ERROR,
INVENTORY_GET_ERROR,
REQUEST_BAD_METHOD,
UNAUTHENTICATED,
SEND_ERROR,
WARNING,
XSRF_INVALID_TOKEN,
PARENT_LIMIT_EXCEEDED_IN_CONFIG,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.eclipse.kapua.app.console.module.api.client.ui.tab.EntityDescriptionTabItem;
import org.eclipse.kapua.app.console.module.api.shared.model.GwtGroupedNVPair;
import org.eclipse.kapua.app.console.module.api.shared.model.session.GwtSession;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtDeviceConnection;
import org.eclipse.kapua.app.console.module.device.shared.model.connection.GwtDeviceConnection;
import org.eclipse.kapua.app.console.module.device.shared.service.GwtDeviceConnectionService;
import org.eclipse.kapua.app.console.module.device.shared.service.GwtDeviceConnectionServiceAsync;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import org.eclipse.kapua.app.console.module.api.client.ui.view.descriptor.AbstractEntityTabDescriptor;
import org.eclipse.kapua.app.console.module.api.shared.model.session.GwtSession;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtDeviceConnection;
import org.eclipse.kapua.app.console.module.device.shared.model.connection.GwtDeviceConnection;

public class ConnectionDescriptionTabDescriptor extends AbstractEntityTabDescriptor<GwtDeviceConnection, ConnectionDescriptionTab, ConnectionView> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;

import org.eclipse.kapua.app.console.module.api.client.GwtKapuaErrorCode;
import org.eclipse.kapua.app.console.module.api.client.GwtKapuaException;
import org.eclipse.kapua.app.console.module.api.client.ui.dialog.entity.EntityAddEditDialog;
Expand All @@ -35,9 +34,9 @@
import org.eclipse.kapua.app.console.module.api.client.util.FailureHandler;
import org.eclipse.kapua.app.console.module.api.shared.model.session.GwtSession;
import org.eclipse.kapua.app.console.module.device.client.messages.ConsoleConnectionMessages;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtDeviceConnection;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtDeviceConnection.GwtConnectionUserCouplingMode;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtDeviceConnectionOption;
import org.eclipse.kapua.app.console.module.device.shared.model.connection.GwtDeviceConnection;
import org.eclipse.kapua.app.console.module.device.shared.model.connection.GwtDeviceConnection.GwtConnectionUserCouplingMode;
import org.eclipse.kapua.app.console.module.device.shared.model.connection.GwtDeviceConnectionOption;
import org.eclipse.kapua.app.console.module.device.shared.service.GwtDeviceConnectionOptionService;
import org.eclipse.kapua.app.console.module.device.shared.service.GwtDeviceConnectionOptionServiceAsync;
import org.eclipse.kapua.app.console.module.user.shared.model.GwtUser;
Expand Down Expand Up @@ -196,7 +195,7 @@ public void onFailure(Throwable cause) {
if (gwtCause.getCode().equals(GwtKapuaErrorCode.INTERNAL_ERROR)) {
reservedUserCombo.markInvalid(cause.getMessage());
}
FailureHandler.handle(cause);
FailureHandler.handle(cause);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
*******************************************************************************/
package org.eclipse.kapua.app.console.module.device.client.connection;

import com.extjs.gxt.ui.client.data.ListLoadResult;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.Label;
import com.extjs.gxt.ui.client.widget.VerticalPanel;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import org.eclipse.kapua.app.console.module.api.client.ui.grid.EntityGrid;
import org.eclipse.kapua.app.console.module.api.client.ui.panel.EntityFilterPanel;
import org.eclipse.kapua.app.console.module.api.client.ui.view.AbstractEntityView;
Expand All @@ -20,26 +29,16 @@
import org.eclipse.kapua.app.console.module.api.client.util.CssLiterals;
import org.eclipse.kapua.app.console.module.api.shared.model.session.GwtSession;
import org.eclipse.kapua.app.console.module.device.client.messages.ConsoleConnectionMessages;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtDeviceConnection;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtDeviceConnectionQuery;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtDeviceConnectionQueryPredicates.GwtDeviceConnectionReservedUser;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtDeviceConnectionQueryPredicates.GwtDeviceConnectionUser;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtDeviceQueryPredicates;
import org.eclipse.kapua.app.console.module.device.shared.model.connection.GwtDeviceConnection;
import org.eclipse.kapua.app.console.module.device.shared.model.connection.GwtDeviceConnectionQuery;
import org.eclipse.kapua.app.console.module.device.shared.model.connection.GwtDeviceConnectionQueryPredicates.GwtDeviceConnectionReservedUser;
import org.eclipse.kapua.app.console.module.device.shared.model.connection.GwtDeviceConnectionQueryPredicates.GwtDeviceConnectionUser;
import org.eclipse.kapua.app.console.module.user.shared.model.GwtUser;
import org.eclipse.kapua.app.console.module.user.shared.model.permission.UserSessionPermission;
import org.eclipse.kapua.app.console.module.user.shared.service.GwtUserService;
import org.eclipse.kapua.app.console.module.user.shared.service.GwtUserServiceAsync;

import com.extjs.gxt.ui.client.data.ListLoadResult;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.Label;
import com.extjs.gxt.ui.client.widget.VerticalPanel;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class ConnectionFilterPanel extends EntityFilterPanel<GwtDeviceConnection> {

private static final int WIDTH = 193;
Expand Down Expand Up @@ -175,7 +174,7 @@ public void onFailure(Throwable arg0) {
}
});
fieldsPanel.add(userCombo);
}
}

Label protocolLabel = new Label(MSGS.connectionFilterProtocolLabel());
protocolLabel.setWidth(WIDTH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;

import org.eclipse.kapua.app.console.module.api.client.messages.ConsoleMessages;
import org.eclipse.kapua.app.console.module.api.client.resources.icons.IconSet;
import org.eclipse.kapua.app.console.module.api.client.resources.icons.KapuaIcon;
Expand All @@ -36,8 +35,8 @@
import org.eclipse.kapua.app.console.module.api.shared.model.session.GwtSession;
import org.eclipse.kapua.app.console.module.device.client.connection.toolbar.ConnectionGridToolbar;
import org.eclipse.kapua.app.console.module.device.client.messages.ConsoleConnectionMessages;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtDeviceConnection;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtDeviceConnectionQuery;
import org.eclipse.kapua.app.console.module.device.shared.model.connection.GwtDeviceConnection;
import org.eclipse.kapua.app.console.module.device.shared.model.connection.GwtDeviceConnectionQuery;
import org.eclipse.kapua.app.console.module.device.shared.model.permission.DeviceConnectionSessionPermission;
import org.eclipse.kapua.app.console.module.device.shared.service.GwtDeviceConnectionService;
import org.eclipse.kapua.app.console.module.device.shared.service.GwtDeviceConnectionServiceAsync;
Expand Down Expand Up @@ -102,32 +101,32 @@ protected List<ColumnConfig> getColumns() {

@Override
public String render(GwtDeviceConnection gwtDeviceConnection, String property, ColumnData config, int rowIndex, int colIndex, ListStore<GwtDeviceConnection> deviceList,
Grid<GwtDeviceConnection> grid) {
Grid<GwtDeviceConnection> grid) {

KapuaIcon icon;
if (gwtDeviceConnection.getConnectionStatusEnum() != null) {
switch (gwtDeviceConnection.getConnectionStatusEnum()) {
case CONNECTED:
icon = new KapuaIcon(IconSet.PLUG);
icon.setColor(Color.GREEN);
icon.setTitle(CONNECTION_MSGS.connected());
break;
case DISCONNECTED:
icon = new KapuaIcon(IconSet.PLUG);
icon.setColor(Color.YELLOW);
icon.setTitle(CONNECTION_MSGS.disconnected());
break;
case MISSING:
icon = new KapuaIcon(IconSet.PLUG);
icon.setColor(Color.RED);
icon.setTitle(CONNECTION_MSGS.missing());
break;
default:
icon = new KapuaIcon(IconSet.PLUG);
icon.setColor(Color.GREY);
icon.setTitle(CONNECTION_MSGS.unknown());

break;
case CONNECTED:
icon = new KapuaIcon(IconSet.PLUG);
icon.setColor(Color.GREEN);
icon.setTitle(CONNECTION_MSGS.connected());
break;
case DISCONNECTED:
icon = new KapuaIcon(IconSet.PLUG);
icon.setColor(Color.YELLOW);
icon.setTitle(CONNECTION_MSGS.disconnected());
break;
case MISSING:
icon = new KapuaIcon(IconSet.PLUG);
icon.setColor(Color.RED);
icon.setTitle(CONNECTION_MSGS.missing());
break;
default:
icon = new KapuaIcon(IconSet.PLUG);
icon.setColor(Color.GREY);
icon.setTitle(CONNECTION_MSGS.unknown());

break;
}
} else {
icon = new KapuaIcon(IconSet.PLUG);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.eclipse.kapua.app.console.module.api.client.ui.view.AbstractEntityView;
import org.eclipse.kapua.app.console.module.api.shared.model.session.GwtSession;
import org.eclipse.kapua.app.console.module.device.client.messages.ConsoleConnectionMessages;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtDeviceConnection;
import org.eclipse.kapua.app.console.module.device.shared.model.connection.GwtDeviceConnection;

public class ConnectionView extends AbstractEntityView<GwtDeviceConnection> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.eclipse.kapua.app.console.module.api.client.ui.view.EntityView;
import org.eclipse.kapua.app.console.module.api.client.ui.view.descriptor.AbstractEntityViewDescriptor;
import org.eclipse.kapua.app.console.module.api.shared.model.session.GwtSession;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtDeviceConnection;
import org.eclipse.kapua.app.console.module.device.shared.model.connection.GwtDeviceConnection;
import org.eclipse.kapua.app.console.module.device.shared.model.permission.DeviceConnectionSessionPermission;

public class ConnectionViewDescriptor extends AbstractEntityViewDescriptor<GwtDeviceConnection> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.eclipse.kapua.app.console.module.api.client.ui.widget.EntityCRUDToolbar;
import org.eclipse.kapua.app.console.module.api.shared.model.session.GwtSession;
import org.eclipse.kapua.app.console.module.device.client.connection.ConnectionEditDialog;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtDeviceConnection;
import org.eclipse.kapua.app.console.module.device.shared.model.connection.GwtDeviceConnection;

public class ConnectionGridToolbar extends EntityCRUDToolbar<GwtDeviceConnection> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.eclipse.kapua.app.console.module.api.client.util.SwappableListStore;
import org.eclipse.kapua.app.console.module.api.shared.model.session.GwtSession;
import org.eclipse.kapua.app.console.module.device.client.messages.ConsoleDeviceMessages;
import org.eclipse.kapua.app.console.module.device.shared.model.GwtChannel;
import org.eclipse.kapua.app.console.module.device.shared.model.management.assets.GwtChannel;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -84,7 +84,7 @@ private void initDetailsGrid() {

@Override
protected void load(Object loadConfig,
AsyncCallback<PagingLoadResult<GwtChannel>> callback) {
AsyncCallback<PagingLoadResult<GwtChannel>> callback) {
}
};
ListLoader<ListLoadResult<GwtChannel>> loader = new BaseListLoader<ListLoadResult<GwtChannel>>(proxy);
Expand Down
Loading

0 comments on commit a3db71e

Please sign in to comment.