public interface AgentInterface extends TransientAgentInterface
Agent
is an extension of TransientAgent
that adds the posibility to store properties and data. These can be stored persistently or can be temporary for each instance. Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
TransientAgent
Modifier and Type | Method and Description |
---|---|
boolean |
destroyDataObject(String dataObjectName)
Destroys the specified data object, deleting the corresponding node in the
CASAFile . |
boolean |
getBooleanProperty(String name)
Retrieves the boolean property, returning it to the user.
|
String |
getCASAFilename()
Returns the filename of the
CASAFile that will be used by
this agent to store its properties and data either temporarily or
persistently. |
StatusString |
getDataObject(String dataObjectName)
Retreives a
StatusDataDescriptor for this agent from the
specified data object. |
InputStream |
getDataObjectInputStream(String dataObjectName)
Returns an
InputStream that can be used to read from the
specified data object. |
OutputStream |
getDataObjectOutputStream(String dataObjectName,
boolean append)
Returns an
OutputStream that can be used to write to the
specified data object. |
double |
getDoubleProperty(String name)
Retrieves the double precision floating point property, returning it to
the user.
|
float |
getFloatProperty(String name)
Retrieves the floating point property, returning it to the user.
|
int |
getIntegerProperty(String name)
Retrieves the integer property, returning it to the user.
|
long |
getLongProperty(String name)
Retrieves the long integer property, returning it to the user.
|
String |
getStringProperty(String name)
Retrieves the String property, returning it to the user.
|
boolean |
hasProperty(String propertyName)
Returns whether the specified property is contained in the properties.
|
boolean |
isPersistent()
Returns whether this agent's data will be persistent between instances.
|
Status |
putDataObject(DataStorageDescriptor dsd)
Stores some data for this agent based on the specified
DataStorageDescriptor . |
Status |
putDataObject(String data,
String dataObjectName,
boolean append)
Stores a
DataDescriptor for this agent to the specified data
object. |
boolean |
ready()
Determines if the agent has been fully initialized: registered with the
LAC and initialized its data file and properties.
|
void |
removeProperty(String propertyName)
Removes the property from the propertiesp.
|
void |
setBooleanProperty(String name,
boolean value)
Stores a boolean property.
|
void |
setDoubleProperty(String name,
double value)
Stores a double precision floating point property.
|
void |
setFloatProperty(String name,
float value)
Stores a floating point property.
|
void |
setIntegerProperty(String name,
int value)
Stores an integer property.
|
void |
setLongProperty(String name,
long value)
Stores a long integer property.
|
void |
setPersistent(boolean persistent)
Sets whether this
Agent 's data should be persistent between instances. |
void |
setStringProperty(String name,
String value)
Stores a String property.
|
doAdvertise, doCDGetHistory_sync, doCDGetMembers, doCDPutData, doFindInstances_sync, doGetCooperationDomains, doGetOnology, doInviteToCD, doJoinCD, doPing_sync, doPing, doRegisterAgentInstance, doRegisterAgentInstance, doSearchYP, doUnadvertise, doUnregisterAgentInstance, doUnregisterAgentType, doWithdrawCD, executeCommand, getInstancesFound, getJoinedCooperationDomains, getLACURL, getMembers, getOntology, getOptions, getSerializedOntology, getStrategyGUI, hasStrategyGUI, isAAct, isInitialized, isRegistered, makeDefaultInterface, putExtendedOntology, putReplacementOntology, putUI, release_get_ontology, removeCooperationDomains, requestInstances, setOptions, updateOptions
addObserver, addObserver, closePort, deleteObserver, deleteObserver, exit, getAgentName, getName, getNewMessage, getPort, getStrategy, getTrace, getUniqueRequestID, getURL, getUseAckProtocol, hasOpenPort, isA, isAPerformative, isExiting, isLoggingTag, isStoppable, isTracing, println, println, println, realizeAgentBehaviourFromOptions, sendMessage, setTracing, setUseAckProtocol, startTraceMonitor
addObserver, addObserver, countObservers, deleteObservers, hasChanged, notifyObservers, notifyObservers, notifyObserversWithNoArg, notifyObserversWithTop
abclEval, abclEval, abclEval, addTransformation, bump, chooseSC, defer, dequeueEvent, dispatchMsgHandlerMethod, evesdrop, getKnowledgeBase, getName, getSCStore, getSubscribeEvents, getTransformationFor, getUniqueRequestID, getURL, getUseAckProtocol, isA, isA, isA, isA, isAPerformative, isAPerformative, isLoggingTag, notifyObservers, println, println, println, queueEvent, queueEventIf, revTransform, revTransform, sendMessage, transform, transform
String getCASAFilename() throws FileNotFoundException
CASAFile
that will be used by
this agent to store its properties and data either temporarily or
persistently.CASAFile
that will be used by
this agent to store its properties and data.FileNotFoundException
void setPersistent(boolean persistent)
Agent
's data should be persistent between instances.persistent
- Whether this Agent
's data should be persistent between instances.boolean isPersistent()
true
if this agent's data will be persistent between instances; false
otherwise.boolean destroyDataObject(String dataObjectName) throws IOException
CASAFile
. A boolean value is returned as to whether the data
object existed in the first place.dataObjectName
- The name of the data object that we wish to destroy.true
if the data object existed and was successfully
destroyed; false
otherwise.IOException
- If there is a problem removing the node from the
CASAFile
, such as a non-existent file.Status putDataObject(DataStorageDescriptor dsd)
DataStorageDescriptor
. The Status
is returned
indicating the success of the operation.dsd
- The DataStorageDescriptor
that specifies what data
is to be written as well as to which dataobject it should be written.Status
object indicating the result of the attempt.Status putDataObject(String data, String dataObjectName, boolean append)
DataDescriptor
for this agent to the specified data
object. The Status
is returned indicating the success of the
operation.data
- The DataDescriptor
to be stored.dataObjectName
- The name of the data object that will be written to
or written over.append
- Sets whether the data object should be appended to, or
overwritten.Status
object indicating the result of the attempt.OutputStream getDataObjectOutputStream(String dataObjectName, boolean append) throws IOException
OutputStream
that can be used to write to the
specified data object.dataObjectName
- The name of the data object that the
OutputStream
will write to.append
- Sets whether the data object will be appended to, or
overwritten by the OutputStream
.OutputStream
that can be used to write to the
specified data object.IOException
- If there is a problem creating the
OutputStream
for the specified data object.InputStream getDataObjectInputStream(String dataObjectName) throws IOException
InputStream
that can be used to read from the
specified data object.dataObjectName
- The name of the data object that the
InputStream
will read from.InputStream
that can be used to read from the
specified data object.IOException
- If there is a problem creating the
InputStream
for the specified data object.StatusString getDataObject(String dataObjectName)
StatusDataDescriptor
for this agent from the
specified data object. The StatusDataDescriptor
contains the
status of the attempt and the data of the specified data object.dataObjectName
- The name of the data object that will be read from.StatusDataDescriptor
containing the status of the
attempt and the data of the specified data object.void setBooleanProperty(String name, boolean value)
name
- The name of the property to store.value
- The value of the property that matches the name given.boolean getBooleanProperty(String name) throws PropertyException
name
- The name of the property to retrieve.PropertyException
- If the given property is not a boolean property.void setStringProperty(String name, String value)
name
- The name of the property to store.value
- The value of the property that matches the name given.String getStringProperty(String name) throws PropertyException
name
- The name of the property to retrieve.PropertyException
- If the given property is not a String property.void setIntegerProperty(String name, int value)
name
- The name of the property to store.value
- The value of the property that matches the name given.int getIntegerProperty(String name) throws PropertyException
name
- The name of the property to retrieve.PropertyException
- If the given property is not an integer
property.void setLongProperty(String name, long value)
name
- The name of the property to store.value
- The value of the property that matches the name given.long getLongProperty(String name) throws PropertyException
name
- The name of the property to retrieve.PropertyException
- If the given property is not a long integer
property.void setFloatProperty(String name, float value)
name
- The name of the property to store.value
- The value of the property that matches the name given.float getFloatProperty(String name) throws PropertyException
name
- The name of the property to retrieve.PropertyException
- If the given property is not a floating point
property.void setDoubleProperty(String name, double value)
name
- The name of the property to store.value
- The value of the property that matches the name given.double getDoubleProperty(String name) throws PropertyException
name
- The name of the property to retrieve.PropertyException
- If the given property is not a double precision
floating point property.boolean hasProperty(String propertyName)
propertyName
- The name of the property that we are checking for.true
if there exists a property with the specified
name; false
otherwise.void removeProperty(String propertyName)
propertyName
- The name of the property to be removed.boolean ready()