|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.perforce.p4java.impl.generic.core.ServerResource
com.perforce.p4java.impl.generic.core.LabelSummary
com.perforce.p4java.impl.generic.core.Label
public class Label
Default implementation class for the ILabel interface.
Nested Class Summary | |
---|---|
static class |
Label.LabelMapping
|
Field Summary | |
---|---|
protected ViewMap<ILabelMapping> |
viewMapping
|
Fields inherited from class com.perforce.p4java.impl.generic.core.LabelSummary |
---|
description, lastAccess, lastUpdate, locked, LOCKED_VALUE, name, ownerName, revisionSpec, UNLOCKED_VALUE |
Fields inherited from class com.perforce.p4java.impl.generic.core.ServerResource |
---|
refreshable, server, updateable |
Constructor Summary | |
---|---|
Label()
Default constructor; sets all inherited and local fields to null or false; calls super(false). |
|
Label(ILabelSummary labelSummary)
Given an ILabelSummary object, construct a new Label object from it. |
|
Label(java.util.Map<java.lang.String,java.lang.Object> map,
IServer server)
Construct a new Label from the map passed back from the IServer's getLabel method or from a similar map, and the current server object (if any). |
|
Label(java.lang.String name,
java.lang.String ownerName,
java.util.Date lastAccess,
java.util.Date lastUpdate,
java.lang.String description,
java.lang.String revisionSpec,
boolean locked,
ViewMap<ILabelMapping> viewMapping)
Explicit-value constructor. |
Method Summary | |
---|---|
IServer |
getServer()
Get the Perforce server object associated with this label. |
ViewMap<ILabelMapping> |
getViewMapping()
Get the view mapping for this label. |
void |
refresh()
This method will refresh by getting the complete label model. |
void |
setServer(IServer server)
Set the server associated with this resource. |
void |
setViewMapping(ViewMap<ILabelMapping> viewMapping)
Set the view mapping for this label. |
void |
update()
Update the Perforce server object associated with the underlying P4Java object, if possible. |
java.lang.String |
updateOnServer()
Update (or even create) this label on the associated Perforce server, if that server has been set for this label. |
Methods inherited from class com.perforce.p4java.impl.generic.core.LabelSummary |
---|
getDescription, getLastAccess, getLastUpdate, getName, getOwnerName, getRevisionSpec, isLocked, setDescription, setLastAccess, setLastUpdate, setLocked, setName, setOwnerName, setRevisionSpec |
Methods inherited from class com.perforce.p4java.impl.generic.core.ServerResource |
---|
canRefresh, canUpdate, complete, setRefreshable |
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.ILabelSummary |
---|
getDescription, getLastAccess, getLastUpdate, getName, getOwnerName, getRevisionSpec, isLocked, setDescription, setLastAccess, setLastUpdate, setLocked, setName, setOwnerName, setRevisionSpec |
Methods inherited from interface com.perforce.p4java.core.IServerResource |
---|
canRefresh, canUpdate |
Field Detail |
---|
protected ViewMap<ILabelMapping> viewMapping
Constructor Detail |
---|
public Label()
public Label(java.lang.String name, java.lang.String ownerName, java.util.Date lastAccess, java.util.Date lastUpdate, java.lang.String description, java.lang.String revisionSpec, boolean locked, ViewMap<ILabelMapping> viewMapping)
public Label(java.util.Map<java.lang.String,java.lang.Object> map, IServer server)
If the map is null, this is equivalent to calling the default constructor.
public Label(ILabelSummary labelSummary) throws ConnectionException, RequestException, AccessException
If labelSummary is null this is equivalent to calling the default constructor; otherwise all LabelSummary fields are copied, and if labelSummary.getName() is not null, the refresh() is performed.
labelSummary
- possibly-null ILabelSummary object.
ConnectionException
RequestException
AccessException
Method Detail |
---|
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 request
AccessException
- if the Perforce server denies access to the callerServerResource.refresh()
public java.lang.String updateOnServer() throws ConnectionException, RequestException, AccessException
ILabel
Note that you should only call this method on "full" labels, i.e. those returned from an explicit single call to IServer.getLabel() or those created by hand; calling this on a label returned from the getLabelList() method may cause the associated in-server label to lose its view mapping.
updateOnServer
in interface ILabel
ConnectionException
- if the Perforce server is unreachable or is not
connected.
RequestException
- if the Perforce server encounters an error during
its processing of the request
AccessException
- if the Perforce server denies access to the callerILabel.updateOnServer()
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 ILabel
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 request
AccessException
- if the Perforce server denies access to the callerServerResource.update()
public void setViewMapping(ViewMap<ILabelMapping> viewMapping)
ILabel
setViewMapping
in interface ILabel
viewMapping
- list of IClientViewMapping mappings for this label.ILabel.setViewMapping(com.perforce.p4java.core.ViewMap)
public ViewMap<ILabelMapping> getViewMapping()
ILabel
Note also that this method will only return the actual view mapping a label if the label object was returned from the IServer's getLabel() method (this is due to limitations in the underlying implementation).
getViewMapping
in interface ILabel
ILabel.getViewMapping()
public IServer getServer()
ILabel
getServer
in interface ILabel
ILabel.getServer()
public void setServer(IServer server)
IServerResource
setServer
in interface ILabel
setServer
in interface IServerResource
setServer
in class ServerResource
server
- IServer to be used for refresh, update, etc.ILabel.setServer(com.perforce.p4java.server.IServer)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |