Creating a command REST interface


Command (com.bmc.arsys.rx.services.common.Command) is a built-in resource that provides a simple way of providing a custom execute method with parameters. The purpose of command is to execute some code using parameters supplied with the PUT operation. Commands are the operations that have some operational effect on the system, such as starting a server, or take some business action (for example, close an incident).

Sample command Rest interface:

@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include =
JsonTypeInfo.As.PROPERTY, property = "resourceType")

public
abstract class Command implements Registerable
 …
public
class ClearApplicationDataCommand extends Command {
  …
    @AccessControlledMethod(authorization
= AuthorizationLevel.SubAdministrator, licensing =         LicensingLevel.Application,
checkSchemaForSpecialAccess = true, promoteStructAdmin = true)
    @Override
   public URI execute(UriInfo uriInfo) {
       processService =
ServiceLocator.getProcessService();
       recordService = ServiceLocator.getRecordService();
       deleteNoteTaskInstances();
       deleteSetOfProcessDefinition();
       return null;
    }
}


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*