Class ClientSummary
- java.lang.Object
-
- com.perforce.p4java.impl.generic.core.ServerResource
-
- com.perforce.p4java.impl.mapbased.client.ClientSummary
-
- All Implemented Interfaces:
IClientSummary
,IServerResource
- Direct Known Subclasses:
Client
public class ClientSummary extends ServerResource implements IClientSummary
Default implementation class for the IClientSummary interface.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.perforce.p4java.client.IClientSummary
IClientSummary.ClientLineEnd, IClientSummary.IClientOptions, IClientSummary.IClientSubmitOptions
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Date
accessed
protected java.util.List<java.lang.String>
alternateRoots
protected java.lang.String
backup
protected java.lang.String
description
protected java.lang.String
hostName
protected IClientSummary.ClientLineEnd
lineEnd
protected java.lang.String
name
protected IClientSummary.IClientOptions
options
protected java.lang.String
ownerName
protected java.lang.String
root
protected java.lang.String
serverId
protected java.lang.String
stream
protected int
streamAtChange
protected IClientSummary.IClientSubmitOptions
submitOptions
protected java.lang.String
type
protected boolean
unloaded
protected java.util.Date
updated
-
Fields inherited from class com.perforce.p4java.impl.generic.core.ServerResource
refreshable, server, updateable
-
-
Constructor Summary
Constructors Constructor Description ClientSummary()
Default constructor.ClientSummary(boolean summaryOnly)
Construct a new ClientSummary object whose ServerResource fields depend on the passed-in summaryOnly parameter.ClientSummary(IClientSummary clientSummary)
Clone a client summary by copying all fields.ClientSummary(java.lang.String name, java.util.Date accessed, java.util.Date updated, java.lang.String description, java.lang.String hostName, java.lang.String ownerName, java.lang.String root, IClientSummary.ClientLineEnd lineEnd, IClientSummary.IClientOptions options, IClientSummary.IClientSubmitOptions submitOptions, java.util.List<java.lang.String> alternateRoots)
Explicit-value constructor.ClientSummary(java.lang.String name, java.util.Date accessed, java.util.Date updated, java.lang.String description, java.lang.String hostName, java.lang.String ownerName, java.lang.String root, IClientSummary.ClientLineEnd lineEnd, IClientSummary.IClientOptions options, IClientSummary.IClientSubmitOptions submitOptions, java.util.List<java.lang.String> alternateRoots, java.lang.String stream, java.lang.String type)
Explicit-value constructor.ClientSummary(java.util.Map<java.lang.String,java.lang.Object> map, boolean summaryOnly)
Server map constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Date
getAccessed()
Gets the date this client was last used in any way.java.util.List<java.lang.String>
getAlternateRoots()
Get the alternate roots associated with this Perforce client, if any.java.lang.String
getBackup()
Get the client's participation in backup enable/disable.java.lang.String
getDescription()
Returns a short description of the Perforce server client.java.lang.String
getHostName()
Returns the name of the associated host, if any.IClientSummary.ClientLineEnd
getLineEnd()
Get the line end options for this client.java.lang.String
getName()
Get the name of this client.IClientSummary.IClientOptions
getOptions()
Get the Perforce client options associated with this client.java.lang.String
getOwnerName()
Get the name of the owner of this Perforce client.java.lang.String
getRoot()
Returns the root of this Perforce client.java.lang.String
getServerId()
Get the server id associated with this client.java.lang.String
getStream()
Get the stream's path in a stream depot, of the form //depotname/streamname, to which this client's view will be dedicated.int
getStreamAtChange()
Get the changelist id associated with this dynamically generated back-in-time stream client.IClientSummary.IClientSubmitOptions
getSubmitOptions()
Get the Perforce client changelist submit options associated with this client.java.lang.String
getType()
Get the client workspace type 'graph' for Graph supportjava.util.Date
getUpdated()
Get the date the client's specification was last modified.boolean
isStream()
Convenience method to check if this is a stream clientboolean
isUnloaded()
Return the "unloaded" status for this client.void
setAccessed(java.util.Date accessed)
Set the client's accessed date / time.void
setAlternateRoots(java.util.List<java.lang.String> alternateRoots)
Set the alternate roots associated with this Perforce client.void
setBackup(java.lang.String backup)
Set the client's participation in backup enable/disablevoid
setDescription(java.lang.String description)
Set the description associated with this client.void
setHostName(java.lang.String hostName)
Set the name of the associated host.void
setLineEnd(IClientSummary.ClientLineEnd lineEnd)
Set the line end options for this client.void
setName(java.lang.String name)
Set the name of this client.void
setOptions(IClientSummary.IClientOptions options)
Set the client options associated with this client.void
setOwnerName(java.lang.String ownerName)
Set the name of the owner of this client.void
setRoot(java.lang.String root)
Set the root of this client.void
setServerId(java.lang.String serverId)
Set the server id of this client.void
setStream(java.lang.String stream)
Set the stream's path in a stream depot, of the form //depotname/streamname, to which this client's view will be dedicated.void
setStreamAtChange(int streamAtChange)
Set the changelist id associated with this dynamically generated back-in-time stream client.void
setSubmitOptions(IClientSummary.IClientSubmitOptions submitOptions)
Set the client submit options for this client.void
setType(java.lang.String type)
Set the client workspace type 'graph' for Graph supportvoid
setUpdated(java.util.Date updated)
Set the client's updated date / time.-
Methods inherited from class com.perforce.p4java.impl.generic.core.ServerResource
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, parseDate, refresh, setRawField, setRawFields, setRefreshable, setServer, toDateString, update, update, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.perforce.p4java.core.IServerResource
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, refresh, setRawField, setRawFields, setServer, update, update, update
-
-
-
-
Field Detail
-
name
protected java.lang.String name
-
accessed
protected java.util.Date accessed
-
updated
protected java.util.Date updated
-
description
protected java.lang.String description
-
hostName
protected java.lang.String hostName
-
ownerName
protected java.lang.String ownerName
-
root
protected java.lang.String root
-
lineEnd
protected IClientSummary.ClientLineEnd lineEnd
-
options
protected IClientSummary.IClientOptions options
-
submitOptions
protected IClientSummary.IClientSubmitOptions submitOptions
-
alternateRoots
protected java.util.List<java.lang.String> alternateRoots
-
stream
protected java.lang.String stream
-
serverId
protected java.lang.String serverId
-
streamAtChange
protected int streamAtChange
-
unloaded
protected boolean unloaded
-
type
protected java.lang.String type
-
backup
protected java.lang.String backup
-
-
Constructor Detail
-
ClientSummary
public ClientSummary()
Default constructor. Sets all fields to null except lineEnd, which is set to ClientLineEnd.LOCAL. Sets ServerResource superclass fields to indicate complete and not refereshable or updateable. Intended mostly for use with "pure" ClientSummary objects.
-
ClientSummary
public ClientSummary(boolean summaryOnly)
Construct a new ClientSummary object whose ServerResource fields depend on the passed-in summaryOnly parameter. If summaryOnly is false, this object is complete, updateable, and refreshable; otherwise, it's complete and neither updateable nor refresheable. Intended mostly for use with extended ClientSummary objects such as the full Client class.- Parameters:
summaryOnly
- summaryOnly
-
ClientSummary
public ClientSummary(IClientSummary clientSummary)
Clone a client summary by copying all fields. If clientSummary is null, this is equivalent to calling the default constructor.- Parameters:
clientSummary
- clientSummary
-
ClientSummary
public ClientSummary(java.util.Map<java.lang.String,java.lang.Object> map, boolean summaryOnly)
Server map constructor. Attempts to construct a new ClientSummary object from the passed-in map, which is assumed to have come from a Perforce server in response to a client list command. If map is null, this is equivalent to calling the default constructor.Note that fields set here may be overridden in a full Client constructor, as the field keys and formats can be subtly (and not so subtly) different in maps returned from (say) getClientList() and getClient(). If summaryOnly is false, this map is assumed to be from a full client retrieval, meaning some of the fields retrieved in the full Client constructor are not set here. Otherwise, it attempts to retrieve all known ClientSummary fields.
- Parameters:
map
- mapsummaryOnly
- summaryOnly
-
ClientSummary
public ClientSummary(java.lang.String name, java.util.Date accessed, java.util.Date updated, java.lang.String description, java.lang.String hostName, java.lang.String ownerName, java.lang.String root, IClientSummary.ClientLineEnd lineEnd, IClientSummary.IClientOptions options, IClientSummary.IClientSubmitOptions submitOptions, java.util.List<java.lang.String> alternateRoots)
Explicit-value constructor. Intended mostly for use with "pure" ClientSummary objects. Sets ServerResource superclass fields to indicate complete and neither refreshable nor updateable.- Parameters:
name
- nameaccessed
- accessedupdated
- updateddescription
- descriptionhostName
- hostNameownerName
- ownerNameroot
- rootlineEnd
- lineEndoptions
- optionssubmitOptions
- submitOptionsalternateRoots
- alternateRoots
-
ClientSummary
public ClientSummary(java.lang.String name, java.util.Date accessed, java.util.Date updated, java.lang.String description, java.lang.String hostName, java.lang.String ownerName, java.lang.String root, IClientSummary.ClientLineEnd lineEnd, IClientSummary.IClientOptions options, IClientSummary.IClientSubmitOptions submitOptions, java.util.List<java.lang.String> alternateRoots, java.lang.String stream, java.lang.String type)
Explicit-value constructor. Intended mostly for use with "pure" ClientSummary objects. Sets ServerResource superclass fields to indicate complete and neither refreshable nor updateable.- Parameters:
name
- nameaccessed
- accessedupdated
- updateddescription
- descriptionhostName
- hostNameownerName
- ownerNameroot
- rootlineEnd
- lineEndoptions
- optionssubmitOptions
- submitOptionsalternateRoots
- alternateRootsstream
- streamtype
- type
-
-
Method Detail
-
getAccessed
public java.util.Date getAccessed()
Description copied from interface:IClientSummary
Gets the date this client was last used in any way. Note that this is a server-side date and does not reflect client-side usage.- Specified by:
getAccessed
in interfaceIClientSummary
- Returns:
- the date this client was last used in any way, or null if not known.
-
setAccessed
public void setAccessed(java.util.Date accessed)
Description copied from interface:IClientSummary
Set the client's accessed date / time.- Specified by:
setAccessed
in interfaceIClientSummary
- Parameters:
accessed
- new accessed date.
-
getAlternateRoots
public java.util.List<java.lang.String> getAlternateRoots()
Description copied from interface:IClientSummary
Get the alternate roots associated with this Perforce client, if any.- Specified by:
getAlternateRoots
in interfaceIClientSummary
- Returns:
- list of alternate roots if they exist; null otherwise.
-
setAlternateRoots
public void setAlternateRoots(java.util.List<java.lang.String> alternateRoots)
Description copied from interface:IClientSummary
Set the alternate roots associated with this Perforce client.- Specified by:
setAlternateRoots
in interfaceIClientSummary
- Parameters:
alternateRoots
- new alternate roots list. Note that order within the list is significant.
-
getDescription
public java.lang.String getDescription()
Description copied from interface:IClientSummary
Returns a short description of the Perforce server client.- Specified by:
getDescription
in interfaceIClientSummary
- Returns:
- the short description of the client, or null if no such description is available.
-
setDescription
public void setDescription(java.lang.String description)
Description copied from interface:IClientSummary
Set the description associated with this client.- Specified by:
setDescription
in interfaceIClientSummary
- Parameters:
description
- new description string.
-
getHostName
public java.lang.String getHostName()
Description copied from interface:IClientSummary
Returns the name of the associated host, if any.- Specified by:
getHostName
in interfaceIClientSummary
- Returns:
- the name of the associated host, if any; null otherwise.
-
setHostName
public void setHostName(java.lang.String hostName)
Description copied from interface:IClientSummary
Set the name of the associated host.- Specified by:
setHostName
in interfaceIClientSummary
- Parameters:
hostName
- new host name.
-
getLineEnd
public IClientSummary.ClientLineEnd getLineEnd()
Description copied from interface:IClientSummary
Get the line end options for this client.- Specified by:
getLineEnd
in interfaceIClientSummary
- Returns:
- ClientLineEnd representing the line end options for this client.
-
setLineEnd
public void setLineEnd(IClientSummary.ClientLineEnd lineEnd)
Description copied from interface:IClientSummary
Set the line end options for this client.- Specified by:
setLineEnd
in interfaceIClientSummary
- Parameters:
lineEnd
- ClientLineEnd representing the line end options for this client.
-
getName
public java.lang.String getName()
Description copied from interface:IClientSummary
Get the name of this client.- Specified by:
getName
in interfaceIClientSummary
- Returns:
- the name of this client, if set or known; null otherwise.
-
setName
public void setName(java.lang.String name)
Description copied from interface:IClientSummary
Set the name of this client.- Specified by:
setName
in interfaceIClientSummary
- Parameters:
name
- new client name.
-
getOptions
public IClientSummary.IClientOptions getOptions()
Description copied from interface:IClientSummary
Get the Perforce client options associated with this client.- Specified by:
getOptions
in interfaceIClientSummary
- Returns:
- non-null options
-
setOptions
public void setOptions(IClientSummary.IClientOptions options)
Description copied from interface:IClientSummary
Set the client options associated with this client.- Specified by:
setOptions
in interfaceIClientSummary
- Parameters:
options
- new options.
-
getOwnerName
public java.lang.String getOwnerName()
Description copied from interface:IClientSummary
Get the name of the owner of this Perforce client.- Specified by:
getOwnerName
in interfaceIClientSummary
- Returns:
- the name of the owner of this Perforce client, if known; null otherwise.
-
setOwnerName
public void setOwnerName(java.lang.String ownerName)
Description copied from interface:IClientSummary
Set the name of the owner of this client.- Specified by:
setOwnerName
in interfaceIClientSummary
- Parameters:
ownerName
- the name of the owner of this Perforce client.
-
getRoot
public java.lang.String getRoot()
Description copied from interface:IClientSummary
Returns the root of this Perforce client.- Specified by:
getRoot
in interfaceIClientSummary
- Returns:
- the root of this client, or null if no such root is available.
-
setRoot
public void setRoot(java.lang.String root)
Description copied from interface:IClientSummary
Set the root of this client.- Specified by:
setRoot
in interfaceIClientSummary
- Parameters:
root
- new client root.
-
getServerId
public java.lang.String getServerId()
Description copied from interface:IClientSummary
Get the server id associated with this client.- Specified by:
getServerId
in interfaceIClientSummary
- Returns:
- the server id associated with this client, or null if this client has no associated server id.
-
setServerId
public void setServerId(java.lang.String serverId)
Description copied from interface:IClientSummary
Set the server id of this client.- Specified by:
setServerId
in interfaceIClientSummary
- Parameters:
serverId
- new server id for this client.
-
getStream
public java.lang.String getStream()
Description copied from interface:IClientSummary
Get the stream's path in a stream depot, of the form //depotname/streamname, to which this client's view will be dedicated.- Specified by:
getStream
in interfaceIClientSummary
- Returns:
- the stream's path in a stream depot of this client, or null if this is not a stream client.
-
setStream
public void setStream(java.lang.String stream)
Description copied from interface:IClientSummary
Set the stream's path in a stream depot, of the form //depotname/streamname, to which this client's view will be dedicated.- Specified by:
setStream
in interfaceIClientSummary
- Parameters:
stream
- new stream's path in a stream depot of this client.
-
getStreamAtChange
public int getStreamAtChange()
Description copied from interface:IClientSummary
Get the changelist id associated with this dynamically generated back-in-time stream client.- Specified by:
getStreamAtChange
in interfaceIClientSummary
- Returns:
- the changelist id associated with this dynamically generated back-in-time stream client, or IChangelist.UNKNOWN if this is not a dynamically generated back-in-time stream client.
-
setStreamAtChange
public void setStreamAtChange(int streamAtChange)
Description copied from interface:IClientSummary
Set the changelist id associated with this dynamically generated back-in-time stream client.- Specified by:
setStreamAtChange
in interfaceIClientSummary
- Parameters:
streamAtChange
- new changelist id associated with this dynamically generated back-in-time stream client.
-
getSubmitOptions
public IClientSummary.IClientSubmitOptions getSubmitOptions()
Description copied from interface:IClientSummary
Get the Perforce client changelist submit options associated with this client.- Specified by:
getSubmitOptions
in interfaceIClientSummary
- Returns:
- non-null changelist submit options
-
setSubmitOptions
public void setSubmitOptions(IClientSummary.IClientSubmitOptions submitOptions)
Description copied from interface:IClientSummary
Set the client submit options for this client.- Specified by:
setSubmitOptions
in interfaceIClientSummary
- Parameters:
submitOptions
- new client submit options.
-
getUpdated
public java.util.Date getUpdated()
Description copied from interface:IClientSummary
Get the date the client's specification was last modified.- Specified by:
getUpdated
in interfaceIClientSummary
- Returns:
- the date the client's specification was last modified, or null if not known.
-
setUpdated
public void setUpdated(java.util.Date updated)
Description copied from interface:IClientSummary
Set the client's updated date / time.- Specified by:
setUpdated
in interfaceIClientSummary
- Parameters:
updated
- new updated date.
-
isUnloaded
public boolean isUnloaded()
Description copied from interface:IClientSummary
Return the "unloaded" status for this client.- Specified by:
isUnloaded
in interfaceIClientSummary
- Returns:
- true iff the client is unloaded.
-
isStream
public boolean isStream()
Description copied from interface:IClientSummary
Convenience method to check if this is a stream client- Specified by:
isStream
in interfaceIClientSummary
- Returns:
- true, if stream
-
getType
public java.lang.String getType()
Description copied from interface:IClientSummary
Get the client workspace type 'graph' for Graph support- Specified by:
getType
in interfaceIClientSummary
- Returns:
- String representation of the type
-
setType
public void setType(java.lang.String type)
Description copied from interface:IClientSummary
Set the client workspace type 'graph' for Graph support- Specified by:
setType
in interfaceIClientSummary
- Parameters:
type
- the type as a String
-
getBackup
public java.lang.String getBackup()
Description copied from interface:IClientSummary
Get the client's participation in backup enable/disable. If not specified backup of a writable client defaults to enabled.- Specified by:
getBackup
in interfaceIClientSummary
- Returns:
- String representation of the type
-
setBackup
public void setBackup(java.lang.String backup)
Description copied from interface:IClientSummary
Set the client's participation in backup enable/disable- Specified by:
setBackup
in interfaceIClientSummary
- Parameters:
backup
- enable/disable as a String
-
-