public abstract class AutoSecure extends Auto
Auto
class in which the only methods that
can be executed are ones that add and remove messages from the autonomic manager queue.
Allowing access to all methods might break some logic as part of a queueing system and
this class even overrides any admin script security settings.
The canAccess
method has new settings so that any remote call that tries to
invoke a method must use one of the run
, invokeBehaviour
, or messageReply
methods. There are also the following conditions:run
method has started, then invokeBehaviour
is
disabled, so the behaviours can only execute in the loop, using the internal evaluateBehaviour
method, so as not to break some logic here.run
method has not started, then invokeBehaviour
is
allowed, for single instance executions.messageReply
method is always open and will queue any messages it receives.autoEngine, autoManager, bm, iterations, sleepTime
dataCompare, dataMethod, resultObj
canAccessMeta, canAccessNested, dm, finalised, isRemoteCall, messageStore, serviceAdmin, serviceGrade, serviceInitialise, serviceLinks, serviceState, sm, toLoadScript
shutDown
passwordHandler, service, serviceType
jarFile, syncOn, uuid
Constructor and Description |
---|
AutoSecure()
Creates a new instance of AutoSecure.
|
AutoSecure(java.lang.String thisPassword,
java.lang.String thisAdminKey)
Creates a new instance of AutoSecure.
|
AutoSecure(java.lang.String thisPassword,
java.lang.String thisAdminKey,
org.licas_xml.abs.Element adminXml)
Creates a new instance of AutoSecure.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canAccess(java.lang.String thePassword,
java.lang.String methodName,
java.lang.reflect.Method theMethod)
Return true if the password allows the calling component to access this component.
|
protected boolean |
classNameOK(java.lang.String className)
Check that the classname path is not illegal.
|
protected java.lang.Object |
getInstanceValue(java.lang.String varName)
Get the value of the specified variable if it exists.
|
java.util.ArrayList<java.lang.String> |
getPublicMethods()
Get the list of methods that that can be freely called, without a password even.
|
protected java.util.ArrayList<java.lang.String> |
getSecureMethods()
Get the list of methods that can be safely called on a secure Auto class.
|
boolean |
isSecureMethod(java.lang.String methodName)
Return true if the method is one that can be safely called on a secure Auto class.
|
protected void |
setInstanceValues(org.licas_xml.abs.Element instanceValues)
Set actual values for variable instances if they are defined.
|
protected void |
setSerializeValues(org.licas_xml.abs.Element serializeXml)
Set actual values for serialized variable instances if they are defined.
|
autoAction, autoQueueMessage, behaviourAction, getAutoEngine, getMessageState, interrupt, invokeBehaviour, messageReply, removeCommunicationID, run, setAutoEngine, setAutonomicManager, setBehaviourModule, setProcessScript
createEvaluateData, createEvaluateData, dataTypeOK, dataXmlBM, dataXmlBM, dataXmlDH, dataXmlDH, evaluate, getData, getData, getDataType, getResultObj, resetValues, setData, setData, setFixedDataValue, setGenData, setResultObj
addCommunicationID, addDefaultService, addDefaultService, addDefaultService, addDefaultService, addLinkFromService, addLinkToService, addMessageMetrics, addService, addService, addService, addService, addServiceAssociation, addServicePassword, addTempPassword, allowAddService, canAccess, canAccess, canAccess, canAccessMeta, canAccessNested, canAccessTemp, canRun, clearServiceLinks, clearServices, clearServices, close, createMetaForRepos, createMetaFull, createPermanentLinkTo, createServiceWrapper, defaultAdminToRemove, dynamicLinkQuery, dynamicLinksToPermanent, dynamicLinksToXml, dynamicLinksToXml, execute, finaliseInitialisation, finaliseInitialisation, finaliseModule, finaliseThisConfig, GET, getAllLinkToService, getAllowAddService, getAutonomicManagerConfig, getCommunicationClientURI, getDescription, getFullPath, getIsRemoteCall, getLinkFromService, getLinkToService, getLocalRemoteID, getParent, getParent, getPassword, getPassword, getPassword, getPasswordHandler, getPrivateMethods, getPublicServiceClassname, getServerPassword, getService, getService, getServiceAdmin, getServiceClasses, getServiceGrade, getServiceLinks, getServiceNames, getServiceNames, getServiceNames, getServiceNumber, getServiceOrWrapper, getServiceState, getServiceType, getServiceTypes, handshake, hasCommunicationID, hasLinkTo, hasServerPassword, hasService, hasServiceType, isCorrectPassword, isPrivateMethod, isPublicMethod, isStarted, linksToXml, passwordsStateToXml, permanentLinksToXml, reflectionMethods, reflectionObject, removeAllLinksTo, removeAllServices, removeAllServices, removeLinkFromService, removeLinkToService, removePermanentLinkTo, removeServiceAssociation, removeServiceID, removeServicePath, removeServicePath, removeTempPassword, serviceNegotiate, serviceToXml, serviceToXml, setAdminInfo, setCanAccessMeta, setCanAccessNested, setData, setDataModule, setDataModule, setDescription, setIsRemoteCall, setOtherMeta, setParent, setParent, setServerPassword, setServiceGrade, setServiceModule, setServiceState, startAllThreads, startThread, stopAllThreads, syncToAsync, syncToAsyncReply, syncToAsyncTransit, xmlToDynamicLinks, xmlToService
getShutDown, setShutDown, setShutDown
canAccess, getPasswordHandler, getServicePassword, getServiceType, isAdminKey, setServiceDetails, setServiceType
getJarFile, getUUID, loadObject, setJarFile, setUUID, threadAliveState
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setData
getUUID, setJarFile, setUUID
public AutoSecure() throws java.lang.Exception
anon
by default.java.lang.Exception
- any error.public AutoSecure(java.lang.String thisPassword, java.lang.String thisAdminKey) throws java.lang.Exception
thisPassword
- password to invoke this service.thisAdminKey
- admin key for this service.java.lang.Exception
- any error.public AutoSecure(java.lang.String thisPassword, java.lang.String thisAdminKey, org.licas_xml.abs.Element adminXml) throws java.lang.Exception
thisPassword
- password to invoke this service.thisAdminKey
- admin key for this service.adminXml
- the admin info or description of this service.java.lang.Exception
- any error.protected void setInstanceValues(org.licas_xml.abs.Element instanceValues) throws java.lang.Exception
NOTE:
you must add this method to your own derived class if you use it,
so that the private variables in that class can be accessed. It is ignored
unless it gets called through the script initialisation process.
setInstanceValues
in class Auto
instanceValues
- the admin script part that defines instance values.java.lang.Exception
- any error.protected java.lang.Object getInstanceValue(java.lang.String varName) throws java.lang.Exception
NOTE:
you must add this method to your own derived class if you use it,
so that the private variables in that class can be accessed. It is ignored
unless it gets called through the script initialisation process.
getInstanceValue
in class Auto
varName
- the name of the variable to check for.java.lang.Exception
- any error.protected void setSerializeValues(org.licas_xml.abs.Element serializeXml) throws java.lang.Exception
NOTE:
you must add this method to your own derived class if you
use it, so that the private variables in that class can be accessed.
setSerializeValues
in class Auto
serializeXml
- the admin script part that defines serialize instance
values.java.lang.Exception
- any error.public boolean isSecureMethod(java.lang.String methodName)
methodName
- the name of the method.protected boolean canAccess(java.lang.String thePassword, java.lang.String methodName, java.lang.reflect.Method theMethod) throws java.lang.Exception
canAccess
in class Service
thePassword
- the password to use.methodName
- the method name that needs to be called.theMethod
- the method that needs to be called.java.lang.Exception
- any error.protected boolean classNameOK(java.lang.String className)
classNameOK
in class Service
className
- full classname of service to load.protected java.util.ArrayList<java.lang.String> getSecureMethods()
public java.util.ArrayList<java.lang.String> getPublicMethods()
getPublicMethods
in class Service