Class UserSession

java.lang.Object
ecmwf.common.ecaccess.UserSession
Direct Known Subclasses:
MasterProvider.UserDataSpace, MoverProvider.UserDataSpace

public abstract class UserSession extends Object
The Class UserSession.
  • Constructor Details

    • UserSession

      public UserSession(String user, String token)
      Instantiates a new user session.
      Parameters:
      user - the user
      token - the token
  • Method Details

    • getUser

      public String getUser()
      Gets the user.
      Returns:
      the user
    • getToken

      public String getToken()
      Gets the token.
      Returns:
      the token
    • getDefaultGroup

      public String getDefaultGroup()
      Gets the default group.
      Returns:
      the default group
    • getDefaultDomain

      public String getDefaultDomain()
      Gets the default domain.
      Returns:
      the default domain
    • getWelcome

      public String getWelcome()
      Gets the welcome.
      Returns:
      the welcome
    • getECtransSetup

      public ECtransSetup getECtransSetup()
      Gets the setup.
      Returns:
      the setup
    • hasPermission

      public boolean hasPermission(String permission)
      Checks if the user has been granted the named permission for any path. Returns false by default; overridden by implementations that have a permission model (e.g. data-portal sessions).
      Parameters:
      permission - the operation name (e.g. "put", "delete")
      Returns:
      true if the permission is granted
    • chmod

      public void chmod(int mode, String path) throws EccmdException, IOException
      Chmod.
      Parameters:
      mode - the mode
      path - the path
      Throws:
      EccmdException - the eccmd exception
      IOException - Signals that an I/O exception has occurred.
    • getFileSize

      public abstract long getFileSize(String source) throws EccmdException, IOException
      Gets the file size.
      Parameters:
      source - the source
      Returns:
      the file size
      Throws:
      EccmdException - the eccmd exception
      IOException - Signals that an I/O exception has occurred.
    • deleteFile

      public void deleteFile(String source, boolean force) throws EccmdException, IOException
      Delete file.
      Parameters:
      source - the source
      force - the force
      Throws:
      EccmdException - the eccmd exception
      IOException - Signals that an I/O exception has occurred.
    • getFileList

      public abstract FileListElement[] getFileList(String path) throws EccmdException, IOException
      Gets the file list.
      Parameters:
      path - the path
      Returns:
      the file list
      Throws:
      EccmdException - the eccmd exception
      IOException - Signals that an I/O exception has occurred.
    • getFileList

      public abstract FileListElement[] getFileList(String path, String options) throws EccmdException, IOException
      Gets the file list.
      Parameters:
      path - the path
      options - the options
      Returns:
      the file list
      Throws:
      EccmdException - the eccmd exception
      IOException - Signals that an I/O exception has occurred.
    • getFileListElement

      public abstract FileListElement getFileListElement(String path) throws EccmdException, IOException
      Gets the file list element.
      Parameters:
      path - the path
      Returns:
      the file list element
      Throws:
      EccmdException - the eccmd exception
      IOException - Signals that an I/O exception has occurred.
    • getFileLastModified

      public abstract long getFileLastModified(String source) throws EccmdException, IOException
      Gets the file last modified.
      Parameters:
      source - the source
      Returns:
      the file last modified
      Throws:
      EccmdException - the eccmd exception
      IOException - Signals that an I/O exception has occurred.
    • mkdir

      public void mkdir(String dir) throws EccmdException, IOException
      Mkdir.
      Parameters:
      dir - the dir
      Throws:
      EccmdException - the eccmd exception
      IOException - Signals that an I/O exception has occurred.
    • rmdir

      public void rmdir(String dir) throws EccmdException, IOException
      Rmdir.
      Parameters:
      dir - the dir
      Throws:
      EccmdException - the eccmd exception
      IOException - Signals that an I/O exception has occurred.
    • moveFile

      public void moveFile(String source, String target) throws EccmdException, IOException
      Move file.
      Parameters:
      source - the source
      target - the target
      Throws:
      EccmdException - the eccmd exception
      IOException - Signals that an I/O exception has occurred.
    • copyFile

      public void copyFile(String source, String target, boolean erase) throws EccmdException, IOException
      Copy file.
      Parameters:
      source - the source
      target - the target
      erase - the erase
      Throws:
      EccmdException - the eccmd exception
      IOException - Signals that an I/O exception has occurred.
    • getTempFile

      public String getTempFile() throws IOException, EccmdException
      Gets the temp file.
      Returns:
      the temp file
      Throws:
      IOException - Signals that an I/O exception has occurred.
      EccmdException - the eccmd exception
    • getProxySocketInput

      public abstract ProxySocket getProxySocketInput(String source, long offset) throws EccmdException, IOException
      Gets the proxy socket input.
      Parameters:
      source - the source
      offset - the offset
      Returns:
      the proxy socket input
      Throws:
      EccmdException - the eccmd exception
      IOException - Signals that an I/O exception has occurred.
    • getProxySocketInput

      public abstract ProxySocket getProxySocketInput(String source, long offset, long length) throws EccmdException, IOException
      Gets the proxy socket input.
      Parameters:
      source - the source
      offset - the offset
      length - the length
      Returns:
      the proxy socket input
      Throws:
      EccmdException - the eccmd exception
      IOException - Signals that an I/O exception has occurred.
    • getProxySocketOutput

      public abstract ProxySocket getProxySocketOutput(String target, long offset, int umask) throws EccmdException, IOException
      Gets the proxy socket output.
      Parameters:
      target - the target
      offset - the offset
      umask - the umask
      Returns:
      the proxy socket output
      Throws:
      EccmdException - the eccmd exception
      IOException - Signals that an I/O exception has occurred.
    • check

      public abstract void check(ProxySocket proxy) throws IOException, EccmdException
      Check.
      Parameters:
      proxy - the proxy
      Throws:
      IOException - Signals that an I/O exception has occurred.
      EccmdException - the eccmd exception
    • close

      public void close(boolean remove)
      Close.
      Parameters:
      remove - the remove