Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.fujitsu.iflow.dmsadapter.intf
Interface DmsSession

All Superinterfaces:
  java.rmi.Remote

public interface DmsSession
extends java.rmi.Remote

The DmsSession interface supports the checking-in and checking-out of documents in the Document Management System (DMS).

Documents are exchanged between the clients and their corresponding DMSSession objects through directories on the machine where the DMSAdapter is running or directories for which DMSSessionObjects have access. When a document is checked out, it is placed in a directory on the adapter machine. The client then transfers the document to its local machine. When a document is to be checked-in, the client transfers it to a directory on the adapter machine. The DMSSession object picks up the file from there and does the actual check-in to the document management system. The API allows the implementations to allocate separate check-in and check-out directories on per-user basis. However, the adapter can be implemented such that all the users do their check-in and check-out in the same directory.

Method Summary
`void` | `checkIn(java.lang.String path, int fileid)` Checks the file specified by the fileid into the directory specified by the path.
`void` | `checkInNew(java.lang.String fileName, java.lang.String destPath, boolean overwrite)` Checks in the new file.
`java.lang.String` | `checkOut(java.lang.String file, java.lang.String mode)` Returns the ID assigned to the checked-out file by the adapter.
`void` | `closeFile(int fileId, boolean save, boolean overWrite)` Closes an opened file.
`void` | `deleteFile(java.lang.String filePath)` Deletes a file.
`void` | `destroyUserDirectory(java.lang.String userid)` Deletes the read attachment and write attachment directories for an unsuccessful user logon.
`Entity[]` | `getDocuments(java.lang.String dirPath)` Returns an array of the EntityValue type that keeps the track of the name and type (file or directory) of the documents in the specified dirPath.
`java.lang.String` | `getReadDirectory()` Returns the read attachment path for the user.
`java.lang.String[]` | `getRootDirectories()` Returns the root directories to start with.
`java.lang.String` | `getWriteDirectory()` Returns the write attachment path for the user.
`void` | `lock(java.lang.String filePath)` Locks a file.
`int` | `openForReading(java.lang.String file, int sizeInK)` Opens a file for reading and returns a fileId, which can be used as parameter in other methods to identify the file.
`int` | `openForWritting(java.lang.String file, int sizeInK, boolean overWrite)` Opens a file for writing and returns a fileId, which can be used as parameter in other methods to identify the file.
`byte[]` | `readFile(int fileId)` Reads a file while opened.
`void` | `unLock(java.lang.String filePath)` Unlocks a file.
`void` | `writeToFile(int fileId, byte[] data, int sizeInk)` Writes a file while opened.

Method Detail

### getDocuments

    public Entity[] getDocuments(java.lang.String dirPath)
                          throws java.rmi.RemoteException,
                                 DmsOperationFailed

  Returns an array of the EntityValue type that keeps the track of the name and type (file or directory) of the documents in the specified dirPath.

  Parameters:
    `dirPath` - The path to the documents to be get.
  Returns:
    An array of Entities, containing name and type of the documents.
  Throws:
    `DmsOperationFailed`
    `java.rmi.RemoteException`

### checkOut

    public java.lang.String checkOut(java.lang.String file,
                                     java.lang.String mode)
                              throws java.rmi.RemoteException,
                                     DmsOperationFailed

  Returns the ID assigned to the checked-out file by the adapter. This is used later. Checks out the specified file for read or write from the document management system. A copy of that file is then placed in the appropriate directory for the client to download. This could be the readAttachment or the writeAttachment directory depending on the mode.

  Parameters:
    `file` - The file to be checked-out.
    `mode` - The checkout mode. If mode is `read`, the file goes to the readAttachment directory. If mode is `write`, the file goes to the writeAttachment directory.
  Returns:
    The ID assigned to the checked-out file.
  Throws:
    `DmsOperationFailed`
    `java.rmi.RemoteException`

### checkIn

    public void checkIn(java.lang.String path,
                        int fileid)
                 throws java.rmi.RemoteException,
                        DmsOperationFailed

  Checks the file specified by the fileid into the directory specified by the path. The fileid is the return value of the method, that has been used to open the file.

  Parameters:
    `path` - The path to which the file is to be checked in.
    `fileid` - The ID of the file to be checked in.
  Throws:
    `DmsOperationFailed`
    `java.rmi.RemoteException`
  See Also:
    `openForReading(String, int)`, `openForWritting(String, int, boolean)`

### getReadDirectory

    public java.lang.String getReadDirectory()
                                      throws java.rmi.RemoteException,
                                             DmsOperationFailed

  Returns the read attachment path for the user.

  Returns:
    The path to the read attachment.
  Throws:
    `DmsOperationFailed`
    `java.rmi.RemoteException`

### getWriteDirectory

    public java.lang.String getWriteDirectory()
                                       throws java.rmi.RemoteException,
                                              DmsOperationFailed

  Returns the write attachment path for the user.

  Returns:
    The path to the write attachment.
  Throws:
    `DmsOperationFailed`
    `java.rmi.RemoteException`

### checkInNew

    public void checkInNew(java.lang.String fileName,
                           java.lang.String destPath,
                           boolean overwrite)
                    throws java.rmi.RemoteException,
                           DmsOperationFailed

  Checks in the new file. Copies the file from the write attachment directory to the specified destination path. The overwrite parameter is used to allow the method to overwrite an eventually existing old file or to keep the old file.

  Parameters:
    `fileName` - The name of the file to be checked in.
    `destPath` - The path to the directory into which the file is to be checked in.
    `overwrite` - `true` to allow the method to overwrite the old file, `false` to keep the old file.
  Throws:
    `DmsOperationFailed`
    `java.rmi.RemoteException`

### getRootDirectories

    public java.lang.String[] getRootDirectories()
                                          throws java.rmi.RemoteException,
                                                 DmsOperationFailed

  Returns the root directories to start with.

  Returns:
    An array of strings containing the root directories.
  Throws:
    `DmsOperationFailed`
    `java.rmi.RemoteException`

### destroyUserDirectory

    public void destroyUserDirectory(java.lang.String userid)
                              throws java.rmi.RemoteException,
                                     DmsOperationFailed

  Deletes the read attachment and write attachment directories for an unsuccessful user logon. The names of the directories and paths are read from the ini file.

  Parameters:
    `userid` - The ID of the user session for which the readAttachment and writeAttachment directories are to be deleted.
  Throws:
    `DmsOperationFailed`
    `java.rmi.RemoteException`

### deleteFile

    public void deleteFile(java.lang.String filePath)
                    throws java.rmi.RemoteException,
                           DmsOperationFailed

  Deletes a file.

  Parameters:
    `filePath` - A fully qualified path to the file to be deleted. (The file should be in the DMSRoot)
  Throws:
    `DmsOperationFailed`
    `java.rmi.RemoteException`

### openForReading

    public int openForReading(java.lang.String file,
                              int sizeInK)
                       throws java.rmi.RemoteException,
                              DmsOperationFailed

  Opens a file for reading and returns a fileId, which can be used as parameter in other methods to identify the file.

  Parameters:
    `file` - The fully qualified path to the file.
    `sizeInK` - The size in kb to read from the file in a chunk.
  Returns:
    The fileId of the opened file.
  Throws:
    `DmsOperationFailed`
    `java.rmi.RemoteException`

### openForWritting

    public int openForWritting(java.lang.String file,
                               int sizeInK,
                               boolean overWrite)
                        throws java.rmi.RemoteException,
                               DmsOperationFailed

  Opens a file for writing and returns a fileId, which can be used as parameter in other methods to identify the file. It will try to acquire a lock.

  Parameters:
    `file` - The fully qualified path to the file.
    `sizeInK` - The size in kb to write into the file in a chunk.
    `overWrite` - `true` for allowing the method to overwrite the file, `false` to keep the old file.
  Returns:
    The fileId of the opened file.
  Throws:
    `DmsOperationFailed`
    `java.rmi.RemoteException`

### readFile

    public byte[] readFile(int fileId)
                    throws java.rmi.RemoteException,
                           DmsOperationFailed

  Reads a file while opened. Therefore the file has to be opened before. The method which opens the file returns a fileId, which has to be used as parameter in this method.

  Parameters:
    `fileId` - The ID of the file to be read.
  Returns:
    The data of the file as byte[].
  Throws:
    `DmsOperationFailed`
    `java.rmi.RemoteException`
  See Also:
    `openForReading(String, int)`, `openForWritting(String, int, boolean)`

### writeToFile

    public void writeToFile(int fileId,
                            byte[] data,
                            int sizeInk)
                     throws java.rmi.RemoteException,
                            DmsOperationFailed

  Writes a file while opened. Therefore the file has to be opened before. The method which opens the file returns a fileID, which has to be used as parameter in this method.

  Parameters:
    `fileId` - The ID of the file to be written.
    `data` - Actual data to be written into the file.
    `sizeInk` - The size of the data in kb.
  Throws:
    `DmsOperationFailed`
    `java.rmi.RemoteException`
  See Also:
    `openForReading(String, int)`, `openForWritting(String, int, boolean)`

### closeFile

    public void closeFile(int fileId,
                          boolean save,
                          boolean overWrite)
                   throws java.rmi.RemoteException,
                          DmsOperationFailed

  Closes an opened file. Therefore the file has to be opened before. The method, which opens the file returns a fileId, which has to be used as parameter in this method.

  Parameters:
    `fileId` - The ID of the file to be closed.
    `save` - `true` for saving the changes, `false` otherwise. This value will be ignored if the file is opened for reading.
    `overWrite` - `true` to allow the method to overwrite the file, `false` for keeping the old file. This value will be ignored if the file is opened for reading.
  Throws:
    `java.rmi.RemoteException`
    `DmsOperationFailed`
  See Also:
    `openForReading(String, int)`, `openForWritting(String, int, boolean)`

### lock

    public void lock(java.lang.String filePath)
              throws java.rmi.RemoteException,
                     DmsOperationFailed

  Locks a file.

  Parameters:
    `filePath` - The fully qualified path to the file.
  Throws:
    `DmsOperationFailed`
    `java.rmi.RemoteException`

### unLock

    public void unLock(java.lang.String filePath)
                throws java.rmi.RemoteException,
                       DmsOperationFailed

  Unlocks a file.

  Parameters:
    `filePath` - The fully qualified path to the file.
  Throws:
    `DmsOperationFailed`
    `java.rmi.RemoteException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD