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.String
createClient(IClient newClient)
void
createTempClient(IClient newClient)
java.lang.String
deleteClient(java.lang.String clientName, boolean force)
java.lang.String
deleteClient(java.lang.String clientName, DeleteClientOptions opts)
Delete a Perforce client from a Perforce server.IClient
getClient(IClientSummary clientSummary)
IClient
getClient(java.lang.String clientName)
IClient
getClientTemplate(java.lang.String clientName)
IClient
getClientTemplate(java.lang.String clientName, boolean allowExistent)
IClient
getClientTemplate(java.lang.String clientName, GetClientTemplateOptions getClientTemplateOptions)
Get a template of a non-existent named Perforce client.java.lang.String
switchClientView(java.lang.String templateClientName, java.lang.String targetClientName, SwitchClientViewOptions opts)
Switch the target client spec's view without invoking the editor.java.lang.String
switchStreamView(java.lang.String streamPath, java.lang.String targetClientName, SwitchClientViewOptions opts)
Switch the target client spec's view without invoking the editor.java.lang.String
updateClient(IClient client)
java.lang.String
updateClient(IClient client, boolean force)
Update an existing Perforce client on the current Perforce server.java.lang.String
updateClient(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:
getClient
in interfaceIClientDelegator
- Throws:
ConnectionException
RequestException
AccessException
-
getClient
public IClient getClient(@Nonnull IClientSummary clientSummary) throws ConnectionException, RequestException, AccessException
- Specified by:
getClient
in interfaceIClientDelegator
- Throws:
ConnectionException
RequestException
AccessException
-
getClientTemplate
public IClient getClientTemplate(java.lang.String clientName) throws ConnectionException, RequestException, AccessException
- Specified by:
getClientTemplate
in interfaceIClientDelegator
- Throws:
ConnectionException
RequestException
AccessException
-
getClientTemplate
public IClient getClientTemplate(java.lang.String clientName, boolean allowExistent) throws ConnectionException, RequestException, AccessException
- Specified by:
getClientTemplate
in interfaceIClientDelegator
- Throws:
ConnectionException
RequestException
AccessException
-
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:
getClientTemplate
in 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:
createClient
in interfaceIClientDelegator
- Throws:
ConnectionException
RequestException
AccessException
-
createTempClient
public void createTempClient(@Nonnull IClient newClient) throws ConnectionException, AccessException, RequestException
- Specified by:
createTempClient
in interfaceIClientDelegator
- Throws:
ConnectionException
AccessException
RequestException
-
updateClient
public java.lang.String updateClient(@Nonnull IClient client) throws ConnectionException, RequestException, AccessException
- Specified by:
updateClient
in interfaceIClientDelegator
- Throws:
ConnectionException
RequestException
AccessException
-
updateClient
public java.lang.String updateClient(@Nonnull IClient client, boolean force) throws ConnectionException, RequestException, AccessException
Update 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:
updateClient
in 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 P4JavaException
Update 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:
updateClient
in 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:
deleteClient
in interfaceIClientDelegator
- Throws:
ConnectionException
RequestException
AccessException
-
deleteClient
public java.lang.String deleteClient(java.lang.String clientName, DeleteClientOptions opts) throws P4JavaException
Delete 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:
deleteClient
in 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 P4JavaException
Switch 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:
switchClientView
in 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 P4JavaException
Switch 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:
switchStreamView
in 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.
-
-