Class ApiMethods


  • public final class ApiMethods
    extends Object
    it allows to add usernames, groupnames, and authentication types security for api service such as REST, SOAP API
    • Constructor Summary

      Constructors 
      Constructor Description
      ApiMethods​(MartiniPackageProvider packageProvider, io.toro.martini.permissions.AccessControlService accessControlService)  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addApiAuthType​(String namespace, String authType)
      Add authentication type to the API service within current package Authentication types:
      static void addApiAuthType​(String packageName, String namespace, String authType)
      Add authentication type to the API service within a specific package by providing the packageName Authentication types:
      static void addApiAuthTypes​(String packageName, String namespace, List<String> authTypes)
      Add authentication types to the API service within a specific package by providing the packageName Authentication types:
      static void addApiAuthTypes​(String namespace, List<String> authTypes)
      Add authentication types to the API service within the current package Authentication types:
      static void addApiGroup​(String namespace, String groupName)
      Add groupName authentication to the API service within current package
      static void addApiGroup​(String packageName, String namespace, String groupName)
      Add groupName authentication to the API service within a specific package by providing the packageName
      static void addApiGroups​(String packageName, String namespace, Set<String> groupNames)
      Add groupNames authentication to the API service within a specific package by providing the packageName
      static void addApiGroups​(String namespace, Set<String> groupNames)
      Add groupNames authentication to the API service within the current package
      static void addApiUser​(String namespace, String username)
      Add username to the API service within the current package
      static void addApiUser​(String packageName, String namespace, String username)
      Add username authentication to the API service within a specific package by providing the packageName.
      static void addApiUsers​(String packageName, String namespace, Set<String> usernames)
      Add usernames authentication to the API service within a specific package by providing the packageName
      static void addApiUsers​(String namespace, Set<String> usernames)
      Add usernames authentication to the API service within a specific package.
      static void removeApiAuthType​(String namespace, String authType)
      Remove authentication type to the API service within the current package Authentication types:
      static void removeApiAuthType​(String packageName, String namespace, String authType)
      Remove authentication type to the API service within a specific package by providing the packageName Authentication types:
      static void removeApiAuthTypes​(String packageName, String namespace, List<String> authTypes)
      Remove authentication types to the API service within a specific package by providing the packageName Authentication types:
      static void removeApiAuthTypes​(String namespace, List<String> authTypes)
      Remove authentication types to the API service within the current package Authentication types:
      static void removeApiGroup​(String namespace, String groupName)
      Remove groupName authentication to the API service within current package
      static void removeApiGroup​(String packageName, String namespace, String groupName)
      Remove groupName authentication to the API service within a specify package by providing the packageName
      static void removeApiGroups​(String packageName, String namespace, List<String> groupNames)
      Remove groupNames authentication to the API service within a specify package by providing the packageName
      static void removeApiGroups​(String namespace, List<String> groupNames)
      Remove groupNames authentication to the API service within the current package
      static void removeApiUser​(String namespace, String username)
      Remove username authentication to the API service within the current package
      static void removeApiUser​(String packageName, String namespace, String username)
      Remove username authentication to the API service within a specific package by providing the packageName.
      static void removeApiUsers​(String packageName, String namespace, List<String> usernames)
      Remove usernames authentication to the API service within a specific package by providing the packageName.
      static void removeApiUsers​(String namespace, List<String> usernames)
      Remove usernames authentication to the API service within the current
    • Method Detail

      • addApiAuthType

        public static void addApiAuthType​(@GloopParameter(allowNull=false)
                                          String namespace,
                                          @GloopParameter(choices={"NONE","BASIC","OAUTH2"},allowNull=false)
                                          String authType)
                                   throws GloopException
        Add authentication type to the API service within current package Authentication types:

        NONE

        BASIC

        OAUTH2

        Note: Adding NONE as authentication type will remove all the types

        Parameters:
        namespace - - the namespace of the api service
        authType - - the authentication type to be added
        Throws:
        GloopException - - if the api service is not found
      • addApiAuthType

        public static void addApiAuthType​(@GloopParameter(allowNull=false)
                                          String packageName,
                                          @GloopParameter(allowNull=false)
                                          String namespace,
                                          @GloopParameter(choices={"NONE","BASIC","OAUTH2"},allowNull=false)
                                          String authType)
                                   throws GloopException
        Add authentication type to the API service within a specific package by providing the packageName Authentication types:

        NONE

        BASIC

        OAUTH2

        Note: Adding NONE as authentication type will remove all the types

        Parameters:
        packageName - - specify the package name
        namespace - - the namespace of the api service
        authType - - the authentication type to be added
        Throws:
        GloopException - - if the api service is not found
      • addApiAuthTypes

        public static void addApiAuthTypes​(@GloopParameter(allowNull=false)
                                           String namespace,
                                           @GloopParameter(choices={"NONE","BASIC","OAUTH2"},allowNull=false)
                                           List<String> authTypes)
                                    throws GloopException
        Add authentication types to the API service within the current package Authentication types:

        NONE

        BASIC

        OAUTH2

        Note: Adding NONE authentication type will remove all the types

        Parameters:
        namespace - - the namespace of the api service
        authTypes - - the authentication types to be added
        Throws:
        GloopException - - if the api service is not found
      • addApiAuthTypes

        public static void addApiAuthTypes​(@GloopParameter(allowNull=false)
                                           String packageName,
                                           @GloopParameter(allowNull=false)
                                           String namespace,
                                           @GloopParameter(choices={"NONE","BASIC","OAUTH2"},allowNull=false)
                                           List<String> authTypes)
                                    throws GloopException
        Add authentication types to the API service within a specific package by providing the packageName Authentication types:

        NONE

        BASIC

        OAUTH2

        Note: Adding NONE authentication type will remove all the types

        Parameters:
        packageName - - specify the package name
        namespace - - the namespace of the api service
        authTypes - - the authentication types to be added
        Throws:
        GloopException - - if the api service is not found
      • addApiUser

        public static void addApiUser​(@GloopParameter(allowNull=false)
                                      String namespace,
                                      String username)
                               throws GloopException
        Add username to the API service within the current package
        Parameters:
        namespace - - the namespace of the api service
        username - - the username to be added
        Throws:
        GloopException - - if the api service is not found
      • addApiUser

        public static void addApiUser​(@GloopParameter(allowNull=false)
                                      String packageName,
                                      @GloopParameter(allowNull=false)
                                      String namespace,
                                      String username)
                               throws GloopException
        Add username authentication to the API service within a specific package by providing the packageName.
        Parameters:
        packageName - - specify the package name
        namespace - - the namespace of the api service
        username - - the username to be added
        Throws:
        GloopException - - if the api service is not found
      • addApiUsers

        public static void addApiUsers​(@GloopParameter(allowNull=false)
                                       String namespace,
                                       Set<String> usernames)
                                throws GloopException
        Add usernames authentication to the API service within a specific package.
        Parameters:
        namespace - - the namespace of the api service
        usernames - - the usernames to be added
        Throws:
        GloopException - - if the api service is not found
      • addApiUsers

        public static void addApiUsers​(@GloopParameter(allowNull=false)
                                       String packageName,
                                       @GloopParameter(allowNull=false)
                                       String namespace,
                                       Set<String> usernames)
                                throws GloopException
        Add usernames authentication to the API service within a specific package by providing the packageName
        Parameters:
        packageName - - specify the package name
        namespace - - the namespace of the api service
        usernames - - the usernames to be added
        Throws:
        GloopException - - if the api service is not found
      • addApiGroup

        public static void addApiGroup​(@GloopParameter(allowNull=false)
                                       String namespace,
                                       String groupName)
                                throws GloopException
        Add groupName authentication to the API service within current package
        Parameters:
        namespace - - the namespace of the api service
        groupName - - the groupName to be added
        Throws:
        GloopException - - if the api service is not found
      • addApiGroups

        public static void addApiGroups​(@GloopParameter(allowNull=false)
                                        String namespace,
                                        Set<String> groupNames)
                                 throws GloopException
        Add groupNames authentication to the API service within the current package
        Parameters:
        namespace - - the namespace of the api service
        groupNames - - the groupname to be added
        Throws:
        GloopException - - if the api service is not found
      • addApiGroups

        public static void addApiGroups​(String packageName,
                                        @GloopParameter(allowNull=false)
                                        String namespace,
                                        Set<String> groupNames)
                                 throws GloopException
        Add groupNames authentication to the API service within a specific package by providing the packageName
        Parameters:
        namespace - - the namespace of the api service
        groupNames - - the groupname to be added
        Throws:
        GloopException - - if the api service is not found
      • removeApiUser

        public static void removeApiUser​(@GloopParameter(allowNull=false)
                                         String namespace,
                                         String username)
                                  throws GloopException
        Remove username authentication to the API service within the current package
        Parameters:
        namespace - - the namespace of the api service
        username - - the username to be removed
        Throws:
        GloopException - - if the api service is not found
      • removeApiUser

        public static void removeApiUser​(@GloopParameter(allowNull=false)
                                         String packageName,
                                         @GloopParameter(allowNull=false)
                                         String namespace,
                                         String username)
                                  throws GloopException
        Remove username authentication to the API service within a specific package by providing the packageName.
        Parameters:
        packageName - - specify the package name
        namespace - - the namespace of the api service
        username - - the username to be removed
        Throws:
        GloopException - - if the api service is not found
      • removeApiUsers

        public static void removeApiUsers​(@GloopParameter(allowNull=false)
                                          String namespace,
                                          List<String> usernames)
                                   throws GloopException
        Remove usernames authentication to the API service within the current
        Parameters:
        namespace - - the namespace of the api service
        usernames - - the username to be removed
        Throws:
        GloopException - - if the api service is not found
      • removeApiUsers

        public static void removeApiUsers​(@GloopParameter(allowNull=false)
                                          String packageName,
                                          @GloopParameter(allowNull=false)
                                          String namespace,
                                          List<String> usernames)
                                   throws GloopException
        Remove usernames authentication to the API service within a specific package by providing the packageName.
        Parameters:
        packageName - - specify the package name
        namespace - - the namespace of the api service
        usernames - - the usernames to be removed
        Throws:
        GloopException - - if the api service is not found
      • removeApiGroup

        public static void removeApiGroup​(@GloopParameter(allowNull=false)
                                          String namespace,
                                          String groupName)
                                   throws GloopException
        Remove groupName authentication to the API service within current package
        Parameters:
        namespace - - the namespace of the api service
        groupName - - the groupName to be removed
        Throws:
        GloopException - - if the api service is not found
      • removeApiGroups

        public static void removeApiGroups​(@GloopParameter(allowNull=false)
                                           String namespace,
                                           List<String> groupNames)
                                    throws GloopException
        Remove groupNames authentication to the API service within the current package
        Parameters:
        namespace - - the namespace of the api service
        groupNames - - the groupNames to be removed
        Throws:
        GloopException - - if the api service is not found
      • removeApiAuthType

        public static void removeApiAuthType​(@GloopParameter(allowNull=false)
                                             String namespace,
                                             @GloopParameter(choices={"BASIC","OAUTH2"},allowNull=false)
                                             String authType)
                                      throws GloopException
        Remove authentication type to the API service within the current package Authentication types:

        NONE

        BASIC

        OAUTH2

        Note: It will remove all the authentication type if the authType is NONE

        Parameters:
        namespace - - the namespace of the api service
        authType - - the authentication types to be added
        Throws:
        GloopException - - if the api service is not found
      • removeApiAuthType

        public static void removeApiAuthType​(@GloopParameter(allowNull=false)
                                             String packageName,
                                             @GloopParameter(allowNull=false)
                                             String namespace,
                                             @GloopParameter(choices={"BASIC","OAUTH2"},allowNull=false)
                                             String authType)
                                      throws GloopException
        Remove authentication type to the API service within a specific package by providing the packageName Authentication types:

        NONE

        BASIC

        OAUTH2

        Note: It will remove all the authentication type if the authType is NONE

        Parameters:
        packageName - - specify the package name
        namespace - - the namespace of the api service
        authType - - the authentication types to be added
        Throws:
        GloopException - - if the api service is not found
      • removeApiAuthTypes

        public static void removeApiAuthTypes​(@GloopParameter(allowNull=false)
                                              String namespace,
                                              @GloopParameter(choices={"BASIC","OAUTH2"},allowNull=false)
                                              List<String> authTypes)
                                       throws GloopException
        Remove authentication types to the API service within the current package Authentication types:

        NONE

        BASIC

        OAUTH2

        Note: It will remove all the authentication type if the authType is NONE

        Parameters:
        namespace - - the namespace of the api service
        authTypes - - the authentication types to be added
        Throws:
        GloopException - - if the api service is not found
      • removeApiAuthTypes

        public static void removeApiAuthTypes​(@GloopParameter(allowNull=false)
                                              String packageName,
                                              @GloopParameter(allowNull=false)
                                              String namespace,
                                              @GloopParameter(choices={"BASIC","OAUTH2"},allowNull=false)
                                              List<String> authTypes)
                                       throws GloopException
        Remove authentication types to the API service within a specific package by providing the packageName Authentication types:

        NONE

        BASIC

        OAUTH2

        Note: It will remove all the authentication type if the authType is NONE

        Parameters:
        packageName - - specify the package name
        namespace - - the namespace of the api service
        authTypes - - the authentication types to be added
        Throws:
        GloopException - - if the api service is not found