1 21 22 package org.apache.derby.impl.sql; 23 24 import org.apache.derby.iapi.services.property.PropertySetCallback; 25 import org.apache.derby.iapi.services.property.PropertyUtil; 26 import org.apache.derby.iapi.reference.Property; 27 import org.apache.derby.iapi.reference.SQLState; 28 import org.apache.derby.iapi.services.daemon.Serviceable; 29 import org.apache.derby.iapi.services.sanity.SanityManager; 30 import org.apache.derby.iapi.services.context.ContextService; 31 import org.apache.derby.iapi.error.StandardException; 32 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext; 33 import org.apache.derby.iapi.store.access.TransactionController; 34 import java.io.Serializable ; 35 import java.util.Dictionary ; 36 37 40 public class LanguageDbPropertySetter implements PropertySetCallback 41 { 42 public void init(boolean dbOnly, Dictionary p) { 43 } 45 46 public boolean validate 47 ( 48 String key, 49 Serializable value, 50 Dictionary p 51 ) throws StandardException 52 { 53 if (key.trim().equals(Property.SQL_AUTHORIZATION_PROPERTY)) 56 { 57 LanguageConnectionContext lcc = (LanguageConnectionContext) 58 ContextService.getContext(LanguageConnectionContext.CONTEXT_ID); 59 60 if (lcc.usesSqlAuthorization() && !Boolean.valueOf((String )value).booleanValue()) 61 throw StandardException.newException(SQLState.PROPERTY_UNSUPPORTED_CHANGE, 62 key, value); 63 } 64 65 if (key.equals(Property.LANGUAGE_STALE_PLAN_CHECK_INTERVAL)) { 66 PropertyUtil.intPropertyValue( 67 Property.LANGUAGE_STALE_PLAN_CHECK_INTERVAL, 68 value, 69 Property.MIN_LANGUAGE_STALE_PLAN_CHECK_INTERVAL, 70 Integer.MAX_VALUE, 71 Property.DEFAULT_LANGUAGE_STALE_PLAN_CHECK_INTERVAL 72 ); 73 return true; 74 } 75 76 return false; 77 } 78 79 public Serviceable apply 80 ( 81 String key, 82 Serializable value, 83 Dictionary p 84 ) 85 { 86 return null; 87 } 88 89 public Serializable map 90 ( 91 String key, 92 Serializable value, 93 Dictionary p 94 ) 95 { 96 return null; 97 } 98 } 99 | Popular Tags |