de.danet.an.workflow.tools.util
Interface SimpleApplicationDirectory

All Superinterfaces:
javax.ejb.EJBObject, java.rmi.Remote

public interface SimpleApplicationDirectory
extends javax.ejb.EJBObject

Remote interface for SimpleApplicationDirectory.

See Also:
de.danet.an.workflow.util

Method Summary
 SimpleApplicationInfo infoByActivity(ActivityUniqueKey auk)
          Return the information associated with the activity.
 java.util.Collection infosByApplication(java.lang.String applName)
          Return infos associated with a given application.
 java.util.Collection infosByKey(java.lang.String applName, java.lang.String applInstKey)
          Return the infos associated with the given application name and key.
 java.util.Collection infosByResource(java.lang.String applName, java.lang.String resourceKey)
          Return infos associated with a given application and resource.
 SimpleApplicationInfo instanceInfo(long instId)
          Return the information associated with the application instance.
 long registerInstance(java.lang.String applName, Activity activity, java.lang.Object state, boolean saveAssignment)
          Register a new application instance.
 long registerInstance(java.lang.String applName, java.lang.String applInstKey, Activity activity, java.lang.Object state, boolean saveAssignment)
          Register a new application instance.
 void removeInstance(long instId)
          Remove an application instance.
 void updateInvokingActivity(long instId, ActivityUniqueKey auk)
          Update the activity associated with the given application instance.
 void updateState(long instId, java.lang.Object state)
          Update the state information associated with the given application instance id.
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

registerInstance

public long registerInstance(java.lang.String applName,
                             Activity activity,
                             java.lang.Object state,
                             boolean saveAssignment)
                      throws java.rmi.RemoteException
Register a new application instance. This method returns a unique key that can be used to retrieve, update and removeInstance(long) remove the instance information.

Parameters:
applName - the application name
activity - the invoking activity
state - the application state
saveAssignment - if true the assigned resource will be saved to allow searching application instances with a particular assignee
Returns:
the instance id
Throws:
java.rmi.RemoteException

registerInstance

public long registerInstance(java.lang.String applName,
                             java.lang.String applInstKey,
                             Activity activity,
                             java.lang.Object state,
                             boolean saveAssignment)
                      throws java.rmi.RemoteException
Register a new application instance. This method returns a unique key that may be used to

Parameters:
applName - the application name
applInstKey - an arbitrary key for this instance, up to 1000 characters long
activity - the invoking activity
state - the application state
saveAssignment - if true the assigned resource will be saved to allow searching application instances with a particular assignee
Returns:
the instance id
Throws:
java.rmi.RemoteException

removeInstance

public void removeInstance(long instId)
                    throws java.rmi.RemoteException
Remove an application instance.

Parameters:
instId - the application instance id previously assigned by registerInstance
Throws:
java.rmi.RemoteException

instanceInfo

public SimpleApplicationInfo instanceInfo(long instId)
                                   throws InvalidKeyException,
                                          java.rmi.RemoteException
Return the information associated with the application instance.

Parameters:
instId - the application instance id previously assigned by registerInstance
Returns:
the info
Throws:
InvalidKeyException - if there is no data available for the given id
java.rmi.RemoteException

infoByActivity

public SimpleApplicationInfo infoByActivity(ActivityUniqueKey auk)
                                     throws InvalidKeyException,
                                            java.rmi.RemoteException
Return the information associated with the activity.

Parameters:
auk - the unique key of the activity an application instance is expected to be registered for.
Returns:
the info
Throws:
InvalidKeyException - if there is no data available for the given activity
java.rmi.RemoteException

infosByApplication

public java.util.Collection infosByApplication(java.lang.String applName)
                                        throws java.rmi.RemoteException
Return infos associated with a given application.

Parameters:
applName - the application name
Returns:
the infos as collection
Throws:
java.rmi.RemoteException

infosByKey

public java.util.Collection infosByKey(java.lang.String applName,
                                       java.lang.String applInstKey)
                                throws InvalidKeyException,
                                       java.rmi.RemoteException
Return the infos associated with the given application name and key.

Parameters:
applName - the application name
applInstKey - the key associated with the instance
Returns:
the infos or an empty collection if no infos with the given application name and key exist
Throws:
InvalidKeyException
java.rmi.RemoteException

infosByResource

public java.util.Collection infosByResource(java.lang.String applName,
                                            java.lang.String resourceKey)
                                     throws java.rmi.RemoteException
Return infos associated with a given application and resource.

Parameters:
applName - the application name
resourceKey - the resource's key
Returns:
the infos as collection
Throws:
java.rmi.RemoteException

updateState

public void updateState(long instId,
                        java.lang.Object state)
                 throws InvalidKeyException,
                        java.rmi.RemoteException
Update the state information associated with the given application instance id.

Parameters:
instId - the application instance id previously assigned by registerInstance
state - the new state
Throws:
InvalidKeyException - if there is no application instance with the given id
java.rmi.RemoteException

updateInvokingActivity

public void updateInvokingActivity(long instId,
                                   ActivityUniqueKey auk)
                            throws InvalidKeyException,
                                   java.rmi.RemoteException
Update the activity associated with the given application instance. This is useful if an application instance is started by one tool (agent) invocation and stopped by another.

Be careful to ensure the eventual termination of the application. If the creating activity has completed, the terminate method of the tool agent that started the application will not be called on abnormal process completion. So, if a process is terminated abnormally and the starting activity is closed and the stopping activity has not yet been started (and associated with the application) the application will not be stopped. This should normally not be a problem for simple applications.

As a convenience, any application information that is still registered after a process completion will automatically be deleted.

The new activity must belong to the same process as the activity that initially created the application instance.

Parameters:
instId - the application instance id previously assigned by registerInstance
auk - the new activity's unique key. May be null if the application instance is temporarily not associated with an activity.
Throws:
InvalidKeyException - if there is no application instance with the given id
java.rmi.RemoteException