Search in sources :

Example 1 with RemotingAction

use of com.canoo.platform.remoting.server.RemotingAction in project dolphin-platform by canoo.

the class LogFilterController method clearStartDate.

@RemotingAction
public void clearStartDate() {
    final LocalDateTime minTime = LocalDateTime.MIN;
    model.setStartDate(ZonedDateTime.of(minTime, ZoneId.systemDefault()));
}
Also used : LocalDateTime(java.time.LocalDateTime) RemotingAction(com.canoo.platform.remoting.server.RemotingAction)

Example 2 with RemotingAction

use of com.canoo.platform.remoting.server.RemotingAction in project dolphin-platform by canoo.

the class LogFilterController method search.

@RemotingAction
public void search() {
    final LoggerSearchRequest request = getCurrentRequest();
    searchListener.forEach(l -> l.accept(request));
}
Also used : LoggerSearchRequest(com.canoo.platform.logger.model.LoggerSearchRequest) RemotingAction(com.canoo.platform.remoting.server.RemotingAction)

Example 3 with RemotingAction

use of com.canoo.platform.remoting.server.RemotingAction in project dolphin-platform by canoo.

the class ControllerUtils method getActionMethodName.

public static String getActionMethodName(final Method method) {
    Assert.requireNonNull(method, "method");
    if (method.isAnnotationPresent(RemotingAction.class)) {
        RemotingAction actionAnnotation = method.getAnnotation(RemotingAction.class);
        String currentActionName = method.getName();
        if (actionAnnotation.value() != null && !actionAnnotation.value().trim().isEmpty()) {
            currentActionName = actionAnnotation.value();
        }
        return currentActionName;
    } else {
        throw new IllegalArgumentException("Method " + method.getName() + " is not annotated with " + RemotingAction.class);
    }
}
Also used : RemotingAction(com.canoo.platform.remoting.server.RemotingAction)

Example 4 with RemotingAction

use of com.canoo.platform.remoting.server.RemotingAction in project dolphin-platform-examples by canoo.

the class DetailController method reload.

@RemotingAction("reload")
public void reload() {
    Long id = model.getId();
    LOGGER.debug("Reload with id {}", id);
    if (id != null) {
        final DataItem item = dataService.find(id);
        model.setName(item.getName());
        model.setDescription(item.getDescription());
    } else {
        model.setName("");
        model.setDescription("");
    }
}
Also used : DataItem(com.guigarage.platform.sample.data.DataItem) RemotingAction(com.canoo.platform.remoting.server.RemotingAction)

Example 5 with RemotingAction

use of com.canoo.platform.remoting.server.RemotingAction in project dolphin-platform by canoo.

the class LogListController method update.

@RemotingAction(UPDATE_ACTION)
public void update() {
    final ZonedDateTime startDate = ZonedDateTime.now().minusDays(1);
    final ZonedDateTime endDateTime = ZonedDateTime.now();
    final Set<Level> level = new HashSet<>(Arrays.asList(Level.values()));
    final int maxResults = 100;
    final LoggerSearchRequest request = new LoggerSearchRequest(startDate, endDateTime, level, maxResults);
    update(request);
}
Also used : ZonedDateTime(java.time.ZonedDateTime) Level(org.slf4j.event.Level) LoggerSearchRequest(com.canoo.platform.logger.model.LoggerSearchRequest) HashSet(java.util.HashSet) RemotingAction(com.canoo.platform.remoting.server.RemotingAction)

Aggregations

RemotingAction (com.canoo.platform.remoting.server.RemotingAction)5 LoggerSearchRequest (com.canoo.platform.logger.model.LoggerSearchRequest)2 DataItem (com.guigarage.platform.sample.data.DataItem)1 LocalDateTime (java.time.LocalDateTime)1 ZonedDateTime (java.time.ZonedDateTime)1 HashSet (java.util.HashSet)1 Level (org.slf4j.event.Level)1