Class ApplicationClient


  • public class ApplicationClient
    extends java.lang.Object
    Client library for the Application Service.
    Since:
    3.0.0
    • Constructor Detail

      • ApplicationClient

        public ApplicationClient​(@NotNull
                                 @NotNull retrofit2.Retrofit retrofit)
        Constructor.
        Parameters:
        retrofit - The configured Retrofit client to a Genie server
      • ApplicationClient

        @Deprecated
        public ApplicationClient​(@NotEmpty
                                 @NotEmpty java.lang.String url,
                                 @Nullable
                                 java.util.List<okhttp3.Interceptor> interceptors,
                                 @Nullable
                                 GenieNetworkConfiguration genieNetworkConfiguration)
                          throws GenieClientException
        Constructor.
        Parameters:
        url - The endpoint URL of the Genie API. Not null or empty
        interceptors - Any interceptors to configure the client with, can include security ones
        genieNetworkConfiguration - The network configuration parameters. Could be null
        Throws:
        GenieClientException - On error
    • Method Detail

      • createApplication

        public java.lang.String createApplication​(Application application)
                                           throws java.io.IOException,
                                                  GenieClientException
        Create an application in genie.
        Parameters:
        application - A application object.
        Returns:
        The id of the application created.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • getApplications

        public java.util.List<Application> getApplications()
                                                    throws java.io.IOException,
                                                           GenieClientException
        Method to get a list of all the applications.
        Returns:
        A list of applications.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • getApplications

        public java.util.List<Application> getApplications​(java.lang.String name,
                                                           java.lang.String user,
                                                           java.util.List<java.lang.String> statusList,
                                                           java.util.List<java.lang.String> tagList,
                                                           java.lang.String type)
                                                    throws java.io.IOException
        Method to get a list of all the applications from Genie for the query parameters specified.
        Parameters:
        name - The name of the commands.
        user - The user who created the command.
        statusList - The list of Command statuses.
        tagList - The list of tags.
        type - The type of the application.
        Returns:
        A list of applications.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • getApplications

        public java.util.List<Application> getApplications​(@Nullable
                                                           java.lang.String name,
                                                           @Nullable
                                                           java.lang.String user,
                                                           @Nullable
                                                           java.util.List<java.lang.String> statusList,
                                                           @Nullable
                                                           java.util.List<java.lang.String> tagList,
                                                           @Nullable
                                                           java.lang.String type,
                                                           @Nullable @Min(1L)
                                                           @Min(1L) java.lang.Integer pageSize,
                                                           @Nullable
                                                           SortAttribute sortAttribute,
                                                           @Nullable
                                                           SortDirection sortDirection,
                                                           @Nullable @Min(0L)
                                                           @Min(0L) java.lang.Integer pageIndex)
                                                    throws java.io.IOException
        Method to get a list of all the applications from Genie for the query parameters specified.
        Parameters:
        name - The name of the commands.
        user - The user who created the command.
        statusList - The list of Command statuses.
        tagList - The list of tags.
        type - The type of the application.
        pageSize - The maximum number of results returned
        sortAttribute - The entity attribute used to sort
        sortDirection - The sort direction
        pageIndex - The page index
        Returns:
        A list of applications.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • getApplication

        public Application getApplication​(java.lang.String applicationId)
                                   throws java.io.IOException,
                                          GenieClientException
        Method to get a Application from Genie.
        Parameters:
        applicationId - The id of the application to get.
        Returns:
        The application details.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • deleteApplication

        public void deleteApplication​(java.lang.String applicationId)
                               throws java.io.IOException,
                                      GenieClientException
        Method to delete a application from Genie.
        Parameters:
        applicationId - The id of the application.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • deleteAllApplications

        public void deleteAllApplications()
                                   throws java.io.IOException,
                                          GenieClientException
        Method to delete all applications from Genie.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • patchApplication

        public void patchApplication​(java.lang.String applicationId,
                                     com.github.fge.jsonpatch.JsonPatch patch)
                              throws java.io.IOException,
                                     GenieClientException
        Method to patch a application using json patch instructions.
        Parameters:
        applicationId - The id of the application.
        patch - The patch object specifying all the instructions.
        Throws:
        GenieClientException - For any other error.
        java.io.IOException - If the response received is not 2xx.
      • updateApplication

        public void updateApplication​(java.lang.String applicationId,
                                      Application application)
                               throws java.io.IOException,
                                      GenieClientException
        Method to updated a application.
        Parameters:
        applicationId - The id of the application.
        application - The updated application object to use.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • getCommandsForApplication

        public java.util.List<Command> getCommandsForApplication​(java.lang.String applicationId)
                                                          throws java.io.IOException,
                                                                 GenieClientException
        Method to get all the commands for an application.
        Parameters:
        applicationId - The id of the application.
        Returns:
        The set of commands for the applications.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • getConfigsForApplication

        public java.util.Set<java.lang.String> getConfigsForApplication​(java.lang.String applicationId)
                                                                 throws java.io.IOException,
                                                                        GenieClientException
        Method to get all the configs for a application.
        Parameters:
        applicationId - The id of the application.
        Returns:
        The set of configs for the application.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • addConfigsToApplication

        public void addConfigsToApplication​(java.lang.String applicationId,
                                            java.util.Set<java.lang.String> configs)
                                     throws java.io.IOException,
                                            GenieClientException
        Method to add configs to a application.
        Parameters:
        applicationId - The id of the application.
        configs - The set of configs to add.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • updateConfigsForApplication

        public void updateConfigsForApplication​(java.lang.String applicationId,
                                                java.util.Set<java.lang.String> configs)
                                         throws java.io.IOException,
                                                GenieClientException
        Method to update configs for a application.
        Parameters:
        applicationId - The id of the application.
        configs - The set of configs to add.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • removeAllConfigsForApplication

        public void removeAllConfigsForApplication​(java.lang.String applicationId)
                                            throws java.io.IOException,
                                                   GenieClientException
        Remove all configs for this application.
        Parameters:
        applicationId - The id of the application.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • getDependenciesForApplication

        public java.util.Set<java.lang.String> getDependenciesForApplication​(java.lang.String applicationId)
                                                                      throws java.io.IOException,
                                                                             GenieClientException
        Method to get all the dependency files for an application.
        Parameters:
        applicationId - The id of the application.
        Returns:
        The set of dependencies for the application.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • addDependenciesToApplication

        public void addDependenciesToApplication​(java.lang.String applicationId,
                                                 java.util.Set<java.lang.String> dependencies)
                                          throws java.io.IOException,
                                                 GenieClientException
        Method to add dependencies to a application.
        Parameters:
        applicationId - The id of the application.
        dependencies - The set of dependencies to add.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • updateDependenciesForApplication

        public void updateDependenciesForApplication​(java.lang.String applicationId,
                                                     java.util.Set<java.lang.String> dependencies)
                                              throws java.io.IOException,
                                                     GenieClientException
        Method to update dependencies for a application.
        Parameters:
        applicationId - The id of the application.
        dependencies - The set of dependencies to add.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • removeAllDependenciesForApplication

        public void removeAllDependenciesForApplication​(java.lang.String applicationId)
                                                 throws java.io.IOException,
                                                        GenieClientException
        Remove all dependencies for this application.
        Parameters:
        applicationId - The id of the application.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • getTagsForApplication

        public java.util.Set<java.lang.String> getTagsForApplication​(java.lang.String applicationId)
                                                              throws java.io.IOException,
                                                                     GenieClientException
        Method to get all the tags for a application.
        Parameters:
        applicationId - The id of the application.
        Returns:
        The set of configs for the application.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • addTagsToApplication

        public void addTagsToApplication​(java.lang.String applicationId,
                                         java.util.Set<java.lang.String> tags)
                                  throws java.io.IOException,
                                         GenieClientException
        Method to add tags to a application.
        Parameters:
        applicationId - The id of the application.
        tags - The set of tags to add.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • updateTagsForApplication

        public void updateTagsForApplication​(java.lang.String applicationId,
                                             java.util.Set<java.lang.String> tags)
                                      throws java.io.IOException,
                                             GenieClientException
        Method to update tags for a application.
        Parameters:
        applicationId - The id of the application.
        tags - The set of tags to add.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • removeTagFromApplication

        public void removeTagFromApplication​(java.lang.String applicationId,
                                             java.lang.String tag)
                                      throws java.io.IOException,
                                             GenieClientException
        Remove a tag from a application.
        Parameters:
        applicationId - The id of the application.
        tag - The tag to remove.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • removeAllTagsForApplication

        public void removeAllTagsForApplication​(java.lang.String applicationId)
                                         throws java.io.IOException,
                                                GenieClientException
        Remove all tags for this application.
        Parameters:
        applicationId - The id of the application.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues