set up event framework for UniStore, resolving some TODOs
This commit is contained in:
parent
7727dc61dd
commit
5fe6dd78b3
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* 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.event;
|
||||
|
||||
import com.silverwrist.dynamo.iface.UniStorePart;
|
||||
|
||||
public class MessagePartPropertyUpdateEvent extends MessagePartUpdateEvent
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private transient String m_namespace;
|
||||
private transient String m_name;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public MessagePartPropertyUpdateEvent(UniStorePart src, String namespace, String name)
|
||||
{
|
||||
super(src);
|
||||
m_namespace = namespace;
|
||||
m_name = name;
|
||||
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class MessagePartUpdateEvent
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "MessagePartPropertyUpdateEvent: message ID#" + getMessagePart().getMessageID() + ", "
|
||||
+ (isBinaryPart() ? "binary" : "text") + " part " + getMessagePart().getPartIdentity() + ", namespace "
|
||||
+ m_namespace + ", m_name " + m_name;
|
||||
|
||||
} // end toString
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* External operations
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String getPropertyNamespace()
|
||||
{
|
||||
return m_namespace;
|
||||
|
||||
} // end getPropertyNamespace
|
||||
|
||||
public String getPropertyName()
|
||||
{
|
||||
return m_name;
|
||||
|
||||
} // end getPropertyName
|
||||
|
||||
} // end class MessagePartPropertyUpdateEvent
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* 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.event;
|
||||
|
||||
import com.silverwrist.dynamo.iface.UniStorePart;
|
||||
|
||||
public class MessagePartRead extends MessagePartUpdateEvent
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public MessagePartRead(UniStorePart src)
|
||||
{
|
||||
super(src);
|
||||
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class MessagePartUpdateEvent
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "MessagePartRead: message ID#" + getMessagePart().getMessageID() + ", "
|
||||
+ (isBinaryPart() ? "binary" : "text") + " part " + getMessagePart().getPartIdentity();
|
||||
|
||||
} // end toString
|
||||
|
||||
} // end class MessagePartRead
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* 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.event;
|
||||
|
||||
import com.silverwrist.dynamo.iface.UniStoreBinaryPart;
|
||||
import com.silverwrist.dynamo.iface.UniStorePart;
|
||||
|
||||
public class MessagePartUpdateEvent extends UniStoreUpdateEvent
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public MessagePartUpdateEvent(UniStorePart src)
|
||||
{
|
||||
super(src);
|
||||
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class UniStoreUpdateEvent
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "MessagePartUpdateEvent: message ID#" + getMessagePart().getMessageID() + ", "
|
||||
+ (isBinaryPart() ? "binary" : "text") + " part " + getMessagePart().getPartIdentity();
|
||||
|
||||
} // end toString
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* External operations
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public UniStorePart getMessagePart()
|
||||
{
|
||||
return (UniStorePart)source;
|
||||
|
||||
} // end getMessagePart
|
||||
|
||||
public boolean isBinaryPart()
|
||||
{
|
||||
return (source instanceof UniStoreBinaryPart);
|
||||
|
||||
} // end isBinaryPart
|
||||
|
||||
} // end class MessagePartUpdateEvent
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* 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.event;
|
||||
|
||||
import com.silverwrist.dynamo.iface.UniStoreMessage;
|
||||
|
||||
public class MessagePositionUpdateEvent extends MessageUpdateEvent
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private transient long m_parent;
|
||||
private transient int m_seq;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public MessagePositionUpdateEvent(UniStoreMessage src, long parent, int seq)
|
||||
{
|
||||
super(src);
|
||||
m_parent = parent;
|
||||
m_seq = seq;
|
||||
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class MessageUpdateEvent
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "MessagePositionUpdateEvent: message ID#" + getMessage().getMessageID() + ", parent message ID#"
|
||||
+ m_parent + ", sequence = " + m_seq;
|
||||
|
||||
} // end toString
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* External operations
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public long getParentMessageID()
|
||||
{
|
||||
return m_parent;
|
||||
|
||||
} // end getParentMessageID
|
||||
|
||||
public int getSequence()
|
||||
{
|
||||
return m_seq;
|
||||
|
||||
} // end getSequence
|
||||
|
||||
} // end class MessagePositionUpdateEvent
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* 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.event;
|
||||
|
||||
import com.silverwrist.dynamo.iface.UniStoreMessage;
|
||||
|
||||
public class MessagePropertyUpdateEvent extends MessageUpdateEvent
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private transient String m_namespace;
|
||||
private transient String m_name;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public MessagePropertyUpdateEvent(UniStoreMessage src, String namespace, String name)
|
||||
{
|
||||
super(src);
|
||||
m_namespace = namespace;
|
||||
m_name = name;
|
||||
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class MessageUpdateEvent
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "MessagePropertyUpdateEvent: message ID#" + getMessage().getMessageID() + ", namespace " + m_namespace
|
||||
+ ", name " + m_name;
|
||||
|
||||
} // end toString
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* External operations
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String getPropertyNamespace()
|
||||
{
|
||||
return m_namespace;
|
||||
|
||||
} // end getPropertyNamespace
|
||||
|
||||
public String getPropertyName()
|
||||
{
|
||||
return m_name;
|
||||
|
||||
} // end getPropertyName
|
||||
|
||||
} // end class MessagePropertyUpdateEvent
|
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* 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.event;
|
||||
|
||||
import com.silverwrist.dynamo.iface.DynamoAcl;
|
||||
import com.silverwrist.dynamo.iface.UniStoreMessage;
|
||||
|
||||
public class MessageSecurityUpdateEvent extends MessageUpdateEvent
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private transient DynamoAcl m_acl;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public MessageSecurityUpdateEvent(UniStoreMessage src, DynamoAcl acl)
|
||||
{
|
||||
super(src);
|
||||
m_acl = acl;
|
||||
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class MessageUpdateEvent
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "MessageSecurityUpdateEvent: message ID#" + getMessage().getMessageID() + ", ACL ID#" + m_acl.getAclID();
|
||||
|
||||
} // end toString
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* External operations
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public DynamoAcl getAcl()
|
||||
{
|
||||
return m_acl;
|
||||
|
||||
} // end getAcl
|
||||
|
||||
} // end class MessageSecurityUpdateEvent
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* 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.event;
|
||||
|
||||
import com.silverwrist.dynamo.iface.UniStoreMessage;
|
||||
|
||||
public class MessageUpdateEvent extends UniStoreUpdateEvent
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public MessageUpdateEvent(UniStoreMessage src)
|
||||
{
|
||||
super(src);
|
||||
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class UniStoreUpdateEvent
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "MessageUpdateEvent: message ID#" + getMessage().getMessageID();
|
||||
|
||||
} // end toString
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* External operations
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public UniStoreMessage getMessage()
|
||||
{
|
||||
return (UniStoreMessage)source;
|
||||
|
||||
} // end getMessage
|
||||
|
||||
} // end class MessageUpdateEvent
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* 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.event;
|
||||
|
||||
public class UniStoreUpdateEvent extends DynamicUpdateEvent
|
||||
{
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public UniStoreUpdateEvent(Object src)
|
||||
{
|
||||
super(src);
|
||||
|
||||
} // end constructor
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class DynamicUpdateEvent
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "UniStoreUpdateEvent: source = " + source;
|
||||
|
||||
} // end toString
|
||||
|
||||
} // end class UniStoreUpdateEvent
|
|
@ -25,6 +25,8 @@ public interface UniStorePart extends SecureObjectStore
|
|||
{
|
||||
public long getMessageID();
|
||||
|
||||
public UniStoreMessage getMessage();
|
||||
|
||||
public int getPartIndex();
|
||||
|
||||
public QualifiedNameKey getPartIdentity();
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.sql.SQLException;
|
|||
import java.util.*;
|
||||
import org.apache.commons.collections.*;
|
||||
import com.silverwrist.dynamo.db.NamespaceCache;
|
||||
import com.silverwrist.dynamo.event.*;
|
||||
import com.silverwrist.dynamo.except.*;
|
||||
import com.silverwrist.dynamo.iface.*;
|
||||
import com.silverwrist.dynamo.util.*;
|
||||
|
@ -128,6 +129,7 @@ class BinaryPartImpl implements UniStoreBinaryPart
|
|||
|
||||
private BinaryPartOps m_ops;
|
||||
private NamespaceCache m_nscache;
|
||||
private PostDynamicUpdate m_post;
|
||||
private MessageImpl m_parent;
|
||||
private int m_part;
|
||||
private QualifiedNameKey m_identity;
|
||||
|
@ -143,10 +145,12 @@ class BinaryPartImpl implements UniStoreBinaryPart
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
BinaryPartImpl(BinaryPartOps ops, NamespaceCache nscache, MessageImpl parent, Map params) throws DatabaseException
|
||||
BinaryPartImpl(BinaryPartOps ops, NamespaceCache nscache, PostDynamicUpdate post, MessageImpl parent, Map params)
|
||||
throws DatabaseException
|
||||
{
|
||||
m_ops = ops;
|
||||
m_nscache = nscache;
|
||||
m_post = post;
|
||||
m_parent = parent;
|
||||
m_part = ((Integer)(params.get(MessageOps.PARAM_PART))).intValue();
|
||||
PropertyKey pk = (PropertyKey)(params.get(MessageOps.PARAM_IDENTITY));
|
||||
|
@ -240,7 +244,7 @@ class BinaryPartImpl implements UniStoreBinaryPart
|
|||
|
||||
} // end synchronized block
|
||||
|
||||
// TODO: m_post.postUpdate(new GlobalPropertyUpdateEvent(this,namespace,name));
|
||||
m_post.postUpdate(new MessagePartPropertyUpdateEvent(this,namespace,name));
|
||||
return rc;
|
||||
|
||||
} // end setObject
|
||||
|
@ -273,7 +277,7 @@ class BinaryPartImpl implements UniStoreBinaryPart
|
|||
|
||||
} // end synchronized block
|
||||
|
||||
// TODO: m_post.postUpdate(new GlobalPropertyUpdateEvent(this,namespace,name));
|
||||
m_post.postUpdate(new MessagePartPropertyUpdateEvent(this,namespace,name));
|
||||
return rc;
|
||||
|
||||
} // end removeObject
|
||||
|
@ -342,6 +346,12 @@ class BinaryPartImpl implements UniStoreBinaryPart
|
|||
|
||||
} // end getMessageID
|
||||
|
||||
public UniStoreMessage getMessage()
|
||||
{
|
||||
return m_parent;
|
||||
|
||||
} // end getMessage
|
||||
|
||||
public int getPartIndex()
|
||||
{
|
||||
return m_part;
|
||||
|
@ -388,7 +398,7 @@ class BinaryPartImpl implements UniStoreBinaryPart
|
|||
|
||||
} // end synchronized block
|
||||
|
||||
// TODO: post an update?
|
||||
m_post.postUpdate(new MessagePartRead(this));
|
||||
|
||||
} // end touchRead
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.apache.log4j.Logger;
|
|||
import com.silverwrist.dynamo.Namespaces;
|
||||
import com.silverwrist.dynamo.db.NamespaceCache;
|
||||
import com.silverwrist.dynamo.db.UserManagement;
|
||||
import com.silverwrist.dynamo.event.*;
|
||||
import com.silverwrist.dynamo.except.*;
|
||||
import com.silverwrist.dynamo.iface.*;
|
||||
import com.silverwrist.dynamo.security.SecurityReferenceMonitor;
|
||||
|
@ -47,6 +48,7 @@ class MessageImpl implements UniStoreMessage
|
|||
private NamespaceCache m_nscache; // namespace cache
|
||||
private SecurityReferenceMonitor m_srm; // security reference monitor
|
||||
private UserManagement m_users; // user manager
|
||||
private PostDynamicUpdate m_post; // dynamic update poster
|
||||
private long m_id; // the message ID
|
||||
private long m_parentid; // the parent message ID
|
||||
private int m_seq; // sequence within parent
|
||||
|
@ -66,12 +68,14 @@ class MessageImpl implements UniStoreMessage
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
MessageImpl(MessageOps ops, NamespaceCache nscache, SecurityReferenceMonitor srm, UserManagement users, Map params)
|
||||
MessageImpl(MessageOps ops, NamespaceCache nscache, SecurityReferenceMonitor srm, UserManagement users,
|
||||
PostDynamicUpdate post, Map params)
|
||||
{
|
||||
m_ops = ops;
|
||||
m_nscache = nscache;
|
||||
m_srm = srm;
|
||||
m_users = users;
|
||||
m_post = post;
|
||||
m_id = ((Long)(params.get(ManagerOps.PARAM_MSGID))).longValue();
|
||||
m_parentid = ((Long)(params.get(ManagerOps.PARAM_PARENT))).longValue();
|
||||
m_seq = ((Integer)(params.get(ManagerOps.PARAM_SEQ))).intValue();
|
||||
|
@ -166,7 +170,7 @@ class MessageImpl implements UniStoreMessage
|
|||
|
||||
} // end synchronized block
|
||||
|
||||
// TODO: m_post.postUpdate(new GlobalPropertyUpdateEvent(this,namespace,name));
|
||||
m_post.postUpdate(new MessagePropertyUpdateEvent(this,namespace,name));
|
||||
return rc;
|
||||
|
||||
} // end setObject
|
||||
|
@ -199,7 +203,7 @@ class MessageImpl implements UniStoreMessage
|
|||
|
||||
} // end synchronized block
|
||||
|
||||
// TODO: m_post.postUpdate(new GlobalPropertyUpdateEvent(this,namespace,name));
|
||||
m_post.postUpdate(new MessagePropertyUpdateEvent(this,namespace,name));
|
||||
return rc;
|
||||
|
||||
} // end removeObject
|
||||
|
@ -284,7 +288,7 @@ class MessageImpl implements UniStoreMessage
|
|||
|
||||
} // end synchronized block
|
||||
|
||||
// TODO: send out an update?
|
||||
m_post.postUpdate(new MessagePositionUpdateEvent(this,m_parentid,m_seq));
|
||||
|
||||
} // end setParentMessageID
|
||||
|
||||
|
@ -304,7 +308,7 @@ class MessageImpl implements UniStoreMessage
|
|||
|
||||
} // end if
|
||||
|
||||
// TODO: send out an update?
|
||||
m_post.postUpdate(new MessagePositionUpdateEvent(this,m_parentid,m_seq));
|
||||
|
||||
} // end setSequence
|
||||
|
||||
|
@ -345,7 +349,7 @@ class MessageImpl implements UniStoreMessage
|
|||
|
||||
} // end synchronized block
|
||||
|
||||
// TODO: post an update?
|
||||
m_post.postUpdate(new MessageSecurityUpdateEvent(this,acl));
|
||||
|
||||
} // end setAcl
|
||||
|
||||
|
@ -379,7 +383,7 @@ class MessageImpl implements UniStoreMessage
|
|||
rc = (TextPartImpl)(m_pk_to_text.get(otherkey));
|
||||
if (rc==null)
|
||||
{ // need to create a new object
|
||||
rc = new TextPartImpl(m_ops.getTextPartOps(),m_nscache,this,params);
|
||||
rc = new TextPartImpl(m_ops.getTextPartOps(),m_nscache,m_post,this,params);
|
||||
m_part_to_text.put(key,rc);
|
||||
m_pk_to_text.put(otherkey,rc);
|
||||
|
||||
|
@ -416,7 +420,7 @@ class MessageImpl implements UniStoreMessage
|
|||
rc = (TextPartImpl)(m_part_to_text.get(otherkey));
|
||||
if (rc==null)
|
||||
{ // OK, need to create the object
|
||||
rc = new TextPartImpl(m_ops.getTextPartOps(),m_nscache,this,params);
|
||||
rc = new TextPartImpl(m_ops.getTextPartOps(),m_nscache,m_post,this,params);
|
||||
m_part_to_text.put(otherkey,rc);
|
||||
m_pk_to_text.put(key,rc);
|
||||
|
||||
|
@ -448,7 +452,7 @@ class MessageImpl implements UniStoreMessage
|
|||
rc = (BinaryPartImpl)(m_pk_to_binary.get(otherkey));
|
||||
if (rc==null)
|
||||
{ // need to create a new object
|
||||
rc = new BinaryPartImpl(m_ops.getBinaryPartOps(),m_nscache,this,params);
|
||||
rc = new BinaryPartImpl(m_ops.getBinaryPartOps(),m_nscache,m_post,this,params);
|
||||
m_part_to_binary.put(key,rc);
|
||||
m_pk_to_binary.put(otherkey,rc);
|
||||
|
||||
|
@ -485,7 +489,7 @@ class MessageImpl implements UniStoreMessage
|
|||
rc = (BinaryPartImpl)(m_part_to_binary.get(otherkey));
|
||||
if (rc==null)
|
||||
{ // OK, need to create the object
|
||||
rc = new BinaryPartImpl(m_ops.getBinaryPartOps(),m_nscache,this,params);
|
||||
rc = new BinaryPartImpl(m_ops.getBinaryPartOps(),m_nscache,m_post,this,params);
|
||||
m_part_to_binary.put(otherkey,rc);
|
||||
m_pk_to_binary.put(key,rc);
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.lang.ref.*;
|
|||
import java.util.*;
|
||||
import org.apache.commons.collections.*;
|
||||
import com.silverwrist.dynamo.db.NamespaceCache;
|
||||
import com.silverwrist.dynamo.event.*;
|
||||
import com.silverwrist.dynamo.except.*;
|
||||
import com.silverwrist.dynamo.iface.*;
|
||||
import com.silverwrist.dynamo.util.*;
|
||||
|
@ -35,6 +36,7 @@ class TextPartImpl implements UniStoreTextPart
|
|||
|
||||
private TextPartOps m_ops;
|
||||
private NamespaceCache m_nscache;
|
||||
private PostDynamicUpdate m_post;
|
||||
private MessageImpl m_parent;
|
||||
private int m_part;
|
||||
private QualifiedNameKey m_identity;
|
||||
|
@ -51,10 +53,12 @@ class TextPartImpl implements UniStoreTextPart
|
|||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
TextPartImpl(TextPartOps ops, NamespaceCache nscache, MessageImpl parent, Map params) throws DatabaseException
|
||||
TextPartImpl(TextPartOps ops, NamespaceCache nscache, PostDynamicUpdate post, MessageImpl parent, Map params)
|
||||
throws DatabaseException
|
||||
{
|
||||
m_ops = ops;
|
||||
m_nscache = nscache;
|
||||
m_post = post;
|
||||
m_parent = parent;
|
||||
m_part = ((Integer)(params.get(MessageOps.PARAM_PART))).intValue();
|
||||
PropertyKey pk = (PropertyKey)(params.get(MessageOps.PARAM_IDENTITY));
|
||||
|
@ -150,7 +154,7 @@ class TextPartImpl implements UniStoreTextPart
|
|||
|
||||
} // end synchronized block
|
||||
|
||||
// TODO: m_post.postUpdate(new GlobalPropertyUpdateEvent(this,namespace,name));
|
||||
m_post.postUpdate(new MessagePartPropertyUpdateEvent(this,namespace,name));
|
||||
return rc;
|
||||
|
||||
} // end setObject
|
||||
|
@ -183,7 +187,7 @@ class TextPartImpl implements UniStoreTextPart
|
|||
|
||||
} // end synchronized block
|
||||
|
||||
// TODO: m_post.postUpdate(new GlobalPropertyUpdateEvent(this,namespace,name));
|
||||
m_post.postUpdate(new MessagePartPropertyUpdateEvent(this,namespace,name));
|
||||
return rc;
|
||||
|
||||
} // end removeObject
|
||||
|
@ -252,6 +256,12 @@ class TextPartImpl implements UniStoreTextPart
|
|||
|
||||
} // end getMessageID
|
||||
|
||||
public UniStoreMessage getMessage()
|
||||
{
|
||||
return m_parent;
|
||||
|
||||
} // end getMessage
|
||||
|
||||
public int getPartIndex()
|
||||
{
|
||||
return m_part;
|
||||
|
@ -298,7 +308,7 @@ class TextPartImpl implements UniStoreTextPart
|
|||
|
||||
} // end synchronized block
|
||||
|
||||
// TODO: post an update?
|
||||
m_post.postUpdate(new MessagePartRead(this));
|
||||
|
||||
} // end touchRead
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ public class UniStoreManager implements NamedObject, ComponentInitialize, Compon
|
|||
private ManagerOps m_ops; // database operations object
|
||||
private SecurityReferenceMonitor m_srm; // security reference monitor
|
||||
private UserManagement m_users; // user management object
|
||||
private PostDynamicUpdate m_post; // dynamic update posting
|
||||
private HardSoftCache m_msgcache; // message cache
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
|
@ -151,6 +152,7 @@ public class UniStoreManager implements NamedObject, ComponentInitialize, Compon
|
|||
m_srm = (SecurityReferenceMonitor)(GetObjectUtils.getDynamoComponent(services,SecurityReferenceMonitor.class,
|
||||
srm_name));
|
||||
m_users = (UserManagement)(GetObjectUtils.getDynamoComponent(services,UserManagement.class,users_name));
|
||||
m_post = (PostDynamicUpdate)(services.queryService(PostDynamicUpdate.class));
|
||||
|
||||
} // end initialize
|
||||
|
||||
|
@ -162,6 +164,7 @@ public class UniStoreManager implements NamedObject, ComponentInitialize, Compon
|
|||
public void shutdown()
|
||||
{
|
||||
m_msgcache.clear();
|
||||
m_post = null;
|
||||
m_srm = null;
|
||||
m_users = null;
|
||||
m_ns_cache = null;
|
||||
|
@ -182,7 +185,7 @@ public class UniStoreManager implements NamedObject, ComponentInitialize, Compon
|
|||
if (rc==null)
|
||||
{ // need to look it up in the database!
|
||||
Map params = m_ops.getMessageData(msgid);
|
||||
rc = new MessageImpl(m_ops.getMessageOps(),m_ns_cache,m_srm,m_users,params);
|
||||
rc = new MessageImpl(m_ops.getMessageOps(),m_ns_cache,m_srm,m_users,m_post,params);
|
||||
params.clear();
|
||||
m_msgcache.put(key,rc);
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
*
|
||||
* 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) 2002 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
* Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
@ -61,7 +61,7 @@ public class QualifiedNameKey
|
|||
|
||||
public String toString()
|
||||
{
|
||||
return "{" + m_namespace + "}" + m_name;
|
||||
return m_namespace + "::" + m_name;
|
||||
|
||||
} // end toString
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user