public class BranchSpec extends BranchSpecSummary implements IBranchSpec
Modifier and Type | Class and Description |
---|---|
static class |
BranchSpec.BranchViewMapping
Simple default implementation of the IViewMapping interface.
|
Modifier and Type | Field and Description |
---|---|
protected ViewMap<IBranchMapping> |
branchView |
static java.lang.String |
DEFAULT_DESCRIPTION
Default description for use in newBranchSpec method when no explicit
description is given.
|
accessed, description, locked, name, ownerName, updated
refreshable, server, updateable
Constructor and Description |
---|
BranchSpec()
Default constructor.
|
BranchSpec(IBranchSpecSummary summary)
Construct a new BranchSpec from the passed-in summary branch spec.
|
BranchSpec(java.util.Map<java.lang.String,java.lang.Object> map,
IServer server)
Construct a BranchSpec from a map passed back from the Perforce
server in response to a getBranchSpec command.
|
BranchSpec(java.lang.String name,
java.lang.String ownerName,
java.lang.String description,
boolean locked,
java.util.Date accessed,
java.util.Date updated,
ViewMap<IBranchMapping> branchView)
Construct a new BranchSpec from explicit field values.
|
Modifier and Type | Method and Description |
---|---|
ViewMap<IBranchMapping> |
getBranchView()
Return the view map associated with this branch spec.
|
static BranchSpec |
newBranchSpec(IOptionsServer server,
java.lang.String name,
java.lang.String description,
java.lang.String[] branches)
Simple factory / convenience method for creating a new local BranchSpec object
with defult values.
|
void |
refresh()
This method will refresh by getting the complete branch model.
|
void |
setBranchView(ViewMap<IBranchMapping> branchView)
Set the the view map associated with this branch spec.
|
void |
update()
Update the Perforce server object associated with the underlying P4Java object,
if possible.
|
getAccessed, getDescription, getName, getOwnerName, getUpdated, isLocked, setAccessed, setDescription, setLocked, setName, setOwnerName, setUpdated
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, parseDate, setRawField, setRawFields, setRefreshable, setServer, toDateString, update, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAccessed, getDescription, getName, getOwnerName, getUpdated, isLocked, setAccessed, setDescription, setLocked, setName, setOwnerName, setUpdated
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, setRawField, setRawFields, setServer, update, update
protected ViewMap<IBranchMapping> branchView
public static final java.lang.String DEFAULT_DESCRIPTION
public BranchSpec()
public BranchSpec(java.lang.String name, java.lang.String ownerName, java.lang.String description, boolean locked, java.util.Date accessed, java.util.Date updated, ViewMap<IBranchMapping> branchView)
name
- nameownerName
- ownerdescription
- descriptionlocked
- if lockedaccessed
- dateupdated
- datebranchView
- view mappingpublic BranchSpec(java.util.Map<java.lang.String,java.lang.Object> map, IServer server)
map
- spec mapserver
- serverpublic BranchSpec(IBranchSpecSummary summary) throws ConnectionException, RequestException, AccessException
summary
- summary objectConnectionException
- if the Perforce server is unreachable or is not
connected.RequestException
- if the Perforce server encounters an error during
its processing of the requestAccessException
- if the Perforce server denies access to the callerpublic static BranchSpec newBranchSpec(IOptionsServer server, java.lang.String name, java.lang.String description, java.lang.String[] branches)
server
- non-null server to be associated with the new branch spec.name
- non-null branch spec name.description
- if not null, used as the new branc spec's description field;
if null, uses the BranchSpec.DEFAULT_DESCRIPTION field.branches
- if not null, use this as the list of branch spec
paths, in the order given, and according to the format in
MapEntry.parseViewMappingString; unlike many other core object
factory methods, this one does not default if null.public void refresh() throws ConnectionException, RequestException, AccessException
refresh
in interface IServerResource
refresh
in class ServerResource
ConnectionException
- if the Perforce server is unreachable or is not
connected.RequestException
- if the Perforce server encounters an error during
its processing of the requestAccessException
- if the Perforce server denies access to the callerServerResource.refresh()
public void update() throws ConnectionException, RequestException, AccessException
IServerResource
The results of calling this method on objects whose canUpdate method returns false are undefined (but will generally result in a UnimplementedError being thrown).
update
in interface IServerResource
update
in class ServerResource
ConnectionException
- if the Perforce server is unreachable or is not
connected.RequestException
- if the Perforce server encounters an error during
its processing of the requestAccessException
- if the Perforce server denies access to the callerServerResource.update()
public ViewMap<IBranchMapping> getBranchView()
IBranchSpec
getBranchView
in interface IBranchSpec
IBranchSpec.getBranchView()
public void setBranchView(ViewMap<IBranchMapping> branchView)
IBranchSpec
setBranchView
in interface IBranchSpec
branchView
- new view mappings for the branch.IBranchSpec.setBranchView(com.perforce.p4java.core.ViewMap)