Class ECaccessServer
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
ecmwf.common.callback.CallBackObject
ecmwf.common.ecaccess.StarterServer
ecmwf.common.ecaccess.ECaccessServer
- All Implemented Interfaces:
RemoteServer
,MBeanListener
,MBeanService
,ToBeStarted
,Serializable
,Remote
- Direct Known Subclasses:
ECaccessProvider
The Class ECaccessServer.
- See Also:
-
Field Summary
Fields inherited from class java.rmi.server.RemoteObject
ref
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ECaccessServer
(DataBase dataBase, Starter starter) Instantiates a new ecaccess server.ECaccessServer
(Starter starter) Instantiates a new ecaccess server. -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute
(String attributeName) Gets the attribute.Gets the database.<T extends DataBase>
TgetDataBase
(Class<T> clazz) Gets the database.Gets the ECuser.Gets the MBean info.void
handleECuserUpdate
(ECUser ecuser) Handle the ECuser update.abstract ECUser
importECUser
(String user) Import ec user.Invoke.boolean
isRegistredUser
(String user) Checks if it is a registered user.newActivity
(ECUser ecuser, String plugin, String host, String agent, String action, String comment, boolean error) New activity.newActivity
(String user, String plugin, String host, String agent, String action, String comment, boolean error) New activity.New event.void
Purge the database.abstract void
purgeDataBase
(long milliseconds) Purge the database.boolean
setAttribute
(String name, Object value) Sets the attribute.void
shutdown()
Shutdown.void
updateECUser
(String ecuser) Update the ECuser.void
Update the ECusers.Methods inherited from class ecmwf.common.ecaccess.StarterServer
exit, getGraceful, getInstance, getInstance, getMBeanCenter, getPluginContainer, getPluginInfos, getRemoteCnf, getRestart, getStartDate, getVersion, handle, handle, handleNotification, shutdown
Methods inherited from class ecmwf.common.callback.CallBackObject
createOrGetRegistry, getPort
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
-
Constructor Details
-
ECaccessServer
public ECaccessServer(Starter starter) throws SQLException, IOException, IllegalAccessException, InstantiationException, ClassNotFoundException, InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException, MalformedObjectNameException, InstanceNotFoundException, DataBaseException Instantiates a new ecaccess server.- Parameters:
starter
- the starter- Throws:
SQLException
- the SQL exceptionIOException
- Signals that an I/O exception has occurred.IllegalAccessException
- the illegal access exceptionInstantiationException
- the instantiation exceptionClassNotFoundException
- the class not found exceptionInstanceAlreadyExistsException
- the instance already exists exceptionMBeanRegistrationException
- the MBean registration exceptionNotCompliantMBeanException
- the not compliant m bean exceptionMalformedObjectNameException
- the malformed object name exceptionInstanceNotFoundException
- the instance not found exceptionDataBaseException
- the data base exception
-
ECaccessServer
protected ECaccessServer(DataBase dataBase, Starter starter) throws SQLException, IOException, IllegalAccessException, InstantiationException, ClassNotFoundException, InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException, MalformedObjectNameException, InstanceNotFoundException, DataBaseException Instantiates a new ecaccess server.- Parameters:
dataBase
- the data basestarter
- the starter- Throws:
SQLException
- the SQL exceptionIOException
- Signals that an I/O exception has occurred.IllegalAccessException
- the illegal access exceptionInstantiationException
- the instantiation exceptionClassNotFoundException
- the class not found exceptionInstanceAlreadyExistsException
- the instance already exists exceptionMBeanRegistrationException
- the MBean registration exceptionNotCompliantMBeanException
- the not compliant m bean exceptionMalformedObjectNameException
- the malformed object name exceptionInstanceNotFoundException
- the instance not found exceptionDataBaseException
- the data base exception
-
-
Method Details
-
purgeDataBase
public void purgeDataBase()Purge the database. -
purgeDataBase
public abstract void purgeDataBase(long milliseconds) Purge the database.- Parameters:
milliseconds
- the milliseconds
-
updateECUsers
public void updateECUsers()Update the ECusers. -
handleECuserUpdate
Handle the ECuser update. To be overwritten by classes that wish to do some special processing when a ECuser is updated.- Parameters:
ecuser
- the ecuser
-
updateECUser
-
invoke
public Object invoke(String operationName, Object[] params, String[] signature) throws NoSuchMethodException, MBeanException Invoke. Invoke. Invoke.- Specified by:
invoke
in interfaceMBeanService
- Overrides:
invoke
in classStarterServer
- Parameters:
operationName
- the operation nameparams
- the paramssignature
- the signature- Returns:
- the object
- Throws:
NoSuchMethodException
- the no such method exceptionMBeanException
- the MBean exception
-
getMBeanInfo
Gets the MBean info. Gets the MBean info. Gets the MBean info.- Specified by:
getMBeanInfo
in interfaceMBeanService
- Overrides:
getMBeanInfo
in classStarterServer
- Returns:
- the MBean info
-
setAttribute
public boolean setAttribute(String name, Object value) throws InvalidAttributeValueException, MBeanException Sets the attribute. Sets the attribute. Sets the attribute.- Specified by:
setAttribute
in interfaceMBeanService
- Overrides:
setAttribute
in classStarterServer
- Parameters:
name
- the namevalue
- the value- Returns:
- true, if successful
- Throws:
InvalidAttributeValueException
- the invalid attribute value exceptionMBeanException
- the MBean exception
-
getAttribute
Gets the attribute. Gets the attribute. Gets the attribute.- Specified by:
getAttribute
in interfaceMBeanService
- Overrides:
getAttribute
in classStarterServer
- Parameters:
attributeName
- the attribute name- Returns:
- the attribute
- Throws:
AttributeNotFoundException
- the attribute not found exceptionMBeanException
- the MBean exception
-
shutdown
public void shutdown()Shutdown. Shutdown. Shutdown.- Specified by:
shutdown
in interfaceToBeStarted
- Overrides:
shutdown
in classStarterServer
-
getDataBase
-
getDataBase
-
newActivity
public Activity newActivity(String user, String plugin, String host, String agent, String action, String comment, boolean error) New activity.- Parameters:
user
- the userplugin
- the pluginhost
- the hostagent
- the agentaction
- the actioncomment
- the commenterror
- the error- Returns:
- the activity
-
newActivity
public Activity newActivity(ECUser ecuser, String plugin, String host, String agent, String action, String comment, boolean error) New activity.- Parameters:
ecuser
- the ecuserplugin
- the pluginhost
- the hostagent
- the agentaction
- the actioncomment
- the commenterror
- the error- Returns:
- the activity
-
newEvent
-
importECUser
-
getECUser
-
isRegistredUser
Checks if it is a registered user.- Parameters:
user
- the user- Returns:
- true, if is registered user
-