org.opentox.pol.mysql
Class MySQL

Package class diagram package MySQL
java.lang.Object
  extended by org.opentox.pol.mysql.MySQL

public class MySQL
extends Object


Constructor Summary
MySQL()
           
 
Method Summary
 void add(String pol, String user, String res)
           
 void close()
           
 void delete_pol(String pol)
           
protected  Connection getConnection(String user, String pw)
           
 String getDbUser(String id)
           
 String getPoliciesByUser(String token_user)
          get all policies owned by token user
 String getUriOwner(String uri, String polnames)
           
 void open()
           
 boolean search_pol_name(String pol)
           
 List<String> search_pol(String pol)
          Retrieve policyid, user, and resource , given a policy id
 String[] search_res_pol(String res)
          get user who created res and all policy names associated with it
 String[] search_res(String res)
          Retrieves resource owner (user name), given by resource URI
 String search_user_by_pol(String pol)
           
 String search_users_pols(String user)
          Retrieves policy ids, given user name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySQL

public MySQL()
Method Detail

open

public void open()
          throws DbException,
                 RestException
Throws:
DbException
RestException

getConnection

protected Connection getConnection(String user,
                                   String pw)
                            throws Exception
Throws:
Exception

close

public void close()

add

public void add(String pol,
                String user,
                String res)
         throws DbException
Throws:
DbException

delete_pol

public void delete_pol(String pol)
                throws DbException
Throws:
DbException

search_user_by_pol

public String search_user_by_pol(String pol)
                          throws DbException
Throws:
DbException

search_pol_name

public boolean search_pol_name(String pol)
                        throws DbException
Throws:
DbException

search_pol

public List<String> search_pol(String pol)
                        throws Exception
Retrieve policyid, user, and resource , given a policy id

Parameters:
pol -
Returns:
Throws:
Exception

search_users_pols

public String search_users_pols(String user)
                         throws DbException
Retrieves policy ids, given user name. Strings delimited by \n

Parameters:
user -
Returns:
Throws:
DbException

search_res

public String[] search_res(String res)
                    throws DbException
Retrieves resource owner (user name), given by resource URI

Parameters:
res -
Returns:
Throws:
DbException

search_res_pol

public String[] search_res_pol(String res)
                        throws DbException
get user who created res and all policy names associated with it

Throws:
DbException

getDbUser

public String getDbUser(String id)
                 throws DbException
Parameters:
id - policy id
Returns:
username of the owner
Throws:
Exception
DbException

getUriOwner

public String getUriOwner(String uri,
                          String polnames)
                   throws DbException
Throws:
DbException

getPoliciesByUser

public String getPoliciesByUser(String token_user)
                         throws DbException
get all policies owned by token user

Parameters:
token_user -
Returns:
Throws:
DbException


Copyright © 2010-2011 OpenTox project. All Rights Reserved.