Class Stream

    • Constructor Detail

      • Stream

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

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

        public Stream​(java.lang.String stream,
                      IStreamSummary.Type type,
                      java.lang.String parent,
                      java.util.Date accessed,
                      java.util.Date updated,
                      java.lang.String name,
                      java.lang.String description,
                      java.lang.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 - stream
        type - type
        parent - parent
        accessed - accessed
        updated - updated
        name - name
        description - description
        ownerName - ownerName
        options - options
        streamView - streamView
        remappedView - remappedView
        ignoredView - ignoredView
        clientView - clientView
      • Stream

        public Stream​(java.util.Map<java.lang.String,​java.lang.Object> map,
                      IServer server)
        Construct a Stream from a map passed back from the Perforce server in response to a getStream command.
        Parameters:
        map - spec map
        server - server
      • 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.
        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 request
        AccessException - if the Perforce server denies access to the caller
    • Method Detail

      • newStream

        public static Stream newStream​(IOptionsServer server,
                                       java.lang.String streamPath,
                                       java.lang.String type,
                                       java.lang.String parentStreamPath,
                                       java.lang.String name,
                                       java.lang.String description,
                                       java.lang.String options,
                                       java.lang.String[] viewPaths,
                                       java.lang.String[] remappedPaths,
                                       java.lang.String[] ignoredPaths)
        Simple factory / convenience method for creating a new local Stream object with defult values.
        Parameters:
        server - server
        streamPath - stream path
        type - type
        parentStreamPath - parent stream
        name - name
        description - description
        options - options
        viewPaths - view paths
        remappedPaths - remapped paths
        ignoredPaths - ignored paths
        Returns:
        stream object
      • newStream

        public static Stream newStream​(IOptionsServer server,
                                       java.lang.String streamPath,
                                       java.lang.String type,
                                       java.lang.String parentStreamPath,
                                       java.lang.String name,
                                       java.lang.String description,
                                       java.lang.String options,
                                       java.lang.String[] viewPaths,
                                       java.lang.String[] remappedPaths,
                                       java.lang.String[] ignoredPaths,
                                       java.lang.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_path
        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: view_path_1 view_path_2
        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.
      • newStream

        public static Stream newStream​(IOptionsServer server,
                                       java.lang.String streamPath,
                                       java.lang.String type,
                                       java.lang.String parentStreamPath,
                                       java.lang.String name,
                                       java.lang.String description,
                                       java.lang.String options,
                                       java.lang.String[] viewPaths,
                                       java.lang.String[] remappedPaths,
                                       java.lang.String[] ignoredPaths,
                                       java.lang.String[] clientViewPaths,
                                       java.lang.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_path
        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: view_path_1 view_path_2
        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
        components - Add stream components. Syntax: component_type component_folder component_stream[@[change | automatic_label]] eg: readonly dirB //streams/B
        Returns:
        new local Stream object.
      • 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: path_type view_path [depot_path]
        Specified by:
        getStreamView in interface IStream
        Returns:
        non-null list of IStreamViewMapping mappings for this stream.
        See Also:
        IStream.getStreamView()
      • 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: view_path_1 view_path_2
        Specified by:
        getRemappedView in interface IStream
        Returns:
        possibly-null (optional) list of IStreamRemappedMapping mappings for this stream.
        See Also:
        IStream.getRemappedView()
      • 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()
      • 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()
      • getExtraTags

        public java.util.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​(java.util.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
        Parameters:
        extraTags - extra tags
        See Also:
        IStream.setExtraTags(java.util.List)