Getting started with e!DAL system

This code example show how to connect to the e!DAL system and how to get the root directory. You need an ImplementationProvider object, that provides a back end implementation and a Subject to authenticate the user. Furthermore it is necessary to define a list of classes which implement the Principal interface.

public class TestClass {

	public static void main(final String[] args) throws Exception {

		/* 
		* construct a configuration class, 
		* it comprise all necessary parameter (ports, paths, logins etc.)
		* standard constructor try to guess defaults 
		*/
		 EdalConfiguration config = new EdalConfiguration("dataCiteUserName", "dataCitePassword", "dataCitePrefix", 
									new InternetAddress("scientificReviever@mail.de"), 
									new InternetAddress("substituteReviever@mail.de"),
									new InternetAddress("managingReviever@mail.de"), 
									new InternetAddress("root@mail.de"));

		/* authenticate user to get a Subject */
			Subject mySubject = HelperFunctions.authenticateWinOrUnixorMacUser();

		/* register back-end implementation */
			ImplementationProvider mountPoint = new FileSystemImplementationProvider(config);
			
		/* get the root directory using a specific implementation*/
			PrimaryDataDirectory rootDirectory = DataManager.getRootDirectory(mountpoint, mySubject);
		
		/* do something with the root directory */
			List<PrimaryDataEntity> list = rootDirectory.listPrimaryDataEntities();

		/* system shutdown */
			DataManager.shutdown();
	}
}