equip.data.beans
Class DataspaceBean

java.lang.Object
  extended byequip.data.beans.DataspaceBean
All Implemented Interfaces:
java.beans.beancontext.BeanContextChild, IDataspace

public class DataspaceBean
extends java.lang.Object
implements IDataspace, java.beans.beancontext.BeanContextChild

dataspace client JavaBean


Field Summary
protected  boolean activeFlag
          active flag
protected  boolean connectedFlag
          connected?
protected  DataSession connectedMonitorSession
          connected session
protected  DataProxy dataspace
          actual dataspace
protected  java.lang.String dataspaceUrl
          dataspace URL
static int DEFAULT_LEASE_TIME_S
          default (long long) lease - 10 years :-)
protected  GUIDFactory guids
          GUID factory
protected  java.beans.beancontext.BeanContext mBeanContext
          bean context
protected  boolean retryConnect
          async - default no
 
Constructor Summary
DataspaceBean()
          no arg bean constructor
DataspaceBean(DataProxy ds)
          over existing ds bean constructor
 
Method Summary
 void add(ItemData item)
          add a globally visible item to the dataspace
 DataSession addDataspaceEventListener(Event template, boolean localFlag, DataspaceEventListener listener)
          add an event monitor.
 DataSession addDataspaceEventListener(ItemData template, boolean localFlag, DataspaceEventListener listener)
          add a item monitor.
 void addEvent(Event event)
          emit an event directly
 void addLocal(ItemData item)
          add a local-only item to the dataspace
 void addPersistent(ItemData item, Lease lease)
          add a (potentially) persistent item to the dataspace, i.e. not process bound, and normally with a Lease (although null is permitted)
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          property change api
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          property change api
 void addVetoableChangeListener(java.lang.String vetoableName, java.beans.VetoableChangeListener listener)
          vetoable change api
 void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
          vetoable change api
 GUID allocateId()
          allocated a new GUID for a data item to be published
 ItemData[] copyCollect(ItemData template)
          copy collect - local only.
 void copyCollect(ItemData template, DataspaceEventListener listener)
          copy collect - local only - callback form.
 void delete(GUID id)
          delete a globally visible item from the dataspace
 void deleteLocal(GUID id)
          delete a local-only item from the dataspace
 java.beans.beancontext.BeanContext getBeanContext()
          bean context getter
 DataProxy getDataProxy()
          return internal DataProxy
 java.lang.String getDataspaceUrl()
          dataspace Url getter
 ItemData getItem(GUID id)
          get current value for an item by id - local only.
protected  void init()
           
 boolean isActive()
          active getter
 boolean isConnected()
          active getter
 void removeDataspaceEventListener(DataSession session)
          remove a previously added event monitor
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          property change api
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          property change api
 void removeVetoableChangeListener(java.lang.String vetoableName, java.beans.VetoableChangeListener listener)
          vetoable change api
 void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
          vetoable change api
protected  void setActive(boolean activeFlag)
          internal active setter
 void setBeanContext(java.beans.beancontext.BeanContext beanContext)
          bean setter with veto and property events
protected  void setConnected(boolean connectedFlag)
          internal setter
 void setDataspaceUrl(java.lang.String dataspaceUrl)
          dataspace Url setter
 void setDataspaceUrl(java.lang.String dataspaceUrl, boolean useDataManager)
          dataspace Url setter
 void setRetryConnect(boolean r)
          async - call BEFORE setDataspaceUrl!
 void update(ItemData item)
          update an item, globally visible, reliable
 void update(ItemData item, boolean reliableFlag)
          update an item, globally visible, optionally reliable
 void updateLocal(ItemData item)
          update an item, local-only, reliable
 void updateLocal(ItemData item, boolean reliableFlag)
          update an item, local-only, optionally reliable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mBeanContext

protected java.beans.beancontext.BeanContext mBeanContext
bean context


dataspaceUrl

protected java.lang.String dataspaceUrl
dataspace URL


dataspace

protected DataProxy dataspace
actual dataspace


activeFlag

protected boolean activeFlag
active flag


guids

protected GUIDFactory guids
GUID factory


connectedFlag

protected boolean connectedFlag
connected?


connectedMonitorSession

protected DataSession connectedMonitorSession
connected session


retryConnect

protected boolean retryConnect
async - default no


DEFAULT_LEASE_TIME_S

public static final int DEFAULT_LEASE_TIME_S
default (long long) lease - 10 years :-)

See Also:
Constant Field Values
Constructor Detail

DataspaceBean

public DataspaceBean()
no arg bean constructor


DataspaceBean

public DataspaceBean(DataProxy ds)
              throws DataspaceInactiveException
over existing ds bean constructor

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
property change api


addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener listener)
property change api

Specified by:
addPropertyChangeListener in interface java.beans.beancontext.BeanContextChild

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
property change api


removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener listener)
property change api

Specified by:
removePropertyChangeListener in interface java.beans.beancontext.BeanContextChild

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
vetoable change api


addVetoableChangeListener

public void addVetoableChangeListener(java.lang.String vetoableName,
                                      java.beans.VetoableChangeListener listener)
vetoable change api

Specified by:
addVetoableChangeListener in interface java.beans.beancontext.BeanContextChild

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
vetoable change api


removeVetoableChangeListener

public void removeVetoableChangeListener(java.lang.String vetoableName,
                                         java.beans.VetoableChangeListener listener)
vetoable change api

Specified by:
removeVetoableChangeListener in interface java.beans.beancontext.BeanContextChild

getBeanContext

public java.beans.beancontext.BeanContext getBeanContext()
bean context getter

Specified by:
getBeanContext in interface java.beans.beancontext.BeanContextChild

setBeanContext

public void setBeanContext(java.beans.beancontext.BeanContext beanContext)
bean setter with veto and property events

Specified by:
setBeanContext in interface java.beans.beancontext.BeanContextChild

setRetryConnect

public void setRetryConnect(boolean r)
async - call BEFORE setDataspaceUrl!


setDataspaceUrl

public void setDataspaceUrl(java.lang.String dataspaceUrl)
                     throws DataspaceInactiveException
dataspace Url setter

Throws:
DataspaceInactiveException

setDataspaceUrl

public void setDataspaceUrl(java.lang.String dataspaceUrl,
                            boolean useDataManager)
                     throws DataspaceInactiveException
dataspace Url setter

Throws:
DataspaceInactiveException

init

protected void init()
             throws DataspaceInactiveException
Throws:
DataspaceInactiveException

getDataspaceUrl

public java.lang.String getDataspaceUrl()
dataspace Url getter


isActive

public boolean isActive()
active getter


setActive

protected void setActive(boolean activeFlag)
internal active setter


isConnected

public boolean isConnected()
active getter


setConnected

protected void setConnected(boolean connectedFlag)
internal setter


allocateId

public GUID allocateId()
allocated a new GUID for a data item to be published

Specified by:
allocateId in interface IDataspace

add

public void add(ItemData item)
         throws DataspaceInactiveException
add a globally visible item to the dataspace

Specified by:
add in interface IDataspace
Throws:
DataspaceInactiveException

addPersistent

public void addPersistent(ItemData item,
                          Lease lease)
                   throws DataspaceInactiveException
add a (potentially) persistent item to the dataspace, i.e. not process bound, and normally with a Lease (although null is permitted)

Specified by:
addPersistent in interface IDataspace
Throws:
DataspaceInactiveException

addLocal

public void addLocal(ItemData item)
              throws DataspaceInactiveException
add a local-only item to the dataspace

Specified by:
addLocal in interface IDataspace
Throws:
DataspaceInactiveException

update

public void update(ItemData item)
            throws DataspaceInactiveException
update an item, globally visible, reliable

Specified by:
update in interface IDataspace
Throws:
DataspaceInactiveException

update

public void update(ItemData item,
                   boolean reliableFlag)
            throws DataspaceInactiveException
update an item, globally visible, optionally reliable

Specified by:
update in interface IDataspace
Throws:
DataspaceInactiveException

updateLocal

public void updateLocal(ItemData item)
                 throws DataspaceInactiveException
update an item, local-only, reliable

Specified by:
updateLocal in interface IDataspace
Throws:
DataspaceInactiveException

updateLocal

public void updateLocal(ItemData item,
                        boolean reliableFlag)
                 throws DataspaceInactiveException
update an item, local-only, optionally reliable

Specified by:
updateLocal in interface IDataspace
Throws:
DataspaceInactiveException

delete

public void delete(GUID id)
            throws DataspaceInactiveException
delete a globally visible item from the dataspace

Specified by:
delete in interface IDataspace
Throws:
DataspaceInactiveException

deleteLocal

public void deleteLocal(GUID id)
                 throws DataspaceInactiveException
delete a local-only item from the dataspace

Specified by:
deleteLocal in interface IDataspace
Throws:
DataspaceInactiveException

addEvent

public void addEvent(Event event)
              throws DataspaceInactiveException
emit an event directly

Specified by:
addEvent in interface IDataspace
Throws:
DataspaceInactiveException

getItem

public ItemData getItem(GUID id)
                 throws DataspaceInactiveException
get current value for an item by id - local only.

Specified by:
getItem in interface IDataspace
Throws:
DataspaceInactiveException

copyCollect

public ItemData[] copyCollect(ItemData template)
                       throws DataspaceInactiveException
copy collect - local only. returns all known items (local or replicated) matching the template item.

Specified by:
copyCollect in interface IDataspace
Throws:
DataspaceInactiveException

copyCollect

public void copyCollect(ItemData template,
                        DataspaceEventListener listener)
                 throws DataspaceInactiveException
copy collect - local only - callback form. returns all known items (local or replicated) matching the template item. Calls listener once for each item

Specified by:
copyCollect in interface IDataspace
Throws:
DataspaceInactiveException

addDataspaceEventListener

public DataSession addDataspaceEventListener(ItemData template,
                                             boolean localFlag,
                                             DataspaceEventListener listener)
                                      throws DataspaceInactiveException
add a item monitor. listener is called with matching events. returned reference is only need to removing the monitor. Its actually a DataSession.

Specified by:
addDataspaceEventListener in interface IDataspace
Throws:
DataspaceInactiveException

addDataspaceEventListener

public DataSession addDataspaceEventListener(Event template,
                                             boolean localFlag,
                                             DataspaceEventListener listener)
                                      throws DataspaceInactiveException
add an event monitor. listener is called with matching events. returned reference is only need to removing the monitor. Its actually a DataSession.

Specified by:
addDataspaceEventListener in interface IDataspace
Throws:
DataspaceInactiveException

removeDataspaceEventListener

public void removeDataspaceEventListener(DataSession session)
                                  throws DataspaceInactiveException
remove a previously added event monitor

Specified by:
removeDataspaceEventListener in interface IDataspace
Throws:
DataspaceInactiveException

getDataProxy

public DataProxy getDataProxy()
return internal DataProxy