Class CompositeUtil


  • public class CompositeUtil
    extends Object
    Author:
    jdlee
    • Method Detail

      • getModel

        public <T> T getModel​(Class<T> modelIface)
        This method will return a generated concrete class that implements the interface requested, as well as any interfaces intended to extend the base model interface. Model extensions must be annotated with
        Parameters:
        modelIface - The base interface for the desired data model
        Returns:
        An instance of a concrete class implementing the requested interfaces
        Throws:
        Exception
      • getRestModels

        public Set<Class<?>> getRestModels()
      • getResourceExtensions

        public Object getResourceExtensions​(Class<?> baseClass,
                                            Object data,
                                            String method)
        Find and execute all resource extensions for the specified base resource and HTTP method TODO: method enum?
        Parameters:
        baseClass -
        data -
        method -
      • unmarshallClass

        public <T> T unmarshallClass​(Locale locale,
                                     Class<T> modelClass,
                                     jakarta.json.JsonObject json)
                              throws jakarta.json.JsonException
        Convert the given RestModel encoded as Json to a live Java Object.
        Parameters:
        locale -
        modelClass - The target RestModel type
        json - The json encoding of the object
        Returns:
        Throws:
        jakarta.json.JsonException
      • getHelpText

        public String getHelpText​(Annotation[] annos)
        If the HelpText annotation is in the list of Annotations, return the value from the specified bundle for the given key.
        Parameters:
        annos -
        Returns:
      • validateRestModel

        public <T> Set<jakarta.validation.ConstraintViolation<T>> validateRestModel​(Locale locale,
                                                                                    T model)
      • getValidationFailureMessages

        public <T> String getValidationFailureMessages​(Locale locale,
                                                       Set<jakarta.validation.ConstraintViolation<T>> constraintViolations,
                                                       T model)
      • applyChanges

        public void applyChanges​(Map<String,​String> changes,
                                 String basePath,
                                 Subject subject)
        Apply changes to domain.xml
        Parameters:
        changes -
        basePath -
      • executeDeleteCommand

        public ActionReporter executeDeleteCommand​(Subject subject,
                                                   String command)
        Execute a delete AdminCommand with no parameters.
        Parameters:
        subject -
        command -
        Returns:
      • executeDeleteCommand

        public ActionReporter executeDeleteCommand​(Subject subject,
                                                   String command,
                                                   ParameterMap parameters)
        Execute a delete AdminCommand with the specified parameters.
        Parameters:
        subject -
        command -
        parameters -
        Returns:
      • executeDeleteCommandManaged

        public ActionReporter executeDeleteCommandManaged​(Subject subject,
                                                          String command,
                                                          ParameterMap parameters)
        Execute a delete AdminCommand with the specified parameters.
        Parameters:
        subject -
        command -
        parameters -
        Returns:
      • executeWriteCommand

        public ActionReporter executeWriteCommand​(Subject subject,
                                                  String command)
        Execute a writing AdminCommand with no parameters.
        Parameters:
        subject -
        command -
        Returns:
      • executeWriteCommand

        public ActionReporter executeWriteCommand​(Subject subject,
                                                  String command,
                                                  ParameterMap parameters)
        Execute a writing AdminCommand with the specified parameters.
        Parameters:
        subject -
        command -
        parameters -
        Returns:
      • executeWriteCommandManaged

        public ActionReporter executeWriteCommandManaged​(Subject subject,
                                                         String command,
                                                         ParameterMap parameters)
        Execute a writing AdminCommand with the specified parameters as managed job.
        Parameters:
        subject -
        command -
        parameters -
        Returns:
      • executeReadCommand

        public ActionReporter executeReadCommand​(Subject subject,
                                                 String command)
        Execute a read-only AdminCommand with the specified parameters.
        Parameters:
        subject -
        command -
        Returns:
      • executeReadCommand

        public ActionReporter executeReadCommand​(Subject subject,
                                                 String command,
                                                 ParameterMap parameters)
        Execute a read-only AdminCommand with no parameters.
        Parameters:
        subject -
        command -
        parameters -
        Returns:
      • executeCommand

        public ActionReporter executeCommand​(Subject subject,
                                             String command,
                                             ParameterMap parameters,
                                             jakarta.ws.rs.core.Response.Status status,
                                             boolean includeFailureMessage,
                                             boolean throwOnWarning,
                                             boolean managed)
        Execute an AdminCommand with the specified parameters.
        Parameters:
        command -
        parameters -
        throwBadRequest - (vs. NOT_FOUND)
        throwOnWarning - (vs.ignore warning)
        Returns:
      • executeSseCommand

        public org.glassfish.jersey.media.sse.EventOutput executeSseCommand​(Subject subject,
                                                                            String command,
                                                                            ParameterMap parameters)
        Execute an AdminCommand with the specified parameters and return EventOutput suitable for SSE.
      • getLocale

        public Locale getLocale​(jakarta.ws.rs.core.HttpHeaders requestHeaders)
      • getLocale

        public Locale getLocale​(jakarta.ws.rs.core.MultivaluedMap<String,​String> requestHeaders)