private AdminType getAdminType(final SentiloRequest request) { AdminType adminType = null; try { final String resourcePart = request.getResourcePart(0); if (StringUtils.hasText(resourcePart)) { adminType = AdminType.valueOf(resourcePart.toLowerCase()); } } catch (final IllegalArgumentException e) { // Unknown AdminType. } return adminType; }
@Override public void validateRequestMessageOnGet(final AdminInputMessage requestMessage) throws MessageValidationException { Assert.notNull(requestMessage); if (AdminType.subscriptions.equals(requestMessage.getType()) && !StringUtils.hasText(requestMessage.getEntity())) { throw new MessageValidationException("To get subscriptions from an entity is mandatory to inform the entity"); } super.validateRequestMessageOnGet(requestMessage); } }