Awake File v1.1

org.awakefw.file.api.server
Interface AwakeFileConfigurator

All Known Implementing Classes:
DefaultAwakeFileConfigurator

public interface AwakeFileConfigurator

Interface that defines the User Configuration for the Awake File Framework.

All the implemented methods will be called by the Awake Server programs when a client program asks for a file operation from the client, or when a client program asks for a RPC call of a Java.

A concrete implementation should be developed on the server side in order to:

Please note that Awake File comes with a Default AwakeFileConfigurator implementation that is *not* secured and should be extended: DefaultAwakeFileConfigurator.

Since:
1.0

Method Summary
 boolean allowCallAfterAnalysis(String username, Connection connection, String methodName, List<Object> params)
          Allows, for the passed client username, to define a specific piece of Java code to analyze the method name and it's parameter values before allowing or not it's execution.
 File getServerRoot()
          Allows to define the Awake File Server root directory for the file storage & access.
 void runIfCallRefused(String username, Connection connection, String ipAddress, String methodName, List<Object> params)
          Allows to implement specific a Java rule immediately after a call has been refused to a user and allowCallAfterAnalysis returned false.
 boolean useOneRootPerUsername()
          Allows to define if the Awake File Server must use a root directory per client username for the file storage & access.
 

Method Detail

allowCallAfterAnalysis

boolean allowCallAfterAnalysis(String username,
                               Connection connection,
                               String methodName,
                               List<Object> params)
                               throws IOException,
                                      SQLException
Allows, for the passed client username, to define a specific piece of Java code to analyze the method name and it's parameter values before allowing or not it's execution.
If the analysis defined by the method returns false, the the method call won't be executed.

Parameters:
username - the client username to check the rule for
connection - the SQL Connection as configured in AwakeCommonsConfigurator.getConnection() implementation. Will be null if getConnection() was no configured.
methodName - the full method name to call in the format org.acme.config.package.MyClass.myMethod
params - the list of parameters passed to the method. Empty list if none.
Returns:
true if the analyzed call is validated.

Throws:
IOException - if an IOException occurs
SQLException - if a SQLException occurs

getServerRoot

File getServerRoot()
Allows to define the Awake File Server root directory for the file storage & access.

Returns:
the path of the Server Root. null if there is no server root to define (adress of files will be absolute when uploading, downloading, etc.)

runIfCallRefused

void runIfCallRefused(String username,
                      Connection connection,
                      String ipAddress,
                      String methodName,
                      List<Object> params)
                      throws IOException,
                             SQLException
Allows to implement specific a Java rule immediately after a call has been refused to a user and allowCallAfterAnalysis returned false.

Examples:

Parameters:
username - the client username
connection - the SQL Connection as configured in AwakeCommonsConfigurator.getConnection() implementation. Will be null if getConnection() was no configured.
ipAddress - the IP address of the client user
methodName - the full method name to call in the format org.acme.config.package.MyClass.myMethod
params - the list of parameters passed to the method

Throws:
IOException - if an IOException occurs
SQLException - if a SQLException occurs

useOneRootPerUsername

boolean useOneRootPerUsername()
Allows to define if the Awake File Server must use a root directory per client username for the file storage & access.
If true, the name of the username will be used as root directory per user.

Returns:
true if there is one root directory per client username

Awake File v1.1

Copyright © 2012 Kawan Softwares SAS