Class ExtensionDelegator

    • Constructor Detail

      • ExtensionDelegator

        public ExtensionDelegator​(IOptionsServer server)
        Basic constructor, taking a server object.
        Parameters:
        server - - an instance of the currently effective server implementation
    • Method Detail

      • sampleExtension

        public java.lang.String sampleExtension​(java.lang.String extnName)
                                         throws P4JavaException
        Description copied from interface: IExtensionDelegator
        Creates sample extension with the given name. As a result a folder extnName will be created with main.lua and manifest.json in it. command: extension [ --sample name ]
        Specified by:
        sampleExtension in interface IExtensionDelegator
        Parameters:
        extnName - - name of the extension
        Returns:
        result
        Throws:
        P4JavaException - on error
      • packageExtension

        public java.lang.String packageExtension​(java.lang.String dirName)
                                          throws P4JavaException
        Description copied from interface: IExtensionDelegator
        Packages the extension. As a result creates a file with .p4-extension in the current folder. command: extension [ --package dir ]
        Specified by:
        packageExtension in interface IExtensionDelegator
        Parameters:
        dirName - - Directory name containing main.lua and manifest.json for the extension
        Returns:
        result
        Throws:
        P4JavaException - on error
      • installExtension

        public ExtensionSummary installExtension​(java.lang.String extnPackageName,
                                                 boolean allowUnsigned)
                                          throws P4JavaException
        Description copied from interface: IExtensionDelegator
        Installs extension on p4 server. command: extension [ --install file [--yes] [--cert] [--allow-unsigned] ]
        Specified by:
        installExtension in interface IExtensionDelegator
        Parameters:
        extnPackageName - - Name of the extension package file. For ex. p4java-obliterate-extn.p4-extension
        allowUnsigned - if true
        Returns:
        extension summary
        Throws:
        P4JavaException - on error
      • createExtensionConfig

        public java.lang.String createExtensionConfig​(IExtension extension,
                                                      java.lang.String namespace,
                                                      @Nullable
                                                      java.lang.String instanceConfig)
                                               throws P4JavaException
        Description copied from interface: IExtensionDelegator
        Creates/updates an extension's global/instance config.
        Specified by:
        createExtensionConfig in interface IExtensionDelegator
        Parameters:
        extension - extension
        namespace - name space
        instanceConfig - - If provided, creates/updates this instance config.
        Returns:
        result
        Throws:
        P4JavaException - on error
      • updateExtensionConfig

        public java.lang.String updateExtensionConfig​(IExtension extension,
                                                      java.lang.String namespace,
                                                      @Nullable
                                                      java.lang.String instanceConfig)
                                               throws P4JavaException
        Description copied from interface: IExtensionDelegator
        Updates an extension's global/instance config.
        Specified by:
        updateExtensionConfig in interface IExtensionDelegator
        Parameters:
        extension - extension
        namespace - name space
        instanceConfig - - If provided updates this instance config.
        Returns:
        result
        Throws:
        P4JavaException - on error
      • deleteExtension

        public java.lang.String deleteExtension​(java.lang.String namespace,
                                                java.lang.String extnName)
                                         throws P4JavaException
        Description copied from interface: IExtensionDelegator
        Deletes an extension along with all of its configuration.
        Specified by:
        deleteExtension in interface IExtensionDelegator
        Parameters:
        namespace - name space
        extnName - extension name
        Returns:
        result
        Throws:
        P4JavaException - on error
      • getExtensionConfig

        public Extension getExtensionConfig​(java.lang.String namespace,
                                            java.lang.String name,
                                            java.lang.String instanceName)
                                     throws P4JavaException
        Description copied from interface: IExtensionDelegator
        Retrieves an extension/config.
        Specified by:
        getExtensionConfig in interface IExtensionDelegator
        Parameters:
        namespace - name space
        name - extension name
        instanceName - Optional, only required for instance config
        Returns:
        extension config
        Throws:
        P4JavaException - on error