Skip to end of metadata
Go to start of metadata

The Session Interface gives us the option to specify additional properties for an Adapter Datastore, in our case the Directory only. We do not require any login/logout upon session start/stop, nothing.

So the class is very simple in our case

package com.acta.adapter.sf;


import java.io.File;

import com.acta.adapter.sdk.Adapter;
import com.acta.adapter.sdk.AdapterEnvironment;
import com.acta.adapter.sdk.AdapterException;
import com.acta.adapter.sdk.Session;


public class SFSession implements Session {
    private String directory ;


    public void setDirectory(String dir) {
        if (dir != null && dir.endsWith(File.separator)) {
            directory = dir;
        } else {
            directory = dir + File.separator;
        }
    }

    public String getDirectory() {
        return directory ;
    }


    public void initialize(Adapter adapter, AdapterEnvironment environment) {
    }

    public void start() throws AdapterException {
    }

    public void stop() throws AdapterException {
    }

}

All you can do is setting a directory, in case it has no trailing "/" or whatever the path separater is, we add that. Therefore in all cases we need to access the file we just concatenate the Session Directory with the filename.

The parameters defined here will be shown in the datastore

 

 

  • No labels