Class Stream
java.lang.Object
com.perforce.p4java.impl.generic.core.ServerResource
com.perforce.p4java.impl.generic.core.StreamSummary
com.perforce.p4java.impl.generic.core.Stream
- All Implemented Interfaces:
IServerResource,IStream,IStreamSummary
Simple default implementation class for the IStream interface.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSimple default generic IExtraTag implementation class.static classstatic classSimple default implementation of the IStreamIgnoredMapping interface.static classSimple default implementation of the IStreamRemappedMapping interface.static classSimple default implementation of the IStreamViewMapping interface.Nested classes/interfaces inherited from class com.perforce.p4java.impl.generic.core.StreamSummary
StreamSummary.OptionsNested classes/interfaces inherited from interface com.perforce.p4java.core.IStream
IStream.IExtraTagNested classes/interfaces inherited from interface com.perforce.p4java.core.IStreamSummary
IStreamSummary.IOptions, IStreamSummary.ParentView, IStreamSummary.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ViewMap<IClientViewMapping>protected ViewMap<IStreamComponentMapping>static final StringDefault description for use in newStream method when no explicit description is given.protected List<IStream.IExtraTag>protected ViewMap<IStreamIgnoredMapping>protected ViewMap<IStreamRemappedMapping>protected ViewMap<IStreamViewMapping>Fields inherited from class com.perforce.p4java.impl.generic.core.ServerResource
refreshable, server, updateable -
Constructor Summary
ConstructorsConstructorDescriptionStream()Default constructor.Stream(IStreamSummary summary) Construct a new Stream from the passed-in summary stream spec.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.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, ViewMap<IStreamComponentMapping> components) Construct a new Stream from explicit field values.Construct a Stream from a map passed back from the Perforce server in response to a getStream command. -
Method Summary
Modifier and TypeMethodDescriptionReturn the automatically generated client view map associated with this stream.Return a list of extra tags associated with this stream.Return the ignored view map associated with this stream.Return the remapped view map associated with this stream.Return the view map associated with this stream.static StreamnewStream(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 StreamnewStream(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.static StreamnewStream(IOptionsServer server, String streamPath, String type, String parentStreamPath, String name, String description, String options, String[] viewPaths, String[] remappedPaths, String[] ignoredPaths, String[] clientViewPaths, String[] components) Simple factory / convenience method for creating a new local Stream object with defult values.voidrefresh()This method will refresh by getting the complete stream model.voidsetClientView(ViewMap<IClientViewMapping> clientView) Set the automatically generated client view map associated with this stream spec.voidsetComponents(ViewMap<IStreamComponentMapping> components) voidsetExtraTags(List<IStream.IExtraTag> extraTags) Set the extra tags associated with this stream.voidsetIgnoredView(ViewMap<IStreamIgnoredMapping> ignoredView) Set the ignored view map associated with this stream spec.voidsetRemappedView(ViewMap<IStreamRemappedMapping> remappedView) Set the remapped view map associated with this stream spec.voidsetServer(IOptionsServer server) Set the server to type of IOptionsServer, overriding the default IServer.voidsetStreamView(ViewMap<IStreamViewMapping> streamView) Set the view map associated with this stream spec.voidupdate()Update the Perforce server object associated with the underlying P4Java object, if possible.voidupdate(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, getParentView, getStream, getType, getUpdated, isChangeFlowsFromParent, isChangeFlowsToParent, isFirmerThanParent, isUnloaded, setAccessed, setBaseParent, setChangeFlowsFromParent, setChangeFlowsToParent, setDescription, setFirmerThanParent, setName, setOptions, setOwnerName, setParent, setParentView, setStream, setType, setUpdatedMethods inherited from class com.perforce.p4java.impl.generic.core.ServerResource
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, parseDate, setRawField, setRawFields, setRefreshable, setServer, toDateString, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.perforce.p4java.core.IServerResource
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, setRawField, setRawFields, setServer, updateMethods inherited from interface com.perforce.p4java.core.IStreamSummary
getAccessed, getBaseParent, getDescription, getName, getOptions, getOwnerName, getParent, getParentView, getStream, getType, getUpdated, isChangeFlowsFromParent, isChangeFlowsToParent, isFirmerThanParent, isUnloaded, setAccessed, setBaseParent, setChangeFlowsFromParent, setChangeFlowsToParent, setDescription, setFirmerThanParent, setName, setOptions, setOwnerName, setParent, setParentView, setStream, setType, setUpdated
-
Field Details
-
streamView
-
remappedView
-
ignoredView
-
clientView
-
components
-
extraTags
-
DEFAULT_DESCRIPTION
Default description for use in newStream method when no explicit description is given.- See Also:
-
-
Constructor Details
-
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.- Parameters:
stream- streamtype- typeparent- parentaccessed- accessedupdated- updatedname- namedescription- descriptionownerName- ownerNameoptions- optionsstreamView- streamViewremappedView- remappedViewignoredView- ignoredView
-
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.- Parameters:
stream- streamtype- typeparent- parentaccessed- accessedupdated- updatedname- namedescription- descriptionownerName- ownerNameoptions- optionsstreamView- streamViewremappedView- remappedViewignoredView- ignoredViewclientView- clientView
-
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, ViewMap<IStreamComponentMapping> components) Construct a new Stream from explicit field values.- Parameters:
stream- streamtype- typeparent- parentaccessed- accessedupdated- updatedname- namedescription- descriptionownerName- ownerNameoptions- optionsstreamView- streamViewremappedView- remappedViewignoredView- ignoredViewclientView- clientViewcomponents- components
-
Stream
Construct a Stream from a map passed back from the Perforce server in response to a getStream command.- Parameters:
map- spec mapserver- server
-
Stream
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.- Parameters:
summary- summary class- 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 requestAccessException- if the Perforce server denies access to the caller
-
-
Method Details
-
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.- Parameters:
server- serverstreamPath- stream pathtype- typeparentStreamPath- parent streamname- namedescription- descriptionoptions- optionsviewPaths- view pathsremappedPaths- remapped pathsignoredPaths- ignored paths- Returns:
- stream object
-
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 mergedown/mergeany.viewPaths- one or more lines that define file paths in the stream view. Each line is of the form: path_type view_path depot_pathremappedPaths- optional; one or more lines that define how stream view paths are to be remapped in client views. Each line is of the form: view_path_1 view_path_2ignoredPaths- 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.
-
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, String[] components) 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 mergedown/mergeany.viewPaths- one or more lines that define file paths in the stream view. Each line is of the form: path_type view_path depot_pathremappedPaths- optional; one or more lines that define how stream view paths are to be remapped in client views. Each line is of the form: view_path_1 view_path_2ignoredPaths- 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 ....classcomponents- Add stream components. Syntax: component_type component_folder component_stream[@[change | automatic_label]] eg: readonly dirB //streams/B- Returns:
- new local Stream object.
-
refresh
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:
refreshin interfaceIServerResource- Overrides:
refreshin classServerResource- 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 requestAccessException- if the Perforce server denies access to the caller- See Also:
-
update
Description copied from interface:IServerResourceUpdate 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:
updatein interfaceIServerResource- Overrides:
updatein classServerResource- 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 requestAccessException- if the Perforce server denies access to the caller- See Also:
-
update
Description copied from interface:IServerResourceForce (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:
updatein interfaceIServerResource- Overrides:
updatein classServerResource- 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 requestAccessException- if the Perforce server denies access to the caller- See Also:
-
getStreamView
Description copied from interface:IStreamReturn 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: path_type view_path [depot_path]- Specified by:
getStreamViewin interfaceIStream- Returns:
- non-null list of IStreamViewMapping mappings for this stream.
- See Also:
-
setStreamView
Description copied from interface:IStreamSet 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:
setStreamViewin interfaceIStream- Parameters:
streamView- new view mappings for the stream.- See Also:
-
setServer
Description copied from interface:IStreamSet the server to type of IOptionsServer, overriding the default IServer. -
getRemappedView
Description copied from interface:IStreamReturn 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: view_path_1 view_path_2- Specified by:
getRemappedViewin interfaceIStream- Returns:
- possibly-null (optional) list of IStreamRemappedMapping mappings for this stream.
- See Also:
-
setRemappedView
Description copied from interface:IStreamSet 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:
setRemappedViewin interfaceIStream- Parameters:
remappedView- new remapped view mappings for the stream.- See Also:
-
getIgnoredView
Description copied from interface:IStreamReturn 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:
getIgnoredViewin interfaceIStream- Returns:
- possibly-null (optional) list of IStreamIgnoredMapping mappings to be ignored for this stream.
- See Also:
-
setIgnoredView
Description copied from interface:IStreamSet 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:
setIgnoredViewin interfaceIStream- Parameters:
ignoredView- ignore view mapping- See Also:
-
getClientView
Description copied from interface:IStreamReturn the automatically generated client view map associated with this stream. Maps files in the depot to files in your client workspace.- Specified by:
getClientViewin interfaceIStream- Returns:
- possibly-null list of automatically generated IClientViewMapping mappings associated with this stream.
- See Also:
-
setClientView
Description copied from interface:IStreamSet 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:
setClientViewin interfaceIStream- Parameters:
clientView- client view- See Also:
-
getExtraTags
Description copied from interface:IStreamReturn a list of extra tags associated with this stream.- Specified by:
getExtraTagsin interfaceIStream- Returns:
- possibly-null list of extra tags associated with this stream.
- See Also:
-
setExtraTags
Description copied from interface:IStreamSet 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:
setExtraTagsin interfaceIStream- Parameters:
extraTags- extra tags- See Also:
-
getComponents
- Specified by:
getComponentsin interfaceIStream
-
setComponents
- Specified by:
setComponentsin interfaceIStream- Parameters:
components- A stream Components
-