MUM.profileService.server
Class ProfileRepositoryFile

java.lang.Object
  extended byMUM.profileService.server.ProfileRepositoryFile
All Implemented Interfaces:
IProfileRepository

public class ProfileRepositoryFile
extends java.lang.Object
implements IProfileRepository

This is the implementation of a Profile Repository. Here the repository is a simple file.


Constructor Summary
ProfileRepositoryFile(java.lang.String absoluteFileName, java.io.PrintStream out)
          This is the constructor.
 
Method Summary
 boolean eliminateProfile(java.lang.String userIdentifier)
          This method eliminate an entry in the DB
 IProfile getProfile(java.lang.String identifier)
          This method returns a factory for the desired interface
 void insertProfile(IProfile profile)
          This method introduce a new entry in the DB, only if it isn't already present.
 boolean modifyProfile(IProfile newProfile)
          This method modify an old profile, replacing it with a new profile passed as an argument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileRepositoryFile

public ProfileRepositoryFile(java.lang.String absoluteFileName,
                             java.io.PrintStream out)
                      throws java.io.FileNotFoundException,
                             java.io.IOException,
                             java.lang.ClassNotFoundException
This is the constructor. It accept the absolute name of a file used as DB

Method Detail

insertProfile

public void insertProfile(IProfile profile)
                   throws java.io.IOException
This method introduce a new entry in the DB, only if it isn't already present. The key for the DB is the identifier.

Specified by:
insertProfile in interface IProfileRepository
Parameters:
profile - the new presentation to insert in the DB
Throws:
java.io.IOException

modifyProfile

public boolean modifyProfile(IProfile newProfile)
                      throws java.io.IOException
This method modify an old profile, replacing it with a new profile passed as an argument

Specified by:
modifyProfile in interface IProfileRepository
Parameters:
newProfile - the new profile
Returns:
false if the old profile wasn't present in the DB
Throws:
java.io.IOException

eliminateProfile

public boolean eliminateProfile(java.lang.String userIdentifier)
                         throws java.io.IOException
This method eliminate an entry in the DB

Specified by:
eliminateProfile in interface IProfileRepository
Parameters:
userIdentifier - the identifier of the profile to eliminate from the DB
Returns:
false if the entry is not present
Throws:
java.io.IOException

getProfile

public IProfile getProfile(java.lang.String identifier)
This method returns a factory for the desired interface

Specified by:
getProfile in interface IProfileRepository
Returns:
the list of the available Profiles, or null if there is none available presentationProfile available for that presentation.


Copyright © 2004 Luca Foschini