com.perforce.p4java.impl.generic.core
Class Stream

java.lang.Object
  extended by com.perforce.p4java.impl.generic.core.ServerResource
      extended by com.perforce.p4java.impl.generic.core.StreamSummary
          extended by com.perforce.p4java.impl.generic.core.Stream
All Implemented Interfaces:
IServerResource, IStream, IStreamSummary

public class Stream
extends StreamSummary
implements IStream

Simple default implementation class for the IStream interface.


Nested Class Summary
static class Stream.ExtraTag
          Simple default generic IExtraTag implementation class.
static class Stream.StreamIgnoredMapping
          Simple default implementation of the IStreamIgnoredMapping interface.
static class Stream.StreamRemappedMapping
          Simple default implementation of the IStreamRemappedMapping interface.
static class Stream.StreamViewMapping
          Simple default implementation of the IStreamViewMapping interface.
 
Nested classes/interfaces inherited from class com.perforce.p4java.impl.generic.core.StreamSummary
StreamSummary.Options
 
Nested classes/interfaces inherited from interface com.perforce.p4java.core.IStream
IStream.IExtraTag
 
Nested classes/interfaces inherited from interface com.perforce.p4java.core.IStreamSummary
IStreamSummary.IOptions, IStreamSummary.Type
 
Field Summary
protected  ViewMap<IClientViewMapping> clientView
           
static String DEFAULT_DESCRIPTION
          Default description for use in newStream method when no explicit description is given.
protected  List<IStream.IExtraTag> extraTags
           
protected  ViewMap<IStreamIgnoredMapping> ignoredView
           
protected  ViewMap<IStreamRemappedMapping> remappedView
           
protected  ViewMap<IStreamViewMapping> streamView
           
 
Fields inherited from class com.perforce.p4java.impl.generic.core.StreamSummary
accessed, baseParent, changeFlowsFromParent, changeFlowsToParent, description, firmerThanParent, name, options, ownerName, parent, stream, type, unloaded, updated
 
Fields inherited from class com.perforce.p4java.impl.generic.core.ServerResource
refreshable, server, updateable
 
Constructor Summary
Stream()
          Default constructor.
Stream(IStreamSummary summary)
          Construct a new Stream from the passed-in summary stream spec.
Stream(Map<String,Object> map, IOptionsServer server)
          Construct a Stream from a map passed back from the Perforce server in response to a getStream command.
Stream(String stream, IStreamSummary.Type type, String parent, Date accessed, Date updated, String name, String description, String ownerName, IStreamSummary.IOptions options, ViewMap<IStreamViewMapping> streamView, ViewMap<IStreamRemappedMapping> remappedView, ViewMap<IStreamIgnoredMapping> ignoredView)
          Construct a new Stream from explicit field values.
Stream(String stream, IStreamSummary.Type type, String parent, Date accessed, Date updated, String name, String description, String ownerName, IStreamSummary.IOptions options, ViewMap<IStreamViewMapping> streamView, ViewMap<IStreamRemappedMapping> remappedView, ViewMap<IStreamIgnoredMapping> ignoredView, ViewMap<IClientViewMapping> clientView)
          Construct a new Stream from explicit field values.
 
Method Summary
 ViewMap<IClientViewMapping> getClientView()
          Return the automatically generated client view map associated with this stream.
 List<IStream.IExtraTag> getExtraTags()
          Return a list of extra tags associated with this stream.
 ViewMap<IStreamIgnoredMapping> getIgnoredView()
          Return the ignored view map associated with this stream.
 ViewMap<IStreamRemappedMapping> getRemappedView()
          Return the remapped view map associated with this stream.
 ViewMap<IStreamViewMapping> getStreamView()
          Return the view map associated with this stream.
static Stream newStream(IOptionsServer server, String streamPath, String type, String parentStreamPath, String name, String description, String options, String[] viewPaths, String[] remappedPaths, String[] ignoredPaths)
          Simple factory / convenience method for creating a new local Stream object with defult values.
static Stream newStream(IOptionsServer server, String streamPath, String type, String parentStreamPath, String name, String description, String options, String[] viewPaths, String[] remappedPaths, String[] ignoredPaths, String[] clientViewPaths)
          Simple factory / convenience method for creating a new local Stream object with defult values.
 void refresh()
          This method will refresh by getting the complete stream model.
 void setClientView(ViewMap<IClientViewMapping> clientView)
          Set the automatically generated client view map associated with this stream spec.
 void setExtraTags(List<IStream.IExtraTag> extraTags)
          Set the extra tags associated with this stream.
 void setIgnoredView(ViewMap<IStreamIgnoredMapping> ignoredView)
          Set the ignored view map associated with this stream spec.
 void setRemappedView(ViewMap<IStreamRemappedMapping> remappedView)
          Set the remapped view map associated with this stream spec.
 void setServer(IOptionsServer server)
          Set the server to type of IOptionsServer, overriding the default IServer.
 void setStreamView(ViewMap<IStreamViewMapping> streamView)
          Set the view map associated with this stream spec.
 void update()
          Update the Perforce server object associated with the underlying P4Java object, if possible.
 void update(boolean force)
          Force (if true) update the Perforce server object associated with the underlying P4Java object, if possible.
 
Methods inherited from class com.perforce.p4java.impl.generic.core.StreamSummary
getAccessed, getBaseParent, getDescription, getName, getOptions, getOwnerName, getParent, getStream, getType, getUpdated, isChangeFlowsFromParent, isChangeFlowsToParent, isFirmerThanParent, isUnloaded, setAccessed, setBaseParent, setChangeFlowsFromParent, setChangeFlowsToParent, setDescription, setFirmerThanParent, setName, setOptions, setOwnerName, setParent, setStream, setType, setUpdated
 
Methods inherited from class com.perforce.p4java.impl.generic.core.ServerResource
canRefresh, canUpdate, complete, setRefreshable, setServer, 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.IStreamSummary
getAccessed, getBaseParent, getDescription, getName, getOptions, getOwnerName, getParent, getStream, getType, getUpdated, isChangeFlowsFromParent, isChangeFlowsToParent, isFirmerThanParent, isUnloaded, setAccessed, setBaseParent, setChangeFlowsFromParent, setChangeFlowsToParent, setDescription, setFirmerThanParent, setName, setOptions, setOwnerName, setParent, setStream, setType, setUpdated
 
Methods inherited from interface com.perforce.p4java.core.IServerResource
canRefresh, canUpdate, setServer, update
 

Field Detail

streamView

protected ViewMap<IStreamViewMapping> streamView

remappedView

protected ViewMap<IStreamRemappedMapping> remappedView

ignoredView

protected ViewMap<IStreamIgnoredMapping> ignoredView

clientView

protected ViewMap<IClientViewMapping> clientView

extraTags

protected List<IStream.IExtraTag> extraTags

DEFAULT_DESCRIPTION

public static final String DEFAULT_DESCRIPTION
Default description for use in newStream method when no explicit description is given.

See Also:
Constant Field Values
Constructor Detail

Stream

public Stream()
Default constructor. All fields set to null or false.


Stream

public Stream(String stream,
              IStreamSummary.Type type,
              String parent,
              Date accessed,
              Date updated,
              String name,
              String description,
              String ownerName,
              IStreamSummary.IOptions options,
              ViewMap<IStreamViewMapping> streamView,
              ViewMap<IStreamRemappedMapping> remappedView,
              ViewMap<IStreamIgnoredMapping> ignoredView)
Construct a new Stream from explicit field values.


Stream

public Stream(String stream,
              IStreamSummary.Type type,
              String parent,
              Date accessed,
              Date updated,
              String name,
              String description,
              String ownerName,
              IStreamSummary.IOptions options,
              ViewMap<IStreamViewMapping> streamView,
              ViewMap<IStreamRemappedMapping> remappedView,
              ViewMap<IStreamIgnoredMapping> ignoredView,
              ViewMap<IClientViewMapping> clientView)
Construct a new Stream from explicit field values.


Stream

public Stream(Map<String,Object> map,
              IOptionsServer server)
Construct a Stream from a map passed back from the Perforce server in response to a getStream command.


Stream

public Stream(IStreamSummary summary)
       throws ConnectionException,
              RequestException,
              AccessException
Construct a new Stream from the passed-in summary stream spec. If the summary is null, this is equivalent to calling the default Stream constructor; otherwise after name initialization a refresh() is done on the new (empty) Stream.

Throws:
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 caller
Method Detail

newStream

public static Stream newStream(IOptionsServer server,
                               String streamPath,
                               String type,
                               String parentStreamPath,
                               String name,
                               String description,
                               String options,
                               String[] viewPaths,
                               String[] remappedPaths,
                               String[] ignoredPaths)
Simple factory / convenience method for creating a new local Stream object with defult values.


newStream

public static Stream newStream(IOptionsServer server,
                               String streamPath,
                               String type,
                               String parentStreamPath,
                               String name,
                               String description,
                               String options,
                               String[] viewPaths,
                               String[] remappedPaths,
                               String[] ignoredPaths,
                               String[] clientViewPaths)
Simple factory / convenience method for creating a new local Stream object with defult values.

Parameters:
server - non-null server to be associated with the new stream spec.
streamPath - non-null stream's path in a stream depot, of the form //depotname/streamname.
type - non-null stream type of 'mainline', 'development', or 'release'.
parentStreamPath - parent of this stream. Can be null if the stream type is 'mainline', otherwise must be set to an existing stream.
name - an alternate name of the stream, for use in display outputs. Defaults to the 'streamname' portion of the stream path. Can be changed.
description - if not null, used as the new stream spec's description field; if null, uses the Stream.DEFAULT_DESCRIPTION field.
options - flags to configure stream behavior: allsubmit/ownersubmit [un]locked [no]toparent [no]fromparent.
viewPaths - one or more lines that define file paths in the stream view. Each line is of the form: []
remappedPaths - optional; one or more lines that define how stream view paths are to be remapped in client views. Each line is of the form:
ignoredPaths - optional; a list of file or directory names to be ignored in client views. For example: /tmp # ignores files named 'tmp' /tmp/... # ignores dirs named 'tmp' .tmp # ignores file names ending in '.tmp'
clientViewPaths - automatically generated; maps files in the depot to files in your client workspace. For example: //p4java_stream/dev/... ... //p4java_stream/dev/readonly/sync/p4cmd/%%1 readonly/sync/p4cmd/%%1 -//p4java_stream/.../temp/... .../temp/... -//p4java_stream/....class ....class
Returns:
new local Stream object.

refresh

public void refresh()
             throws ConnectionException,
                    RequestException,
                    AccessException
This method will refresh by getting the complete stream model. If this refresh is successful then this stream will be marked as complete.

Specified by:
refresh in interface IServerResource
Overrides:
refresh in class ServerResource
Throws:
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 caller
See Also:
ServerResource.refresh()

update

public void update()
            throws ConnectionException,
                   RequestException,
                   AccessException
Description copied from interface: IServerResource
Update the Perforce server object associated with the underlying P4Java object, if possible. The semantics of server updates are generally object-specific and will be spelled out for each participating object.

The results of calling this method on objects whose canUpdate method returns false are undefined (but will generally result in a UnimplementedError being thrown).

Specified by:
update in interface IServerResource
Overrides:
update in class ServerResource
Throws:
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 caller
See Also:
ServerResource.update()

update

public void update(boolean force)
            throws ConnectionException,
                   RequestException,
                   AccessException
Description copied from interface: IServerResource
Force (if true) update the Perforce server object associated with the underlying P4Java object, if possible. The semantics of server updates are generally object-specific and will be spelled out for each participating object.

Note, in order to force the change it may require super user / admin privileges to work properly. The results of calling this method on objects whose canUpdate method returns false are undefined (but will generally result in a UnimplementedError being thrown).

Specified by:
update in interface IServerResource
Overrides:
update in class ServerResource
Parameters:
force - if true, force the update of the object on the server.
Throws:
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 caller
See Also:
ServerResource.update(boolean)

getStreamView

public ViewMap<IStreamViewMapping> getStreamView()
Description copied from interface: IStream
Return the view map associated with this stream. One or more mappings that define file paths in the stream view. Each line is of the form: []

Specified by:
getStreamView in interface IStream
Returns:
non-null list of IStreamViewMapping mappings for this stream.
See Also:
IStream.getStreamView()

setStreamView

public void setStreamView(ViewMap<IStreamViewMapping> streamView)
Description copied from interface: IStream
Set the view map associated with this stream spec. This will not change the associated stream spec on the Perforce server unless you arrange for the update to server.

Specified by:
setStreamView in interface IStream
Parameters:
streamView - new view mappings for the stream.
See Also:
IStream.setStreamView(com.perforce.p4java.core.ViewMap)

setServer

public void setServer(IOptionsServer server)
Description copied from interface: IStream
Set the server to type of IOptionsServer, overriding the default IServer.

Specified by:
setServer in interface IStream
See Also:
IServerResource.setServer(com.perforce.p4java.server.IServer)

getRemappedView

public ViewMap<IStreamRemappedMapping> getRemappedView()
Description copied from interface: IStream
Return the remapped view map associated with this stream. Optional; one or more mappings that define how stream view paths are to be remapped in client views. Each line is of the form:

Specified by:
getRemappedView in interface IStream
Returns:
possibly-null (optional) list of IStreamRemappedMapping mappings for this stream.
See Also:
IStream.getRemappedView()

setRemappedView

public void setRemappedView(ViewMap<IStreamRemappedMapping> remappedView)
Description copied from interface: IStream
Set the remapped view map associated with this stream spec. This will not change the associated stream spec on the Perforce server unless you arrange for the update to server.

Specified by:
setRemappedView in interface IStream
Parameters:
remappedView - new remapped view mappings for the stream.
See Also:
IStream.setStreamView(com.perforce.p4java.core.ViewMap)

getIgnoredView

public ViewMap<IStreamIgnoredMapping> getIgnoredView()
Description copied from interface: IStream
Return the ignored view map associated with this stream. Optional; a list of file or directory names to be ignored in client views. mappings in the "Ignored" field may appear in any order. Ignored names are inherited by child stream client views.

Specified by:
getIgnoredView in interface IStream
Returns:
possibly-null (optional) list of IStreamIgnoredMapping mappings to be ignored for this stream.
See Also:
IStream.getIgnoredView()

setIgnoredView

public void setIgnoredView(ViewMap<IStreamIgnoredMapping> ignoredView)
Description copied from interface: IStream
Set the ignored view map associated with this stream spec. This will not change the associated stream spec on the Perforce server unless you arrange for the update to server.

Specified by:
setIgnoredView in interface IStream
See Also:
IStream.setIgnoredView(com.perforce.p4java.core.ViewMap)

getClientView

public ViewMap<IClientViewMapping> getClientView()
Description copied from interface: IStream
Return the automatically generated client view map associated with this stream. Maps files in the depot to files in your client workspace.

Specified by:
getClientView in interface IStream
Returns:
possibly-null list of automatically generated IClientViewMapping mappings associated with this stream.
See Also:
IStream.getClientView()

setClientView

public void setClientView(ViewMap<IClientViewMapping> clientView)
Description copied from interface: IStream
Set the automatically generated client view map associated with this stream spec. This will not change the associated stream spec on the Perforce server unless you arrange for the update to server.

Specified by:
setClientView in interface IStream
See Also:
IStream.setClientView(com.perforce.p4java.core.ViewMap)

getExtraTags

public List<IStream.IExtraTag> getExtraTags()
Description copied from interface: IStream
Return a list of extra tags associated with this stream.

Specified by:
getExtraTags in interface IStream
Returns:
possibly-null list of extra tags associated with this stream.
See Also:
IStream.getExtraTags()

setExtraTags

public void setExtraTags(List<IStream.IExtraTag> extraTags)
Description copied from interface: IStream
Set the extra tags associated with this stream. This will not change the associated stream spec on the Perforce server unless you arrange for the update to server.

Specified by:
setExtraTags in interface IStream
See Also:
IStream.setExtraTags(java.util.List)


Copyright © 2015 Perforce Software. All Rights Reserved.