Class ClientDelegator
- java.lang.Object
-
- com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
-
- com.perforce.p4java.impl.mapbased.server.cmd.ClientDelegator
-
- All Implemented Interfaces:
IClientDelegator
public class ClientDelegator extends BaseDelegator implements IClientDelegator
- Since:
- 15/09/2016
-
-
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
Constructors Constructor Description ClientDelegator(IOptionsServer server)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringcreateClient(IClient newClient)voidcreateTempClient(IClient newClient)java.lang.StringdeleteClient(java.lang.String clientName, boolean force)java.lang.StringdeleteClient(java.lang.String clientName, DeleteClientOptions opts)Delete a Perforce client from a Perforce server.IClientgetClient(IClientSummary clientSummary)IClientgetClient(java.lang.String clientName)IClientgetClientTemplate(java.lang.String clientName)IClientgetClientTemplate(java.lang.String clientName, boolean allowExistent)IClientgetClientTemplate(java.lang.String clientName, GetClientTemplateOptions getClientTemplateOptions)Get a template of a non-existent named Perforce client.java.lang.StringswitchClientView(java.lang.String templateClientName, java.lang.String targetClientName, SwitchClientViewOptions opts)Switch the target client spec's view without invoking the editor.java.lang.StringswitchStreamView(java.lang.String streamPath, java.lang.String targetClientName, SwitchClientViewOptions opts)Switch the target client spec's view without invoking the editor.java.lang.StringupdateClient(IClient client)java.lang.StringupdateClient(IClient client, boolean force)Update an existing Perforce client on the current Perforce server.java.lang.StringupdateClient(IClient client, UpdateClientOptions opts)Update an existing Perforce client on the current Perforce server.
-
-
-
Constructor Detail
-
ClientDelegator
public ClientDelegator(IOptionsServer server)
-
-
Method Detail
-
getClient
public IClient getClient(java.lang.String clientName) throws ConnectionException, RequestException, AccessException
- Specified by:
getClientin interfaceIClientDelegator- Throws:
ConnectionExceptionRequestExceptionAccessException
-
getClient
public IClient getClient(@Nonnull IClientSummary clientSummary) throws ConnectionException, RequestException, AccessException
- Specified by:
getClientin interfaceIClientDelegator- Throws:
ConnectionExceptionRequestExceptionAccessException
-
getClientTemplate
public IClient getClientTemplate(java.lang.String clientName) throws ConnectionException, RequestException, AccessException
- Specified by:
getClientTemplatein interfaceIClientDelegator- Throws:
ConnectionExceptionRequestExceptionAccessException
-
getClientTemplate
public IClient getClientTemplate(java.lang.String clientName, boolean allowExistent) throws ConnectionException, RequestException, AccessException
- Specified by:
getClientTemplatein interfaceIClientDelegator- Throws:
ConnectionExceptionRequestExceptionAccessException
-
getClientTemplate
public IClient getClientTemplate(@Nonnull java.lang.String clientName, GetClientTemplateOptions getClientTemplateOptions) throws P4JavaException
Get a template of a non-existent named Perforce client. This will only return an IClient for clients that don't exist unless the allowExistent parameter is set to true. This method is designed to be able to get the server returned default values it uses when a non-existent client is requested.- Specified by:
getClientTemplatein interfaceIClientDelegator- Parameters:
clientName- Not blank Perforce client name.getClientTemplateOptions- GetClientTemplateOptions object describing optional parameters; if null, no options are set.- Returns:
- IClient representing the specified Perforce client template, or null if no such client template.
- Throws:
P4JavaException- if any error occurs in the processing of this method.
-
createClient
public java.lang.String createClient(@Nonnull IClient newClient) throws ConnectionException, RequestException, AccessException- Specified by:
createClientin interfaceIClientDelegator- Throws:
ConnectionExceptionRequestExceptionAccessException
-
createTempClient
public void createTempClient(@Nonnull IClient newClient) throws ConnectionException, AccessException, RequestException- Specified by:
createTempClientin interfaceIClientDelegator- Throws:
ConnectionExceptionAccessExceptionRequestException
-
updateClient
public java.lang.String updateClient(@Nonnull IClient client) throws ConnectionException, RequestException, AccessException- Specified by:
updateClientin interfaceIClientDelegator- Throws:
ConnectionExceptionRequestExceptionAccessException
-
updateClient
public java.lang.String updateClient(@Nonnull IClient client, boolean force) throws ConnectionException, RequestException, AccessExceptionUpdate an existing Perforce client on the current Perforce server. This client does not need to be the current client, and no association with the passed-in client is made by the server (i.e. it's not made the current client).- Specified by:
updateClientin interfaceIClientDelegator- Parameters:
client- non-null IClient defining the Perforce client to be updatedforce- if true, tell the server to attempt to force the update regardless of the consequences. You're on your own with this one...- Returns:
- possibly-null operation result message string from the Perforce server
- Throws:
ConnectionException- on errorRequestException- if any error occurs in the processing of this method.AccessException- on error
-
updateClient
public java.lang.String updateClient(@Nonnull IClient client, UpdateClientOptions opts) throws P4JavaExceptionUpdate an existing Perforce client on the current Perforce server. This client does not need to be the current client, and no association with the passed-in client is made by the server (i.e. it's not made the current client).- Specified by:
updateClientin interfaceIClientDelegator- Parameters:
client- non-null IClient defining the Perforce client to be updatedopts- UpdateClientOptions object describing optional parameters; if null, no options are set.- Returns:
- possibly-null operation result message string from the Perforce server
- Throws:
P4JavaException- if any error occurs in the processing of this method.
-
deleteClient
public java.lang.String deleteClient(java.lang.String clientName, boolean force) throws ConnectionException, RequestException, AccessException- Specified by:
deleteClientin interfaceIClientDelegator- Throws:
ConnectionExceptionRequestExceptionAccessException
-
deleteClient
public java.lang.String deleteClient(java.lang.String clientName, DeleteClientOptions opts) throws P4JavaExceptionDelete a Perforce client from a Perforce server. The effects this has on the client and the server are not well-defined here, and you should probably consult the relevant Perforce documentation for your specific case. In any event, you can cause quite a lot of inconvenience (and maybe even damage) doing a forced delete without preparing properly for it, especially if the client is the server object's current client.- Specified by:
deleteClientin interfaceIClientDelegator- Parameters:
clientName- non-null name of the client to be deleted from the server.opts- DeleteClientOptions object describing optional parameters; if null, no options are set.- Returns:
- possibly-null operation result message string from the Perforce server.
- Throws:
P4JavaException- if any error occurs in the processing of this method.
-
switchClientView
public java.lang.String switchClientView(java.lang.String templateClientName, java.lang.String targetClientName, SwitchClientViewOptions opts) throws P4JavaExceptionSwitch the target client spec's view without invoking the editor. With -t to switch to a view defined in another client spec. Switching views is not allowed in a client that has opened files. The -f flag can be used with -s to force switching with opened files. View switching has no effect on files in a client workspace until 'p4 sync' is run.- Specified by:
switchClientViewin interfaceIClientDelegator- Parameters:
templateClientName- non-null name of the template client who's view will be used for the target (or current) client to switched to.targetClientName- possibly-null name of the target client whose view will be changed to the template client's view. If null, the current client will be used.opts- SwitchClientViewOptions object describing optional parameters; if null, no options are set.- Returns:
- possibly-null operation result message string from the Perforce server
- Throws:
P4JavaException- if any error occurs in the processing of this method.
-
switchStreamView
public java.lang.String switchStreamView(java.lang.String streamPath, java.lang.String targetClientName, SwitchClientViewOptions opts) throws P4JavaExceptionSwitch the target client spec's view without invoking the editor. With -S to switch to the specified stream's view. Switching views is not allowed in a client that has opened files. The -f flag can be used with -s to force switching with opened files. View switching has no effect on files in a client workspace until 'p4 sync' is run.- Specified by:
switchStreamViewin interfaceIClientDelegator- Parameters:
streamPath- non-null stream's path in a stream depot, of the form //depotname/streamname who's view will be used for the target (or current) client to switched to.targetClientName- possibly-null name of the target client whose view will be changed to the stream's view. If null, the current client will be used.opts- SwitchClientViewOptions object describing optional parameters; if null, no options are set.- Returns:
- possibly-null operation result message string from the Perforce server
- Throws:
P4JavaException- if any error occurs in the processing of this method.
-
-