Class ExtensionDelegator
java.lang.Object
com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
com.perforce.p4java.impl.mapbased.server.cmd.ExtensionDelegator
- All Implemented Interfaces:
IExtensionDelegator
-
Field Summary
Fields inherited from class com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
MAX_LIMIT_SUPPORTED_MIN_VERSION, QUERY_EXPRESSIONS_SUPPORTED_MIN_VERSION, USER_RESTRICTIONS_SUPPORTED_MIN_VERSION -
Constructor Summary
ConstructorsConstructorDescriptionExtensionDelegator(IOptionsServer server) Basic constructor, taking a server object. -
Method Summary
Modifier and TypeMethodDescriptioncreateExtensionConfig(IExtension extension, String namespace, String instanceConfig) Creates/updates an extension's global/instance config.deleteExtension(String namespace, String extnName) Deletes an extension along with all of its configuration.getExtensionConfig(String namespace, String name, String instanceName) Retrieves an extension/config.installExtension(String extnPackageName, boolean allowUnsigned) Installs extension on p4 server.listExtensions(String type) Lists extensions or configs based on type.packageExtension(String dirName) Packages the extension.sampleExtension(String extnName) Creates sample extension with the given name.updateExtensionConfig(IExtension extension, String namespace, String instanceConfig) Updates an extension's global/instance config.
-
Constructor Details
-
ExtensionDelegator
Basic constructor, taking a server object.- Parameters:
server- - an instance of the currently effective server implementation
-
-
Method Details
-
sampleExtension
Description copied from interface:IExtensionDelegatorCreates 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:
sampleExtensionin interfaceIExtensionDelegator- Parameters:
extnName- - name of the extension- Returns:
- result
- Throws:
P4JavaException- on error
-
packageExtension
Description copied from interface:IExtensionDelegatorPackages the extension. As a result creates a file with .p4-extension in the current folder. command: extension [ --package dir ]- Specified by:
packageExtensionin interfaceIExtensionDelegator- Parameters:
dirName- - Directory name containing main.lua and manifest.json for the extension- Returns:
- result
- Throws:
P4JavaException- on error
-
installExtension
public ExtensionSummary installExtension(String extnPackageName, boolean allowUnsigned) throws P4JavaException Description copied from interface:IExtensionDelegatorInstalls extension on p4 server. command: extension [ --install file [--yes] [--cert] [--allow-unsigned] ]- Specified by:
installExtensionin interfaceIExtensionDelegator- Parameters:
extnPackageName- - Name of the extension package file. For ex. p4java-obliterate-extn.p4-extensionallowUnsigned- if true- Returns:
- extension summary
- Throws:
P4JavaException- on error
-
createExtensionConfig
public String createExtensionConfig(IExtension extension, String namespace, @Nullable String instanceConfig) throws P4JavaException Description copied from interface:IExtensionDelegatorCreates/updates an extension's global/instance config.- Specified by:
createExtensionConfigin interfaceIExtensionDelegator- Parameters:
extension- extensionnamespace- name spaceinstanceConfig- - If provided, creates/updates this instance config.- Returns:
- result
- Throws:
P4JavaException- on error
-
updateExtensionConfig
public String updateExtensionConfig(IExtension extension, String namespace, @Nullable String instanceConfig) throws P4JavaException Description copied from interface:IExtensionDelegatorUpdates an extension's global/instance config.- Specified by:
updateExtensionConfigin interfaceIExtensionDelegator- Parameters:
extension- extensionnamespace- name spaceinstanceConfig- - If provided updates this instance config.- Returns:
- result
- Throws:
P4JavaException- on error
-
listExtensions
Description copied from interface:IExtensionDelegatorLists extensions or configs based on type.- Specified by:
listExtensionsin interfaceIExtensionDelegator- Parameters:
type- - Can be "extensions" or "configs"- Returns:
- list of extensions
- Throws:
P4JavaException- on error
-
deleteExtension
Description copied from interface:IExtensionDelegatorDeletes an extension along with all of its configuration.- Specified by:
deleteExtensionin interfaceIExtensionDelegator- Parameters:
namespace- name spaceextnName- extension name- Returns:
- result
- Throws:
P4JavaException- on error
-
getExtensionConfig
public Extension getExtensionConfig(String namespace, String name, String instanceName) throws P4JavaException Description copied from interface:IExtensionDelegatorRetrieves an extension/config.- Specified by:
getExtensionConfigin interfaceIExtensionDelegator- Parameters:
namespace- name spacename- extension nameinstanceName- Optional, only required for instance config- Returns:
- extension config
- Throws:
P4JavaException- on error
-