org.apache.oodt.profile.handlers
Class DatabaseProfileManager

java.lang.Object
  extended by org.apache.oodt.profile.handlers.DatabaseProfileManager
All Implemented Interfaces:
ProfileHandler, ProfileManager

public abstract class DatabaseProfileManager
extends Object
implements ProfileManager

DatabaseProfileManager.java

Author:
Dan Crichton date: 11/10/2000 description: Map a profile into/out of a relational database

Constructor Summary
DatabaseProfileManager(Properties props)
          DatabaseProfileManager
DatabaseProfileManager(Properties props, Connection conn)
           
 
Method Summary
abstract  void add(Connection conn, Profile profile)
           
 void add(Profile profile)
          Add a profile into the set of profiles managed by this profile server.
 void addAll(Collection collection)
          Add all of the profiles in the given collection to the set managed by this server.
abstract  void addAll(Connection conn, Collection collection)
           
 void clear()
          Clear all profiles.
abstract  void clear(Connection conn)
           
 boolean contains(Profile profile)
          Tell if the given profile is managed by this server.
 boolean containsAll(Collection collection)
          Tell if the given collection of profiles are managed by this server.
abstract  List findProfiles(Connection conn, XMLQuery query)
           
 List findProfiles(XMLQuery query)
          findProfiles Returns a list of matching profiles
abstract  Profile get(Connection conn, String profID)
           
 Profile get(String profId)
          Get a profile.
 Collection getAll()
          Get all profiles.
abstract  List getProfiles(Connection conn)
          Dump profiles in the database.
 boolean isEmpty()
          Tell if the set of profiles managed by this server is empty.
 Iterator iterator()
          Iterate over the available profiles.
protected static Connection openConnection(Properties props)
           
abstract  boolean remove(Connection conn, String profId)
           
abstract  boolean remove(Connection conn, String profId, String version)
           
 boolean remove(String profId)
          Remove the profile with the given ID.
 boolean remove(String profId, String version)
          Remove the profile with the given ID.
abstract  void replace(Connection conn, Profile profile)
           
 void replace(Profile profile)
          Replace a profile into the set of profiles managed by this profile server.
 int size()
          Get the size of the set of profiles managed by this server.
abstract  int size(Connection conn)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.oodt.profile.handlers.ProfileHandler
getID
 

Constructor Detail

DatabaseProfileManager

public DatabaseProfileManager(Properties props)
                       throws SQLException,
                              Exception
DatabaseProfileManager

Throws:
SQLException
Exception

DatabaseProfileManager

public DatabaseProfileManager(Properties props,
                              Connection conn)
Method Detail

getProfiles

public abstract List getProfiles(Connection conn)
                          throws ProfileException
Dump profiles in the database. This returns a list containing the contents of the profiles.

Returns:
The profiles in the database, as a list.
Throws:
ProfileException - If an error occurs.

findProfiles

public List findProfiles(XMLQuery query)
                  throws DOMException,
                         ProfileException
findProfiles Returns a list of matching profiles

Specified by:
findProfiles in interface ProfileHandler
Parameters:
query - Search criteria.
Returns:
List of matching Profile objects.
Throws:
ProfileException - If any other error occurs.
DOMException

findProfiles

public abstract List findProfiles(Connection conn,
                                  XMLQuery query)
                           throws DOMException,
                                  ProfileException
Throws:
DOMException
ProfileException

add

public void add(Profile profile)
         throws ProfileException
Description copied from interface: ProfileManager
Add a profile into the set of profiles managed by this profile server.

Specified by:
add in interface ProfileManager
Parameters:
profile - The profile to add or replace.
Throws:
ProfileException - If any error occurs.

add

public abstract void add(Connection conn,
                         Profile profile)
                  throws ProfileException
Throws:
ProfileException

addAll

public void addAll(Collection collection)
            throws ProfileException
Description copied from interface: ProfileManager
Add all of the profiles in the given collection to the set managed by this server. Any profiles that already exist (as identified by their profile IDs) are replaced.

Specified by:
addAll in interface ProfileManager
Parameters:
collection - Collection of Profiles to add.
Throws:
ProfileException - If any error occurs.

addAll

public abstract void addAll(Connection conn,
                            Collection collection)
                     throws ProfileException
Throws:
ProfileException

clear

public abstract void clear(Connection conn)
                    throws ProfileException
Throws:
ProfileException

clear

public void clear()
           throws ProfileException
Description copied from interface: ProfileManager
Clear all profiles. This irrevocably removes all profiles from the server, leaving it with none.

Specified by:
clear in interface ProfileManager
Throws:
ProfileException - If any error occurs.

contains

public boolean contains(Profile profile)
                 throws ProfileException
Description copied from interface: ProfileManager
Tell if the given profile is managed by this server.

Specified by:
contains in interface ProfileManager
Parameters:
profile - The profile to check.
Returns:
True if profile is present in the server, false otherwise.
Throws:
ProfileException - If any error occurs.

containsAll

public boolean containsAll(Collection collection)
                    throws ProfileException
Description copied from interface: ProfileManager
Tell if the given collection of profiles are managed by this server.

Specified by:
containsAll in interface ProfileManager
Parameters:
collection - The collection of Profiles to check.
Returns:
True if every Profile in collection are present in the server, false otherwise.
Throws:
ProfileException - If any error occurs.

get

public abstract Profile get(Connection conn,
                            String profID)
                     throws ProfileException
Throws:
ProfileException

get

public Profile get(String profId)
            throws ProfileException
Description copied from interface: ProfileHandler
Get a profile.

Specified by:
get in interface ProfileHandler
Parameters:
profId - ID of the profile to get.
Returns:
The profile with the given profID, or null if it's not found.
Throws:
ProfileException - If any error occurs.

getAll

public Collection getAll()
                  throws ProfileException
Description copied from interface: ProfileManager
Get all profiles.

Specified by:
getAll in interface ProfileManager
Returns:
A collection of profiles
Throws:
ProfileException - If any error occurs.

isEmpty

public boolean isEmpty()
                throws ProfileException
Description copied from interface: ProfileManager
Tell if the set of profiles managed by this server is empty.

Specified by:
isEmpty in interface ProfileManager
Returns:
True if there are no profiles in this server.
Throws:
ProfileException - If any error occurs.

iterator

public Iterator iterator()
                  throws ProfileException
Description copied from interface: ProfileManager
Iterate over the available profiles. Each call to next yields a copy of the next Profile object managed by this server. Updates to profile objects are not backed by the server; make your updates and then call ProfileManager.add(org.apache.oodt.profile.Profile).

Specified by:
iterator in interface ProfileManager
Returns:
An iterator over Profiles.
Throws:
ProfileException - If any error occurs.

remove

public abstract boolean remove(Connection conn,
                               String profId,
                               String version)
                        throws ProfileException
Throws:
ProfileException

remove

public abstract boolean remove(Connection conn,
                               String profId)
                        throws ProfileException
Throws:
ProfileException

remove

public boolean remove(String profId,
                      String version)
               throws ProfileException
Description copied from interface: ProfileManager
Remove the profile with the given ID. This removes forever the given profile from the set of profiles managed by this server.

Specified by:
remove in interface ProfileManager
Parameters:
profId - What profile to remove.
version - What version of the the profile identified by profID to remove.
Returns:
True if thie profile was actually present and removed; false if it wasn't present.
Throws:
ProfileException - If any error occurs.

remove

public boolean remove(String profId)
               throws ProfileException
Description copied from interface: ProfileManager
Remove the profile with the given ID. This removes forever the given profile from the set of profiles managed by this server.

Specified by:
remove in interface ProfileManager
Parameters:
profId - ID of profile to remove.
Returns:
True if thie profile was actually present and removed; false if it wasn't present.
Throws:
ProfileException - If any error occurs.

size

public int size()
         throws ProfileException
Description copied from interface: ProfileManager
Get the size of the set of profiles managed by this server.

Specified by:
size in interface ProfileManager
Returns:
The number of available profiles.
Throws:
ProfileException - If any error occurs.

size

public abstract int size(Connection conn)
                  throws ProfileException
Throws:
ProfileException

replace

public void replace(Profile profile)
             throws ProfileException
Description copied from interface: ProfileManager
Replace a profile into the set of profiles managed by this profile server.

Specified by:
replace in interface ProfileManager
Parameters:
profile - The profile to add or replace.
Throws:
ProfileException - If any error occurs.

replace

public abstract void replace(Connection conn,
                             Profile profile)
                      throws ProfileException
Throws:
ProfileException

openConnection

protected static Connection openConnection(Properties props)
                                    throws SQLException,
                                           ProfileException
Throws:
SQLException
ProfileException


Copyright © 1999-2013
Apache OODT. All Rights Reserved.