roughing out more of the conference implementation, including more dynamic

object work down in the base Dynamo framework
This commit is contained in:
Eric J. Bowersox 2003-06-26 08:56:42 +00:00
parent eecc26baf0
commit 5f2ae502b0
17 changed files with 1486 additions and 15 deletions

View File

@ -65,6 +65,7 @@
<install connection="install"/>
<config-db>
<item ns="http://www.silverwrist.com/NS/dynamo/2002/12/07/dynamo.objects" name="security">srm</item>
<item ns="http://www.silverwrist.com/NS/dynamo/2002/12/08/database.connections" name="main">data</item>
</config-db>
</object>

View File

@ -65,6 +65,7 @@
<install connection="install"/>
<config-db>
<item ns="http://www.silverwrist.com/NS/dynamo/2002/12/07/dynamo.objects" name="security">srm</item>
<item ns="http://www.silverwrist.com/NS/dynamo/2002/12/08/database.connections" name="main">data</item>
</config-db>
</object>

View File

@ -0,0 +1,264 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.conf.impl;
import java.security.acl.*;
import java.util.*;
import com.silverwrist.dynamo.iface.*;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.venice.conf.iface.*;
import com.silverwrist.venice.conf.obj.*;
class ConferenceImpl implements VeniceConference
{
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
*/
private DynamicImplConference m_dobj;
private ConferenceOps m_ops;
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
ConferenceImpl(ConferenceOps ops)
{
m_dobj = new DynamicImplConference(this);
m_ops = ops;
} // end constructor
/*--------------------------------------------------------------------------------
* Implementations from interface DynamicObject
*--------------------------------------------------------------------------------
*/
public Object get(String property_name) throws DynamicObjectException
{
return m_dobj.get(property_name);
} // end get
public void set(String property_name, Object value) throws DynamicObjectException
{
m_dobj.set(property_name,value);
} // end set
public Object call(String method_name, Object[] parameters) throws DynamicObjectException
{
return m_dobj.call(method_name,parameters);
} // end call
public Object call(String method_name, List parameters) throws DynamicObjectException
{
return m_dobj.call(method_name,parameters);
} // end call
public DynamicClass getDClass()
{
return m_dobj.getDClass();
} // end getDClass
/*--------------------------------------------------------------------------------
* Implementations from interface NamedObject
*--------------------------------------------------------------------------------
*/
/**
* Returns the name of this object.
*
* @return The name of this object.
*/
public String getName()
{
return null; // TEMP
}
/*--------------------------------------------------------------------------------
* Implementations from interface ObjectProvider
*--------------------------------------------------------------------------------
*/
/**
* Retrieves an object from this <CODE>ObjectProvider</CODE>.
*
* @param namespace The namespace to interpret the name relative to.
* @param name The name of the object to be retrieved.
* @return The object reference specified.
*/
public Object getObject(String namespace, String name)
{
return null; // TEMP
}
/*--------------------------------------------------------------------------------
* Implementations from interface SecureObjectStore
*--------------------------------------------------------------------------------
*/
/**
* Sets an object into this <CODE>SecureObjectStore</CODE>.
*
* @param caller The user performing the operation.
* @param namespace The namespace to interpret the name relative to.
* @param name The name of the object to be set.
* @param value The object to set into the <CODE>SecureObjectStore</CODE>.
* @return The previous object that was set into the <CODE>SecureObjectStore</CODE> under this namespace and name, or
* <CODE>null</CODE> if there was no such object.
* @exception com.silverwrist.dynamo.except.DatabaseException If there was an error setting the object value.
* @exception com.silverwrist.dynamo.except.DynamoSecurityException If the specified user is not permitted to
* set this object value into this <CODE>SecureObjectStore</CODE>.
*/
public Object setObject(DynamoUser caller, String namespace, String name, Object value)
throws DatabaseException, DynamoSecurityException
{
return null; // TEMP
}
/**
* Removes an object from this <CODE>SecureObjectStore</CODE>.
*
* @param caller The user performing the operation.
* @param namespace The namespace to interpret the name relative to.
* @param name The name of the object to be removed.
* @return The previous object that was set into the <CODE>SecureObjectStore</CODE> under this namespace and name, or
* <CODE>null</CODE> if there was no such object.
* @exception com.silverwrist.dynamo.except.DatabaseException If there was an error removing the object value.
* @exception com.silverwrist.dynamo.except.DynamoSecurityException If the specified user is not permitted to
* remove this object value from this <CODE>SecureObjectStore</CODE>.
*/
public Object removeObject(DynamoUser caller, String namespace, String name)
throws DatabaseException, DynamoSecurityException
{
return null; // TEMP
}
/**
* Returns a collection of all object namespaces that have been set into this <CODE>SecureObjectStore</CODE>.
*
* @return A {@link java.util.Collection Collection} containing {@link java.lang.String String} objects specifying
* all the object namespaces.
* @exception com.silverwrist.dynamo.except.DatabaseException If there was an error getting the namespace list.
*/
public Collection getNamespaces() throws DatabaseException
{
return null; // TEMP
}
/**
* Returns a collection of all object names that have been set into this <CODE>SecureObjectStore</CODE> under
* a given namespace.
*
* @param namespace The namespace to look for names under.
* @return A {@link java.util.Collection Collection} containing {@link java.lang.String String} objects
* specifying all the object names for this namespace.
* @exception com.silverwrist.dynamo.except.DatabaseException If there was an error getting the object name list.
*/
public Collection getNamesForNamespace(String namespace) throws DatabaseException
{
return null; // TEMP
}
/*--------------------------------------------------------------------------------
* Implementations from interface VeniceConference
*--------------------------------------------------------------------------------
*/
public int getConfID()
{
return -1; // TEMP
}
public void setName(DynamoUser caller, String name) throws DatabaseException, DynamoSecurityException
{
}
public java.util.Date getCreatedDate()
{
return null; // TEMP
}
public java.util.Date getLastUpdateDate()
{
return null; // TEMP
}
public void setLastUpdateDate(DynamoUser caller, java.util.Date date)
throws DatabaseException, DynamoSecurityException
{
}
public int getHostsGID()
{
return -1; // TEMP
}
public DynamoGroup getHosts() throws DatabaseException
{
return null; // TEMP
}
public DynamoAcl getAcl() throws DatabaseException, AclNotFoundException
{
return null; // TEMP
}
public Set getAliases() throws DatabaseException
{
return null; // TEMP
}
public String getPrimaryAlias() throws DatabaseException
{
return null; // TEMP
}
public void setPrimaryAlias(DynamoUser caller, String alias) throws DatabaseException, DynamoSecurityException
{
}
public void addAlias(DynamoUser caller, String alias) throws DatabaseException, DynamoSecurityException
{
}
public void removeAlias(DynamoUser caller, String alias) throws DatabaseException, DynamoSecurityException
{
}
} // end class ConferenceImpl

View File

@ -33,17 +33,28 @@ public class ConferenceManager implements ConferenceAccessObject
private DynamicImplConferenceAccess m_dobj;
private UseCount m_uc;
private ConferenceManagerOps m_ops;
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
public ConferenceManager(UseCount uc)
public ConferenceManager(UseCount uc, DBConnectionPool pool) throws ModuleException
{
m_dobj = new DynamicImplConferenceAccess(this);
m_uc = uc;
uc.incrementUseCount();
try
{ // initialize everything
m_dobj = new DynamicImplConferenceAccess(this);
m_uc = uc;
uc.incrementUseCount();
m_ops = ConferenceManagerOps.get(pool);
} // end try
catch (ConfigException e)
{ // convert it to a ModuleException
throw new ModuleException(e);
} // end catch
} // end constructor
@ -112,7 +123,10 @@ public class ConferenceManager implements ConferenceAccessObject
public void dispose()
{
m_ops.dispose();
m_ops = null;
m_uc.decrementUseCount();
m_uc = null;
} // end dispose

View File

@ -0,0 +1,91 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.conf.impl;
import java.util.*;
import com.silverwrist.dynamo.db.OpsBase;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
abstract class ConferenceManagerOps extends OpsBase
{
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
*/
private ConferenceOps m_confops = null;
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
protected ConferenceManagerOps(DBConnectionPool pool)
{
super(pool);
} // end constructor
/*--------------------------------------------------------------------------------
* Overrides from class OpsBase
*--------------------------------------------------------------------------------
*/
public void dispose()
{
if (m_confops!=null)
m_confops.dispose();
m_confops = null;
super.dispose();
} // end dispose
/*--------------------------------------------------------------------------------
* Abstract operations
*--------------------------------------------------------------------------------
*/
protected abstract ConferenceOps createConferenceOps(DBConnectionPool pool);
/*--------------------------------------------------------------------------------
* External operations
*--------------------------------------------------------------------------------
*/
synchronized ConferenceOps getConferenceOps()
{
if (m_confops==null)
m_confops = createConferenceOps(getPool());
return m_confops;
} // end getConferenceOps
/*--------------------------------------------------------------------------------
* External static operations
*--------------------------------------------------------------------------------
*/
static ConferenceManagerOps get(DBConnectionPool pool) throws ConfigException
{
return (ConferenceManagerOps)get(pool,ConferenceManagerOps.class.getClassLoader(),
ConferenceManagerOps.class.getName() + "_","ConferenceManagerOps");
} // end get
} // end class ConferenceManagerOps

View File

@ -0,0 +1,51 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.conf.impl;
import java.sql.*;
import java.util.*;
import com.silverwrist.util.*;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
import com.silverwrist.dynamo.util.*;
public class ConferenceManagerOps_mysql extends ConferenceManagerOps
{
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
public ConferenceManagerOps_mysql(DBConnectionPool pool)
{
super(pool);
} // end constructor
/*--------------------------------------------------------------------------------
* Abstract implementations from class ConferenceManagerOps
*--------------------------------------------------------------------------------
*/
protected ConferenceOps createConferenceOps(DBConnectionPool pool)
{
return new ConferenceOps_mysql(pool);
} // end createConferenceOps
} // end class ConferenceManagerOps_mysql

View File

@ -0,0 +1,43 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.conf.impl;
import java.util.*;
import com.silverwrist.dynamo.db.OpsBase;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
abstract class ConferenceOps extends OpsBase
{
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
protected ConferenceOps(DBConnectionPool pool)
{
super(pool);
} // end constructor
/*--------------------------------------------------------------------------------
* Abstract operations
*--------------------------------------------------------------------------------
*/
} // end class ConferenceOps

View File

@ -0,0 +1,45 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.conf.impl;
import java.sql.*;
import java.util.*;
import com.silverwrist.util.*;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
import com.silverwrist.dynamo.util.*;
class ConferenceOps_mysql extends ConferenceOps
{
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
ConferenceOps_mysql(DBConnectionPool pool)
{
super(pool);
} // end constructor
/*--------------------------------------------------------------------------------
* Abstract implementations from class ConferenceOps
*--------------------------------------------------------------------------------
*/
} // end class ConferenceOps_mysql

View File

@ -59,6 +59,8 @@ public class ModuleMain implements ModuleFunctions, UseCount
private int m_usecount = 0;
private ModuleSite m_site = null;
private String m_srm_name = null;
private String m_database_name = null;
private DBConnectionPool m_pool = null;
private Controller m_controller = null;
private ConferenceManager m_mgr;
private ComponentShutdown m_res1;
@ -96,14 +98,34 @@ public class ModuleMain implements ModuleFunctions, UseCount
} // end getInstallScript
private synchronized final void loadSRMName(ServiceProvider sp)
private synchronized final void loadConfigData(ServiceProvider sp)
{
if (m_srm_name!=null)
return;
ModuleConfigurationData conf_data = (ModuleConfigurationData)(sp.queryService(ModuleConfigurationData.class));
m_srm_name = conf_data.getValue(Namespaces.DYNAMO_OBJECT_NAMESPACE,"security");
if (m_srm_name==null)
m_srm_name = conf_data.getValue(Namespaces.DYNAMO_OBJECT_NAMESPACE,"security");
if (m_database_name==null)
m_database_name = conf_data.getValue(Namespaces.DATABASE_CONNECTIONS_NAMESPACE,"main");
} // end loadSRMName
} // end loadConfigData
private synchronized final void loadConnectionPool(ServiceProvider services) throws ModuleException
{
try
{ // get the database pool
if (m_pool==null)
{ // get the object provider and the database pool
ObjectProvider op = (ObjectProvider)(services.queryService(ObjectProvider.class));
m_pool = GetObjectUtils.getDatabaseConnection(op,Namespaces.DATABASE_CONNECTIONS_NAMESPACE,m_database_name);
} // end if
} // end try
catch (ConfigException e)
{ // translate exception
throw new ModuleException(e);
} // end catch
} // end loadConnectionPool
/*--------------------------------------------------------------------------------
* Implementations from interface ModuleFunctions
@ -125,7 +147,8 @@ public class ModuleMain implements ModuleFunctions, UseCount
public void initialize(ModuleSite site, ServiceProvider services) throws ModuleException
{
loadSRMName(services);
loadConfigData(services);
loadConnectionPool(services);
m_site = site;
try
@ -154,6 +177,7 @@ public class ModuleMain implements ModuleFunctions, UseCount
m_controller = null;
m_mgr.dispose();
m_mgr = null;
m_pool = null;
m_usecount = 0;
} // end shutdown
@ -166,7 +190,7 @@ public class ModuleMain implements ModuleFunctions, UseCount
public boolean canInstall(ServiceProvider services, Principal installer)
{
loadSRMName(services);
loadConfigData(services);
try
{ // get the actual SRM, then get the global ACL, then test permissions
SecurityReferenceMonitor srm =
@ -187,11 +211,12 @@ public class ModuleMain implements ModuleFunctions, UseCount
public void install(ModuleSite site, ServiceProvider services, Principal installer, DynamoLog log)
throws ModuleException
{
loadSRMName(services);
loadConfigData(services);
loadConnectionPool(services);
synchronized (this)
{ // create Controller object if necessary
if (m_mgr==null)
m_mgr = new ConferenceManager(this);
m_mgr = new ConferenceManager(this,m_pool);
if (m_controller==null)
m_controller = new Controller(this,m_mgr,m_srm_name);
@ -251,7 +276,7 @@ public class ModuleMain implements ModuleFunctions, UseCount
public void uninstall(ModuleSite site, ServiceProvider services, Principal uninstaller, DynamoLog log)
throws ModuleException
{
loadSRMName(services);
loadConfigData(services);
try
{ // uninstall the community service
CommunityServiceInstall csi = (CommunityServiceInstall)(services.queryService(CommunityServiceInstall.class));
@ -306,7 +331,7 @@ public class ModuleMain implements ModuleFunctions, UseCount
synchronized (this)
{ // create it if necessary
if (m_mgr==null)
m_mgr = new ConferenceManager(this);
m_mgr = new ConferenceManager(this,m_pool);
if (m_controller==null)
m_controller = new Controller(this,m_mgr,m_srm_name);
return m_controller;

View File

@ -0,0 +1,51 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.conf.obj;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
import com.silverwrist.dynamo.obj.*;
import com.silverwrist.venice.conf.iface.*;
class DynamicClassConference extends DynamicClassImpl
{
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
DynamicClassConference()
{
super("Dynamic." + VeniceConference.class.getName());
} // end constructor
/*--------------------------------------------------------------------------------
* Overrides from class DynamicClassImpl
*--------------------------------------------------------------------------------
*/
public DynamicObject cast(Object source) throws ClassCastException
{
if (source instanceof VeniceConference)
return (DynamicObject)source;
return super.cast(source);
} // end cast
} // end class DynamicClassConference

View File

@ -0,0 +1,355 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.conf.obj;
import java.security.acl.*;
import java.util.*;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
import com.silverwrist.dynamo.obj.*;
import com.silverwrist.venice.iface.*;
import com.silverwrist.venice.conf.iface.*;
public class DynamicImplConference extends DynamicObjectImpl
{
/*--------------------------------------------------------------------------------
* Static data members
*--------------------------------------------------------------------------------
*/
private static DynamicClass s_baseclass = null;
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
*/
private VeniceConference m_impl;
private DynamicImplNamedObject m_namedobject;
private DynamicImplSecureObjectStore m_secstore;
/*--------------------------------------------------------------------------------
* Constructors
*--------------------------------------------------------------------------------
*/
public DynamicImplConference(VeniceConference impl, DynamicClass dclass)
{
super(dclass);
m_impl = impl;
m_namedobject = new DynamicImplNamedObject(impl);
m_secstore = new DynamicImplSecureObjectStore(impl);
} // end constructor
public DynamicImplConference(VeniceConference impl)
{
super(getBaseDClass());
m_impl = impl;
m_namedobject = new DynamicImplNamedObject(impl);
m_secstore = new DynamicImplSecureObjectStore(impl);
} // end constructor
/*--------------------------------------------------------------------------------
* Overrides from class DynamicObjectImpl
*--------------------------------------------------------------------------------
*/
public Object get(String property_name) throws DynamicObjectException
{
if (m_namedobject.canGet(property_name))
return m_namedobject.get(property_name);
if (property_name.equals("confID"))
return new Integer(m_impl.getConfID());
if (property_name.equals("createdDate"))
return m_impl.getCreatedDate();
if (property_name.equals("lastUpdateDate"))
return m_impl.getLastUpdateDate();
if (property_name.equals("hostsGID"))
return new Integer(m_impl.getHostsGID());
try
{ // protect these property gets within a try-catch to properly process exceptions
if (property_name.equals("hosts"))
return m_impl.getHosts();
if (property_name.equals("acl"))
return m_impl.getAcl();
if (property_name.equals("aliases"))
return m_impl.getAliases();
if (property_name.equals("primaryAlias"))
return m_impl.getPrimaryAlias();
} // end try
catch (DatabaseException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
catch (AclNotFoundException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
return super.get(property_name);
} // end get
public Object call(String method_name, Object[] parameters) throws DynamicObjectException
{
if (m_namedobject.canCall(method_name))
return m_namedobject.call(method_name,parameters);
if (m_secstore.canCall(method_name))
return m_secstore.call(method_name,parameters);
if (method_name.equals("getConfID"))
{ // verify parameters and call method
verifyParameterLength(method_name,parameters,0);
return new Integer(m_impl.getConfID());
} // end if
if (method_name.equals("setName"))
{ // verify parameters and call method
try
{ // make sure and catch exceptions
verifyParameterLength(method_name,parameters,2);
verifyParameterType(method_name,parameters,0,DynamoUser.class);
verifyParameterType(method_name,parameters,1,String.class);
m_impl.setName((DynamoUser)(parameters[0]),(String)(parameters[1]));
return null;
} // end try
catch (DatabaseException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
catch (DynamoSecurityException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
} // end if
if (method_name.equals("getCreatedDate"))
{ // verify parameters and call method
verifyParameterLength(method_name,parameters,0);
return m_impl.getCreatedDate();
} // end if
if (method_name.equals("getLastUpdateDate"))
{ // verify parameters and call method
verifyParameterLength(method_name,parameters,0);
return m_impl.getLastUpdateDate();
} // end if
if (method_name.equals("setLastUpdateDate"))
{ // verify parameters and call method
try
{ // make sure and catch exceptions
verifyParameterLength(method_name,parameters,2);
verifyParameterType(method_name,parameters,0,DynamoUser.class);
verifyParameterType(method_name,parameters,1,java.util.Date.class);
m_impl.setLastUpdateDate((DynamoUser)(parameters[0]),(java.util.Date)(parameters[1]));
return null;
} // end try
catch (DatabaseException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
catch (DynamoSecurityException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
} // end if
if (method_name.equals("getHostsGID"))
{ // verify parameters and call method
verifyParameterLength(method_name,parameters,0);
return new Integer(m_impl.getHostsGID());
} // end if
if (method_name.equals("getHosts"))
{ // verify parameters and call method
try
{ // make sure and catch exceptions
verifyParameterLength(method_name,parameters,0);
return m_impl.getHosts();
} // end try
catch (DatabaseException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
} // end if
if (method_name.equals("getAcl"))
{ // verify parameters and call method
try
{ // make sure and catch exceptions
verifyParameterLength(method_name,parameters,0);
return m_impl.getAcl();
} // end try
catch (DatabaseException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
catch (AclNotFoundException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
} // end if
if (method_name.equals("getAliases"))
{ // verify parameters and call method
try
{ // make sure and catch exceptions
verifyParameterLength(method_name,parameters,0);
return m_impl.getAliases();
} // end try
catch (DatabaseException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
} // end if
if (method_name.equals("getPrimaryAlias"))
{ // verify parameters and call method
try
{ // make sure and catch exceptions
verifyParameterLength(method_name,parameters,0);
return m_impl.getPrimaryAlias();
} // end try
catch (DatabaseException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
} // end if
if (method_name.equals("setPrimaryAlias"))
{ // verify parameters and call method
try
{ // make sure and catch exceptions
verifyParameterLength(method_name,parameters,2);
verifyParameterType(method_name,parameters,0,DynamoUser.class);
verifyParameterType(method_name,parameters,1,String.class);
m_impl.setPrimaryAlias((DynamoUser)(parameters[0]),(String)(parameters[1]));
return null;
} // end try
catch (DatabaseException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
catch (DynamoSecurityException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
} // end if
if (method_name.equals("addAlias"))
{ // verify parameters and call method
try
{ // make sure and catch exceptions
verifyParameterLength(method_name,parameters,2);
verifyParameterType(method_name,parameters,0,DynamoUser.class);
verifyParameterType(method_name,parameters,1,String.class);
m_impl.addAlias((DynamoUser)(parameters[0]),(String)(parameters[1]));
return null;
} // end try
catch (DatabaseException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
catch (DynamoSecurityException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
} // end if
if (method_name.equals("removeAlias"))
{ // verify parameters and call method
try
{ // make sure and catch exceptions
verifyParameterLength(method_name,parameters,2);
verifyParameterType(method_name,parameters,0,DynamoUser.class);
verifyParameterType(method_name,parameters,1,String.class);
m_impl.removeAlias((DynamoUser)(parameters[0]),(String)(parameters[1]));
return null;
} // end try
catch (DatabaseException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
catch (DynamoSecurityException e)
{ // catch and turn into a call failure
throw callFailed(e);
} // end catch
} // end if
return super.call(method_name,parameters);
} // end call
/*--------------------------------------------------------------------------------
* External static operations
*--------------------------------------------------------------------------------
*/
public static synchronized DynamicClass getBaseDClass()
{
if (s_baseclass==null)
s_baseclass = new DynamicClassConference();
return s_baseclass;
} // end getBaseDClass
} // end class DynamicImplConference

View File

@ -0,0 +1,36 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.dynamo.obj;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
class DynamicClassNamedObject extends DynamicClassImpl
{
/*--------------------------------------------------------------------------------
* Constructor
*--------------------------------------------------------------------------------
*/
DynamicClassNamedObject()
{
super("Dynamic." + NamedObject.class.getName());
} // end constructor
} // end class DynamicClassNamedObject

View File

@ -0,0 +1,42 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.dynamo.obj;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
class DynamicClassObjectProvider extends DynamicClassImpl
{
/*--------------------------------------------------------------------------------
* Constructors
*--------------------------------------------------------------------------------
*/
DynamicClassObjectProvider()
{
super("Dynamic." + ObjectProvider.class.getName());
} // end constructor
protected DynamicClassObjectProvider(String name)
{
super(name);
} // end constructor
} // end class DynamicClassObjectProvider

View File

@ -0,0 +1,42 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.dynamo.obj;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
class DynamicClassSecureObjectStore extends DynamicClassObjectProvider
{
/*--------------------------------------------------------------------------------
* Constructors
*--------------------------------------------------------------------------------
*/
DynamicClassSecureObjectStore()
{
super("Dynamic." + SecureObjectStore.class.getName());
} // end constructor
protected DynamicClassSecureObjectStore(String name)
{
super(name);
} // end constructor
} // end class DynamicClassSecureObjectStore

View File

@ -0,0 +1,115 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.dynamo.obj;
import java.util.*;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
public class DynamicImplNamedObject extends DynamicObjectImpl
{
/*--------------------------------------------------------------------------------
* Static data members
*--------------------------------------------------------------------------------
*/
private static DynamicClass s_baseclass = null;
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
*/
private NamedObject m_impl;
/*--------------------------------------------------------------------------------
* Constructors
*--------------------------------------------------------------------------------
*/
public DynamicImplNamedObject(NamedObject impl, DynamicClass dclass)
{
super(dclass);
m_impl = impl;
} // end constructor
public DynamicImplNamedObject(NamedObject impl)
{
super(getBaseDClass());
m_impl = impl;
} // end constructor
/*--------------------------------------------------------------------------------
* Overrides from class DynamicObjectImpl
*--------------------------------------------------------------------------------
*/
public Object get(String property_name) throws DynamicObjectException
{
if (property_name.equals("name"))
return m_impl.getName();
return super.get(property_name);
} // end get
public Object call(String method_name, Object[] parameters) throws DynamicObjectException
{
if (method_name.equals("getName"))
{ // verify parameter list and call implementation
verifyParameterLength(method_name,parameters,0);
return m_impl.getName();
} // end if
return super.call(method_name,parameters);
} // end call
/*--------------------------------------------------------------------------------
* External operations
*--------------------------------------------------------------------------------
*/
public boolean canGet(String property_name)
{
return property_name.equals("name");
} // end canGet
public boolean canCall(String method_name)
{
return method_name.equals("getName");
} // end canCall
/*--------------------------------------------------------------------------------
* External static operations
*--------------------------------------------------------------------------------
*/
public static synchronized DynamicClass getBaseDClass()
{
if (s_baseclass==null)
s_baseclass = new DynamicClassNamedObject();
return s_baseclass;
} // end getBaseDClass
} // end class DynamicImplNamedObject

View File

@ -0,0 +1,103 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.dynamo.obj;
import java.util.*;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
public class DynamicImplObjectProvider extends DynamicObjectImpl
{
/*--------------------------------------------------------------------------------
* Static data members
*--------------------------------------------------------------------------------
*/
private static DynamicClass s_baseclass = null;
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
*/
private ObjectProvider m_impl;
/*--------------------------------------------------------------------------------
* Constructors
*--------------------------------------------------------------------------------
*/
public DynamicImplObjectProvider(ObjectProvider impl, DynamicClass dclass)
{
super(dclass);
m_impl = impl;
} // end constructor
public DynamicImplObjectProvider(ObjectProvider impl)
{
super(getBaseDClass());
m_impl = impl;
} // end constructor
/*--------------------------------------------------------------------------------
* Overrides from class DynamicObjectImpl
*--------------------------------------------------------------------------------
*/
public Object call(String method_name, Object[] parameters) throws DynamicObjectException
{
if (method_name.equals("getObject"))
{ // verify parameter list and call the method
verifyParameterLength(method_name,parameters,2);
verifyParameterType(method_name,parameters,0,String.class);
verifyParameterType(method_name,parameters,1,String.class);
return m_impl.getObject((String)(parameters[0]),(String)(parameters[1]));
} // end if
return super.call(method_name,parameters);
} // end call
/*--------------------------------------------------------------------------------
* External operations
*--------------------------------------------------------------------------------
*/
public boolean canCall(String method_name)
{
return method_name.equals("getObject");
} // end canCall
/*--------------------------------------------------------------------------------
* External static operations
*--------------------------------------------------------------------------------
*/
public static synchronized DynamicClass getBaseDClass()
{
if (s_baseclass==null)
s_baseclass = new DynamicClassObjectProvider();
return s_baseclass;
} // end getBaseDClass
} // end class DynamicImplObjectProvider

View File

@ -0,0 +1,192 @@
/*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.dynamo.obj;
import java.util.*;
import com.silverwrist.dynamo.except.*;
import com.silverwrist.dynamo.iface.*;
public class DynamicImplSecureObjectStore extends DynamicImplObjectProvider
{
/*--------------------------------------------------------------------------------
* Static data members
*--------------------------------------------------------------------------------
*/
private static DynamicClass s_baseclass = null;
private static Set ALLOWED_METHODS;
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
*/
private SecureObjectStore m_impl;
/*--------------------------------------------------------------------------------
* Constructors
*--------------------------------------------------------------------------------
*/
public DynamicImplSecureObjectStore(SecureObjectStore impl, DynamicClass dclass)
{
super(impl,dclass);
m_impl = impl;
} // end constructor
public DynamicImplSecureObjectStore(SecureObjectStore impl)
{
super(impl,getBaseDClass());
m_impl = impl;
} // end constructor
/*--------------------------------------------------------------------------------
* Overrides from class DynamicImplObjectProvider
*--------------------------------------------------------------------------------
*/
public Object call(String method_name, Object[] parameters) throws DynamicObjectException
{
if (method_name.equals("setObject"))
{ // verify the parameters and call the method
try
{ // make sure and capture known exceptions
verifyParameterLength(method_name,parameters,4);
verifyParameterType(method_name,parameters,0,DynamoUser.class);
verifyParameterType(method_name,parameters,1,String.class);
verifyParameterType(method_name,parameters,2,String.class);
// N.B.: no need to verify parameter index 3
return m_impl.setObject((DynamoUser)(parameters[0]),(String)(parameters[1]),(String)(parameters[2]),
parameters[3]);
} // end try
catch (DatabaseException e)
{ // represents a call failure
throw callFailed(e);
} // end catch
catch (DynamoSecurityException e)
{ // represents a call failure
throw callFailed(e);
} // end catch
} // end if
if (method_name.equals("removeObject"))
{ // verify the parameters and call the method
try
{ // make sure and capture known exceptions
verifyParameterLength(method_name,parameters,3);
verifyParameterType(method_name,parameters,0,DynamoUser.class);
verifyParameterType(method_name,parameters,1,String.class);
verifyParameterType(method_name,parameters,2,String.class);
return m_impl.removeObject((DynamoUser)(parameters[0]),(String)(parameters[1]),(String)(parameters[2]));
} // end try
catch (DatabaseException e)
{ // represents a call failure
throw callFailed(e);
} // end catch
catch (DynamoSecurityException e)
{ // represents a call failure
throw callFailed(e);
} // end catch
} // end if
if (method_name.equals("getNamespaces"))
{ // verify the parameters and call the method
try
{ // make sure and capture known exceptions
verifyParameterLength(method_name,parameters,0);
return m_impl.getNamespaces();
} // end try
catch (DatabaseException e)
{ // represents a call failure
throw callFailed(e);
} // end catch
} // end if
if (method_name.equals("getNamesForNamespace"))
{ // verify the parameters and call the method
try
{ // make sure and capture known exceptions
verifyParameterLength(method_name,parameters,1);
verifyParameterType(method_name,parameters,0,String.class);
return m_impl.getNamesForNamespace((String)(parameters[0]));
} // end try
catch (DatabaseException e)
{ // represents a call failure
throw callFailed(e);
} // end catch
} // end if
return super.call(method_name,parameters);
} // end call
public boolean canCall(String method_name)
{
if (ALLOWED_METHODS.contains(method_name))
return true;
else
return super.canCall(method_name);
} // end canCall
/*--------------------------------------------------------------------------------
* External static operations
*--------------------------------------------------------------------------------
*/
public static synchronized DynamicClass getBaseDClass()
{
if (s_baseclass==null)
s_baseclass = new DynamicClassSecureObjectStore();
return s_baseclass;
} // end getBaseDClass
/*--------------------------------------------------------------------------------
* Static initializer
*--------------------------------------------------------------------------------
*/
static
{
HashSet tmp = new HashSet();
tmp.add("setObject");
tmp.add("removeObject");
tmp.add("getNamespaces");
tmp.add("getNamesForNamespace");
ALLOWED_METHODS = Collections.unmodifiableSet(tmp);
} // end static initializer
} // end class DynamicImplSecureObjectStore