ibspan.tss.dao
Class ProfileDAO

java.lang.Object
  extended by ibspan.tss.dao.ProfileDAO

public class ProfileDAO
extends Object

Data Access Object providing nice interface to model with user profiles. descriptions. It can be used to as work-around to access some OWL data, not accessible via Jastor-generated Java beans.

Author:
Maciej Gawinecki

Constructor Summary
ProfileDAO(Model mbaseProfilesDB)
          Constructs ProfileDAO object providing interface to the given model with user profiles.
ProfileDAO(OntModel mProfilesDB)
          Constructs ProfileDAO object providing interface to the given model with user profiles.
 
Method Summary
 Opinion getUserOpinionAbout(Integer userID, String concept)
          Returns opinion about the given opinion stated by the given user.
 UserProfile getUserProfile(int userID)
          Returns profile for the user with given ID.
 UserProfile getUserProfileByID(Integer userID)
          Returns profile for the user with given ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileDAO

public ProfileDAO(Model mbaseProfilesDB)
Constructs ProfileDAO object providing interface to the given model with user profiles. This construct can be used, when there is not direct access to ontology model with profile, but only to its base part, e.g. when we operate on Thing or Resource object.

Parameters:
mbaseProfilesDB - is a model with user profiles.
See Also:
Thing, Resource

ProfileDAO

public ProfileDAO(OntModel mProfilesDB)
Constructs ProfileDAO object providing interface to the given model with user profiles.

Parameters:
mProfilesDB - is a model with user profiles.
Method Detail

getUserProfile

public UserProfile getUserProfile(int userID)
                           throws UnknownUserProfileException
Returns profile for the user with given ID.

Parameters:
userID - is id of a user.
Returns:
user profile.
Throws:
UnknownUserProfileException - when profile for the given user cannot be found.

getUserOpinionAbout

public Opinion getUserOpinionAbout(Integer userID,
                                   String concept)
Returns opinion about the given opinion stated by the given user.

Parameters:
userID - is ID of a user.
concept - is concept objected by the opinion.
Returns:
returns opinion if exists; otherwise -- returns null.

getUserProfileByID

public UserProfile getUserProfileByID(Integer userID)
Returns profile for the user with given ID.

Parameters:
userID - is ID of a user
Returns:
user profile or null, when there is no profile for the given user ID.