Examples of DBUpdateHandler


Examples of org.milowski.db.DBUpdateHandler

      if (roles.contains(role)) {
         return true;
      }
      DBConnection connection = db.getConnection();
      try {
         connection.update(AuthDB.CREATE_GROUP_ROLE, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1,id);
               s.setInt(2,role.getId());
View Full Code Here

Examples of org.milowski.db.DBUpdateHandler

   public boolean removeRole(final Role role)
      throws SQLException
   {
      DBConnection connection = db.getConnection();
      try {
         return connection.update(AuthDB.DELETE_GROUP_ROLE, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1,id);
               s.setInt(2,role.getId());
View Full Code Here

Examples of org.milowski.db.DBUpdateHandler

   public void addMember(final RealmUser user)
      throws SQLException
   {
      DBConnection connection = db.getConnection();
      try {
         connection.update(AuthDB.CREATE_GROUP_MEMBER, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1,id);
               s.setInt(2,user.getId());
View Full Code Here

Examples of org.milowski.db.DBUpdateHandler

   public boolean removeMember(final RealmUser user)
      throws SQLException
   {
      DBConnection connection = db.getConnection();
      try {
         return connection.update(AuthDB.DELETE_GROUP_MEMBER, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setInt(1,id);
               s.setInt(2,user.getId());
View Full Code Here

Examples of org.milowski.db.DBUpdateHandler

      if (this.alias==null) {
         // Only set the realm user's alias if the alias is not null
         if (alias!=null) {
            DBConnection connection = db.getConnection();
            try {
               connection.update(AuthDB.CREATE_REALM_USER_ALIAS, new DBUpdateHandler() {
                  public void prepare(PreparedStatement s)
                     throws SQLException
                  {
                     s.setInt(1,id);
                     s.setString(2,alias);
                     s.setString(3,id+"-"+alias);
                  }
               });
            } finally {
               db.release(connection);
            }
         }
      } else {
         if (alias!=null) {
            // just update
            DBConnection connection = db.getConnection();
            try {
               connection.update(AuthDB.UPDATE_REALM_USER_ALIAS, new DBUpdateHandler() {
                  public void prepare(PreparedStatement s)
                     throws SQLException
                  {
                     s.setString(1,alias);
                     s.setString(2,id+"-"+alias);
View Full Code Here

Examples of org.milowski.db.DBUpdateHandler

         name = null;
      }
      final String theName = name;
      DBConnection connection = db.getConnection();
      try {
         connection.update(AuthDB.CHANGE_REALM_USER_NAME, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               if (theName==null) {
                  s.setNull(1,Types.VARCHAR);
View Full Code Here

Examples of org.milowski.db.DBUpdateHandler

         email = null;
      }
      final String theEmail = email;
      DBConnection connection = db.getConnection();
      try {
         connection.update(AuthDB.CHANGE_REALM_USER_EMAIL, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               if (theEmail==null) {
                  s.setNull(1,Types.VARCHAR);
View Full Code Here

Examples of org.milowski.db.DBUpdateHandler

      throws SQLException
   {
     
      DBConnection connection = getConnection();
      try {
         int id = connection.create(CREATE_PERMISSION,LAST_ID_FROM_PERMISSIONS, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setString(1,name);
               s.setString(2,uuid.toString());
View Full Code Here

Examples of org.milowski.db.DBUpdateHandler

   public Role createRole(final String name,final UUID uuid)
      throws SQLException
   {
      DBConnection connection = getConnection();
      try {
         int id = connection.create(CREATE_ROLE,LAST_ID_FROM_ROLES, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setString(1,name);
               s.setString(2,uuid.toString());
View Full Code Here

Examples of org.milowski.db.DBUpdateHandler

   public Realm createRealm(final String name,final UUID uuid)
      throws SQLException
   {
      DBConnection connection = getConnection();
      try {
         int id = connection.create(CREATE_REALM,LAST_ID_FROM_REALMS, new DBUpdateHandler() {
            public void prepare(PreparedStatement s)
               throws SQLException
            {
               s.setString(1,name);
               s.setString(2,uuid.toString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.