Interface IServerResource

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canRefresh()
      Returns true if the underlying object is refreshable from the Perforce server.
      boolean canUpdate()
      Returns true if the underlying object can be updated back to (or on) the associated Perforce server.
      void clearRawFields()
      Create new map and clear all fields.
      void complete()
      Old method called used to call refresh when completing a spec.
      java.lang.Object getRawField​(java.lang.String field)
      Fetch a value from the raw spec map.
      java.util.Map<java.lang.String,​java.lang.Object> getRawFields()
      Fetch the whole raw spec map.
      boolean hasRawField​(java.lang.String field)
      Look for field in map.
      void refresh()
      Refresh the underlying object from the Perforce server.
      void setRawField​(java.lang.String field, java.lang.Object value)
      Enter Key/Pair for a spec field.
      void setRawFields​(java.util.Map<java.lang.String,​java.lang.Object> map)
      Add all elements in a map to the spec
      void setServer​(IServer server)
      Set the server associated with this resource.
      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.
      void update​(Options opts)
      Update the Perforce server object associated with the underlying P4Java object and its options, if possible.
    • Method Detail

      • canRefresh

        boolean canRefresh()
        Returns true if the underlying object is refreshable from the Perforce server.

        The details of what "refreshable" means in this context are always object-dependent, but typically mean that "live" data and metadata will be updated from the server. This is especially useful on objects like changelists, where the underlying server-side data may change often outside P4Java's control.

        Returns:
        true if the underlying the object is refreshable.
      • refresh

        void refresh()
              throws ConnectionException,
                     RequestException,
                     AccessException
        Refresh the underlying object from the Perforce server.

        The details of what "refreshable" means in this context are always object-dependent, but typically mean that "live" data and metadata will be updated from the server.

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

        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
      • canUpdate

        boolean canUpdate()
        Returns true if the underlying object can be updated back to (or on) the associated Perforce server. The semantics of server updates are generally object-specific.
        Returns:
        true if the underlying object can be updated back to (or on) the associated Perforce server
      • update

        void update()
             throws ConnectionException,
                    RequestException,
                    AccessException
        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).

        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
      • update

        void update​(boolean force)
             throws ConnectionException,
                    RequestException,
                    AccessException
        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).

        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
      • update

        void update​(Options opts)
             throws ConnectionException,
                    RequestException,
                    AccessException
        Update the Perforce server object associated with the underlying P4Java object and its options, 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).

        Parameters:
        opts - Options object describing optional parameters; if null, no options are set.
        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
      • setServer

        void setServer​(IServer server)
        Set the server associated with this resource. Setting this null can have bad effects down the line...
        Parameters:
        server - IServer to be used for refresh, update, etc.
      • getRawField

        java.lang.Object getRawField​(java.lang.String field)
        Fetch a value from the raw spec map.
        Parameters:
        field - spec field
        Returns:
        valuse as an Object
      • setRawField

        void setRawField​(java.lang.String field,
                         java.lang.Object value)
        Enter Key/Pair for a spec field.
        Parameters:
        field - field kay
        value - value
      • getRawFields

        java.util.Map<java.lang.String,​java.lang.Object> getRawFields()
        Fetch the whole raw spec map.
        Returns:
        Spec Map
      • setRawFields

        void setRawFields​(java.util.Map<java.lang.String,​java.lang.Object> map)
        Add all elements in a map to the spec
        Parameters:
        map - field map
      • clearRawFields

        void clearRawFields()
        Create new map and clear all fields.
      • hasRawField

        boolean hasRawField​(java.lang.String field)
        Look for field in map.
        Parameters:
        field - field name
        Returns:
        true if field exists.