Class ModuleEnvironments.Async

  • Enclosing class:
    ModuleEnvironments

    public class ModuleEnvironments.Async
    extends java.lang.Object
    Async module.
    • Constructor Detail

      • Async

        public Async()
    • Method Detail

      • create

        public CMACallback<CMAEnvironment> create​(java.lang.String spaceId,
                                                  CMAEnvironment environment,
                                                  CMACallback<CMAEnvironment> callback)
        Create an environment using the given space id.

        This method will override the configuration specified through CMAClient.Builder.setSpaceId(String).

        Parameters:
        spaceId - Id of the space to host environment in
        environment - CMAEnvironment
        callback - Callback
        Returns:
        the given CMACallback instance
        Throws:
        java.lang.IllegalArgumentException - if space id is null.
        java.lang.IllegalArgumentException - if environment is null.
      • clone

        public CMACallback<CMAEnvironment> clone​(CMAEnvironment sourceEnvironment,
                                                 CMAEnvironment newEnvironment,
                                                 CMACallback<CMAEnvironment> callback)
        Create an environment using a source environment.

        This method will override the configuration specified through CMAClient.Builder.setSpaceId(String).

        Parameters:
        sourceEnvironment - base of the created environment.
        newEnvironment - to be created environment.
        callback - Callback
        Returns:
        the given CMACallback instance
        Throws:
        java.lang.IllegalArgumentException - if space id is null.
        java.lang.IllegalArgumentException - if environment is null.
      • delete

        public CMACallback<java.lang.Integer> delete​(CMAEnvironment environment,
                                                     CMACallback<java.lang.Integer> callback)
        Delete an environment.
        Parameters:
        environment - environment to be deleted
        callback - Callback
        Returns:
        the given CMACallback instance
        Throws:
        java.lang.IllegalArgumentException - if environment's space id is null.
        java.lang.IllegalArgumentException - if environment's id is null.
      • fetchAll

        public CMACallback<CMAArray<CMAEnvironment>> fetchAll​(java.lang.String spaceId,
                                                              CMACallback<CMAArray<CMAEnvironment>> callback)
        Fetch all environments of the given space.

        This fetch uses the default parameter defined in DefaultQueryParameter.FETCH.

        This method will override the configuration specified through CMAClient.Builder.setSpaceId(String).

        Parameters:
        spaceId - Id of the space to host environment in
        callback - Inform about results on the callback.
        Returns:
        the given CMACallback instance.
        Throws:
        java.lang.IllegalArgumentException - if space id is null.
      • fetchOne

        public CMACallback<CMAEnvironment> fetchOne​(java.lang.String spaceId,
                                                    java.lang.String environmentId,
                                                    CMACallback<CMAEnvironment> callback)
        Fetch an environment with a given environmentId from the space given.

        This method will override the configuration specified through CMAClient.Builder.setSpaceId(String).

        Parameters:
        spaceId - Id of the space to host environment in
        environmentId - environment ID
        callback - Callback
        Returns:
        the given CMACallback instance
        Throws:
        java.lang.IllegalArgumentException - if space id is null.
        java.lang.IllegalArgumentException - if environment id is null.
      • update

        public CMACallback<CMAEnvironment> update​(CMAEnvironment environment,
                                                  CMACallback<CMAEnvironment> callback)
        Update an environment.
        Parameters:
        environment - environment
        callback - Callback
        Returns:
        the given CMACallback instance
        Throws:
        java.lang.IllegalArgumentException - if environment is null.
        java.lang.IllegalArgumentException - if environment's space id is null.
        java.lang.IllegalArgumentException - if environment's name is null.
        java.lang.IllegalArgumentException - if environment's environment id is null.
        java.lang.IllegalArgumentException - if environment's version is null.