@Override public Object convertValue(final ActionFields e, final String value) { if (STATUS.equals(e)) { return convertStatusValue(value); } return value; }
@Override public String[] possibleValues(final ActionFields e) { if (STATUS.equals(e)) { return new String[] { ACTIVE, INACTIVE }; } return new String[0]; } }
static Sort sanitizeActionSortParam(final String sortParam) { if (sortParam == null) { // default sort is DESC in case of action to match behavior // of management UI (last entry on top) return new Sort(Direction.DESC, ActionFields.ID.getFieldName()); } return new Sort(SortUtility.parse(ActionFields.class, sortParam)); }
@Override public String[] possibleValues(final ActionFields e) { if (STATUS.equals(e)) { return new String[] { ACTIVE, INACTIVE }; } return new String[0]; } }
/** * Add links to a target response. * * @param response * the target response */ public static void addTargetLinks(final MgmtTarget response) { response.add(linkTo(methodOn(MgmtTargetRestApi.class).getAssignedDistributionSet(response.getControllerId())) .withRel(MgmtRestConstants.TARGET_V1_ASSIGNED_DISTRIBUTION_SET)); response.add(linkTo(methodOn(MgmtTargetRestApi.class).getInstalledDistributionSet(response.getControllerId())) .withRel(MgmtRestConstants.TARGET_V1_INSTALLED_DISTRIBUTION_SET)); response.add(linkTo(methodOn(MgmtTargetRestApi.class).getAttributes(response.getControllerId())) .withRel(MgmtRestConstants.TARGET_V1_ATTRIBUTES)); response.add(linkTo(methodOn(MgmtTargetRestApi.class).getActionHistory(response.getControllerId(), 0, MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE, ActionFields.ID.getFieldName() + ":" + SortDirection.DESC, null)) .withRel(MgmtRestConstants.TARGET_V1_ACTIONS).expand()); response.add(linkTo(methodOn(MgmtTargetRestApi.class).getMetadata(response.getControllerId(), MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET_VALUE, MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE, null, null)).withRel("metadata")); }
@Override public Object convertValue(final ActionFields e, final String value) { if (STATUS.equals(e)) { return convertStatusValue(value); } return value; }