Class MasterServer
- All Implemented Interfaces:
ClientInterface
,HandlerInterface
,ProviderInterface
,RemoteServer
,MBeanListener
,MBeanService
,MonitorCallback
,ToBeStarted
,MasterInterface
,Serializable
,Remote
public final class MasterServer
extends ECaccessProvider
implements HandlerInterface, MasterInterface
The Class MasterServer.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal class
The Class AcqDownloadScheduler.final class
The Class AcquisitionScheduler.final class
The Class BackupScheduler.final class
The Class DissDownloadScheduler.class
The Class DownloadScheduler.final class
The Class EventScheduler.final class
The Class FilterScheduler.final class
The Class ProxyScheduler.final class
The Class PurgeScheduler.final class
The Class ReplicateScheduler.Nested classes/interfaces inherited from class ecmwf.common.ecaccess.ECaccessProvider
ECaccessProvider.ProviderMBean
-
Field Summary
FieldsFields inherited from class java.rmi.server.RemoteObject
ref
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDataTransfer
(DataTransfer transfer) Adds the data transfer.void
addRoot
(ClientInterface access, String host, String root, String service) Adds the root.void
addTransferHistory
(DataTransfer transfer) Adds the transfer history.void
addTransferHistory
(DataTransfer transfer, Host source, String code, String comment, boolean error) Adds the transfer history.void
addTransferHistory
(DataTransfer transfer, String code, String comment) Adds the transfer history.void
checkPendingTicket
(DataTransfer transfer, boolean updateRepository) Check pending ticket.void
cleanDataWindow
(Host host) Clean the Data Window of the selected Host.void
Close all incoming connections from all data movers.void
closeAllIncomingConnections
(String transferServerName) Close all incoming connections on a data mover.boolean
Close an incoming connection from its identifier.computeFilterEfficiency
(String destinationName, String email, String filter, long date, boolean includeStdby, String pattern) Compute the filter efficiency.copyDestination
(String fromDestinationName, String toDestinationName, String comment, boolean copySharedHost) Copy a destination.Copy a Host within the same Destination.boolean
deleteDataFile
(DataFile file) Delete data file.void
exportDestination
(String targetMaster, String fromDestination, boolean copySharedHost) Export destination.getActiveTransferServers
(String caller, TransferServer original, TransferGroup group, Integer fileSystem) Get the list of active TransferServers.Gets the attachment access interface.getAttribute
(String attributeName) Gets the attribute.Gets the data base interface.Gets the data file access interface.getDataMoverInterface
(String name) Gets the client interface.getDataTransfer
(long id) Gets the data transfer.getDataTransfer
(DataTransfer transfer) Gets the data transfer.getDataTransferFromCache
(long id) Gets the data transfer from cache.getDataTransfers
(long dataFileId) Gets the data transfers.getDataTransfers
(String destinationName) Gets the data transfers.getDestination
(String name) Gets the destination.getDestinationCache
(String destinationName) Gets the destination cache.Gets the destination caches.getDestinationSchedulerCache
(String destinationName) Gets the destination scheduler cache.getDestinationSchedulerCache
(String destinationName, String statusCode) Gets the destination scheduler cache.getDownloadScheduler
(boolean acquisition) Gets the download scheduler.getECauthToken
(String user) Gets the ecauth token.Gets the ecpds base.getETag
(long dataTransferId) Gets the ETag for a given dataTransferId.Gets the event script content.getHostReport
(Host proxyHost, Host host) Gets the host report.Get all incoming connections from all data movers.Get all incoming connections from all data movers per user.getIncomingProfile
(String incomingUser, String incomingPassword, String from) Gets the incoming profile.getIncomingUserHash
(String incomingUser) Return a hash of the specified incoming user (the string is in the form userid:password).void
getInitialChangeHostEvents
(String target) Submit the initial change host events to the handler specified by its target name.void
getInitialDataTransferEvents
(String target) Submit the initial data transfer events to the handler specified by its target name.void
getInitialProductStatusEvents
(String target) Submit the initial product status events to the handler specified by its target name.Gets the management interface.Gets the MBean info.getMoverReport
(Host proxyHost) Gets the mover report.int
Get the number of clients connected to all the MQTT brokers.Get the output for the specified Host.Gets the password.getProgressInterface
(long dataFileId) Gets the progress interface either from the download schedulers or the ecpds plugin (depending on how the data file is retrieved).Get a report for the specified Host.getReport
(TransferServer server) Get a report for the specified TransferServer.long
getRetrieved
(long dataFileId) Gets the number of bytes retrieved.getRoot()
Gets the root.byte[]
getS3AuthorizationSignature
(String incomingUser, String prefix, String data, String algorithm) Return a hash of the specified incoming user (the string is in the form userid:password).Gets the service.Gets the status.Gets the ticket repository.Gets the transfer scheduler.getTransferServerName
(long dataFileId) Gets the transfer server name.Gets the version.getWebUser
(String user, String credentials, String root) Allow getting a Web User.void
handle
(PluginEvent<?> event) Handle.void
handle
(PluginEvent<?>[] events) Handle.void
handleECuserUpdate
(ECUser ecuser) Handle the ECuser update.void
importDestination
(Destination fromDestination, Association[] linkedAssociations, boolean copySharedHost) Import destination from another Master Server.importECUser
(String uid) Import ec user.Invoke.long
Checks if it is available.boolean
isValidDataFile
(long dataFileId) Checks if is valid data file.void
lockDataFile
(String key) Lock a data file.lockTransfer
(String key, ProgressInterface plugin) Check if a lock has not yet been set on the specific key.long
proxyHostIsAlive
(String name) Proxy host is alive.void
publishToMQTTBroker
(String topic, int qos, long expiryInterval, String contentType, String clientId, String payload, boolean retain) Publish MQTT message to all transfers servers from all transfer groups.void
purgeDataBase
(long milliseconds) Purge the database.purgeDataFile
(DataFile file, String byAndFrom) Purge data file.boolean
reloadDestination
(DataTransfer transfer) Reload destination.void
removeDataFileAndDataTransfers
(DataFile file, String username, String byAndFrom) Removes the data file and data transfers.void
removeDataTransfer
(DataTransfer transfer) Removes the data transfer.void
removeExpired
(String root, String service) Removes the expired root.void
removeFromMQTTBroker
(String topic) Remove MQTT retain message from all transfers servers from all transfer groups.void
resetDestination
(Destination destination, String comment) Reset destination.void
resetHostStats
(Host host) Reset the host stats of the selected Host.void
resetTransferServer
(String root, String comment) Reset transfer server.void
saveWebUser
(WebUser webUser) Creates the web user.void
sendECpdsMessage
(DataTransfer transfer) Sends the ecpds message.void
sendECpdsMessage
(String to, String subject, String content) Sends the ecpds message.void
sendECpdsMessage
(String from, String to, String cc, String subject, String content, String attachmentName, String attachmentContent) Sends the ecpds message.boolean
setAttribute
(String name, Object value) Sets the attribute.void
shutdown()
Shutdown.long
transfer
(byte[] bytes, TransferServer server, Host host, String target, long remotePosn, long size) Transfer.boolean
transferIsLocked
(String key) Check if the data transfer for the specified unique key is locked.void
unlockTransfer
(String key) Unlock the data transfer and associated data file for the specified unique key.void
updateData
(Host host) Update data.void
updateData
(String hostId, String data) Update data.void
updateDataTransfer
(DataTransfer transfer) Update data transfer.void
updateDataTransfers
(DataTransfer[] transfers) Update data transfers.updateDownloadProgress
(DownloadProgress[] progress) Update download progress.int
This method is updating the locations for every Host in the database (called from the JMX interface).void
updateIncomingConnectionIds
(String serverName, List<IncomingConnection> incomingConnections) Update incoming connection ids.boolean
updateLocalTransferStatus
(String remoteMaster, boolean standby, String destination, String target, String uniqueKey, String status) Update data transfer status from another Master Server.void
updateLocation
(Host host) Update location.void
updatePluginEvents
(PluginEvent<?>[] events) Update plugin events.boolean
updateRemoteTransferStatus
(String remoteMaster, boolean standby, String destination, String target, String uniqueKey, String status) Update data transfer status to another Master Server.boolean
updateTransferStatus
(long id, String code, boolean commit, String username, String byAndFrom, boolean synchronous, boolean reset) Update transfer status.boolean
updateTransferStatus
(DataTransfer transfer, String code) Update transfer status.boolean
updateTransferStatus
(DataTransfer transfer, String code, boolean commit, String username, String byAndFrom, boolean synchronous, boolean reset) Update transfer status.Methods inherited from class ecmwf.common.ecaccess.ECaccessProvider
existsClientInterface, getClientInterface, getClientInterface, getClientInterfaces, getClientRoots, getMonitorManager, isRegistred, lastUpdateForClientInterface, subscribe
Methods inherited from class ecmwf.common.ecaccess.ECaccessServer
getDataBase, getDataBase, getECUser, isRegistredUser, newActivity, newActivity, newEvent, purgeDataBase, updateECUser, updateECUsers
Methods inherited from class ecmwf.common.ecaccess.StarterServer
exit, getGraceful, getInstance, getInstance, getMBeanCenter, getPluginContainer, getPluginInfos, getRemoteCnf, getRestart, getStartDate, 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
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ecmwf.common.ecaccess.ProviderInterface
isRegistred, subscribe
-
Field Details
-
dataCache
The data cache. Allow getting latest update of the DataTransfer when calling method from The data cache!
-
-
Constructor Details
-
MasterServer
public MasterServer(Starter starter) throws SQLException, IOException, IllegalAccessException, InstantiationException, ClassNotFoundException, InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException, MalformedObjectNameException, InstanceNotFoundException, ConnectionException, DataBaseException Instantiates a new master 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 exceptionConnectionException
- the connection exceptionDataBaseException
- the data base exception
-
-
Method Details
-
getVersion
Gets the version. Gets the version.- Specified by:
getVersion
in classStarterServer
- Returns:
- the version
-
getManagementInterface
Gets the management interface. -
getDataBaseInterface
Gets the data base interface. -
getAttachmentAccessInterface
Gets the attachment access interface. -
getDataFileAccessInterface
Gets the data file access interface. Gets the data file access interface.- Specified by:
getDataFileAccessInterface
in interfaceMasterInterface
- Returns:
- the data file access interface
-
getEventScriptContent
Gets the event script content.- Returns:
- the event script content
-
getDestination
Gets the destination. Gets the destination.- Specified by:
getDestination
in interfaceMasterInterface
- Parameters:
name
- the name- Returns:
- the destination
-
isValidDataFile
public boolean isValidDataFile(long dataFileId) Checks if is valid data file. Checks if is valid data file. This method is called by the cleaning scheduler on the DataMovers to check if a DataFile still exists and is valid? Otherwise the DataFile is removed from the DataMover storage system.- Specified by:
isValidDataFile
in interfaceMasterInterface
- Parameters:
dataFileId
- the data file id- Returns:
- true, if is valid data file
-
getIncomingUserHash
Return a hash of the specified incoming user (the string is in the form userid:password). Gets the incoming user hash.- Specified by:
getIncomingUserHash
in interfaceMasterInterface
- Parameters:
incomingUser
- the incoming user- Returns:
- hash, if the user is found
-
getS3AuthorizationSignature
public byte[] getS3AuthorizationSignature(String incomingUser, String prefix, String data, String algorithm) Return a hash of the specified incoming user (the string is in the form userid:password). Gets the s 3 authorization signature.- Specified by:
getS3AuthorizationSignature
in interfaceMasterInterface
- Parameters:
incomingUser
- the incoming userprefix
- the prefix (e.g. AWS4)data
- the dataalgorithm
- the algorithm- Returns:
- authorization signature
-
getIncomingProfile
public IncomingProfile getIncomingProfile(String incomingUser, String incomingPassword, String from) throws DataBaseException, MasterException Gets the incoming profile. Gets the incoming profile.- Specified by:
getIncomingProfile
in interfaceMasterInterface
- Parameters:
incomingUser
- the incoming userincomingPassword
- the incoming passwordfrom
- the from- Returns:
- the incoming profile
- Throws:
DataBaseException
- the data base exceptionMasterException
- the master exception
-
getTransferScheduler
Gets the transfer scheduler.- Returns:
- the transfer scheduler
- Throws:
MasterException
- the master exception
-
lockTransfer
Check if a lock has not yet been set on the specific key. If the lock is not set then lock on behalf of the object parameter otherwise return the object which has been used to lock the key. This method is dedicated to the ECpdsPlugin which use it to avoid having parallel requests for the same transfer request.- Parameters:
key
- the unique keyplugin
- the plugin- Returns:
- the ecpds plugin interface
-
lockDataFile
Lock a data file. This method is used by the ECpdsPlugin to record which DataFiles are in the process of being retrieved without using a Download Scheduler.- Parameters:
key
- the key
-
unlockTransfer
Unlock the data transfer and associated data file for the specified unique key.- Parameters:
key
- the unique key of the data transfer
-
transferIsLocked
Check if the data transfer for the specified unique key is locked. This method is used by the DownloadScheduler to avoid downloading a file which is still processed by the ECpdsPlugin.- Parameters:
key
- the unique key of the data transfer- Returns:
- true, if successful
-
getDownloadScheduler
public MasterServer.DownloadScheduler getDownloadScheduler(boolean acquisition) throws MasterException Gets the download scheduler.- Parameters:
acquisition
- the acquisition- Returns:
- the download scheduler
- Throws:
MasterException
- the master exception
-
getDataTransfers
Gets the data transfers.- Parameters:
dataFileId
- the data file id- Returns:
- the data transfers
- Throws:
DataBaseException
- the data base exception
-
getDestinationSchedulerCache
public DestinationSchedulerCache getDestinationSchedulerCache(String destinationName) throws MonitorException, MasterException, DataBaseException Gets the destination scheduler cache.- Parameters:
destinationName
- the destination name- Returns:
- the destination scheduler cache
- Throws:
MonitorException
- the monitor exceptionMasterException
- the master exceptionDataBaseException
- the data base exception
-
getDestinationSchedulerCache
public DestinationSchedulerCache getDestinationSchedulerCache(String destinationName, String statusCode) throws MonitorException, MasterException, DataBaseException Gets the destination scheduler cache.- Parameters:
destinationName
- the Destination namestatusCode
- the Status Code- Returns:
- the destination scheduler cache
- Throws:
MonitorException
- the monitor exceptionMasterException
- the master exceptionDataBaseException
- the data base exception
-
getDestinationCaches
public Map<String,DestinationCache> getDestinationCaches() throws MonitorException, MasterException, DataBaseExceptionGets the destination caches.- Returns:
- the destination caches
- Throws:
MonitorException
- the monitor exceptionMasterException
- the master exceptionDataBaseException
- the data base exception
-
getDestinationCache
public DestinationCache getDestinationCache(String destinationName) throws MonitorException, MasterException, DataBaseException Gets the destination cache. This is called when a host or a destination is duplicated, so the calculation of the number of bad data transfers is not relevant (0 if it is a new destination and same as before in the cache if it is a new host).- Parameters:
destinationName
- the destination name- Returns:
- the destination cache
- Throws:
MonitorException
- the monitor exceptionMasterException
- the master exceptionDataBaseException
- the data base exception
-
getECpdsBase
-
getTicketRepository
Gets the ticket repository.- Returns:
- the ticket repository
-
purgeDataBase
public void purgeDataBase(long milliseconds) Purge the database. Purge data base.- Specified by:
purgeDataBase
in classECaccessServer
- Parameters:
milliseconds
- the milliseconds
-
publishToMQTTBroker
public void publishToMQTTBroker(String topic, int qos, long expiryInterval, String contentType, String clientId, String payload, boolean retain) Publish MQTT message to all transfers servers from all transfer groups.- Parameters:
topic
- the topicqos
- the qosexpiryInterval
- the expiry intervalcontentType
- the content typeclientId
- the client idpayload
- the payloadretain
- the retain
-
removeFromMQTTBroker
Remove MQTT retain message from all transfers servers from all transfer groups.- Parameters:
topic
- the topic
-
getMQTTClientsCount
public int getMQTTClientsCount()Get the number of clients connected to all the MQTT brokers.- Returns:
- the MQTT clients count
-
deleteDataFile
Delete data file.- Parameters:
file
- the file- Returns:
- true, if successful
- Throws:
DataBaseException
- the data base exception
-
purgeDataFile
public TransferScheduler.PurgeResult purgeDataFile(DataFile file, String byAndFrom) throws DataBaseException Purge data file.- Parameters:
file
- the filebyAndFrom
- the by and from- Returns:
- the purge result
- Throws:
DataBaseException
- the data base exception
-
computeFilterEfficiency
public String computeFilterEfficiency(String destinationName, String email, String filter, long date, boolean includeStdby, String pattern) throws DataBaseException Compute the filter efficiency. The result is sent to the specified email address.- Parameters:
destinationName
- the destination nameemail
- the email addressfilter
- the filterdate
- the dateincludeStdby
- specify if should include Stdby files or not?pattern
- specify if should include Stdby files or not?- Returns:
- the filter efficiency
- Throws:
DataBaseException
- the data base exception
-
getMoverReport
Gets the mover report.- Parameters:
proxyHost
- the proxy host- Returns:
- the mover report
- Throws:
DataBaseException
- the data base exceptionIOException
- Signals that an I/O exception has occurred.
-
getHostReport
Gets the host report.- Parameters:
proxyHost
- the proxy hosthost
- the host- Returns:
- the host report
- Throws:
DataBaseException
- the data base exceptionIOException
- Signals that an I/O exception has occurred.
-
cleanDataWindow
Clean the Data Window of the selected Host.- Parameters:
host
- the host- Throws:
DataBaseException
- the data base exceptionIOException
- Signals that an I/O exception has occurred.
-
resetHostStats
Reset the host stats of the selected Host.- Parameters:
host
- the host- Throws:
DataBaseException
- the data base exception
-
getReport
Get a report for the specified Host.- Parameters:
host
- the host- Returns:
- the report
- Throws:
DataBaseException
- the data base exceptionIOException
- Signals that an I/O exception has occurred.
-
getOutput
Get the output for the specified Host. This is used by the monitoring interface.- Parameters:
host
- the host- Returns:
- the output
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getReport
Get a report for the specified TransferServer.- Parameters:
server
- the server- Returns:
- the report
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
updateIncomingConnectionIds
public void updateIncomingConnectionIds(String serverName, List<IncomingConnection> incomingConnections) Update incoming connection ids. Update incoming connection ids.- Specified by:
updateIncomingConnectionIds
in interfaceMasterInterface
- Parameters:
serverName
- the server nameincomingConnections
- the incoming connections
-
getIncomingConnections
Get all incoming connections from all data movers per user.- Returns:
- the incoming connections per user
- Throws:
DataBaseException
- the data base exception
-
getIncomingConnectionIds
Get all incoming connections from all data movers.- Returns:
- the incoming connection ids
- Throws:
DataBaseException
- the data base exception
-
closeAllIncomingConnections
Close all incoming connections from all data movers.- Throws:
DataBaseException
- the data base exception
-
closeIncomingConnection
Close an incoming connection from its identifier.- Parameters:
id
- the id in the format dataMoverName_id- Returns:
- true, if successful
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
closeAllIncomingConnections
Close all incoming connections on a data mover.- Parameters:
transferServerName
- the transfer server name- Throws:
IOException
- Signals that an I/O exception has occurred.
-
updateTransferStatus
Update transfer status.- Parameters:
transfer
- the transfercode
- the code- Returns:
- true, if successful
- Throws:
MasterException
- the master exception
-
updateTransferStatus
public boolean updateTransferStatus(long id, String code, boolean commit, String username, String byAndFrom, boolean synchronous, boolean reset) throws MasterException Update transfer status.- Parameters:
id
- the idcode
- the codecommit
- the commitusername
- the usernamebyAndFrom
- the commentsynchronous
- the synchronousreset
- the reset- Returns:
- true, if successful
- Throws:
MasterException
- the master exception
-
updateTransferStatus
public boolean updateTransferStatus(DataTransfer transfer, String code, boolean commit, String username, String byAndFrom, boolean synchronous, boolean reset) throws MasterException Update transfer status.- Parameters:
transfer
- the transfercode
- the codecommit
- the commitusername
- the usernamebyAndFrom
- the commentsynchronous
- the synchronousreset
- the reset- Returns:
- true, if successful
- Throws:
MasterException
- the master exception
-
reloadDestination
Reload destination.- Parameters:
transfer
- the transfer- Returns:
- true, if successful
- Throws:
MasterException
- the master exception
-
getActiveTransferServers
public List<TransferServer> getActiveTransferServers(String caller, TransferServer original, TransferGroup group, Integer fileSystem) throws DataBaseException Get the list of active TransferServers.- Parameters:
caller
- the calleroriginal
- the originalgroup
- the groupfileSystem
- the file system- Returns:
- the active transfer servers
- Throws:
DataBaseException
- the data base exception
-
transfer
public long transfer(byte[] bytes, TransferServer server, Host host, String target, long remotePosn, long size) throws MasterException, IOException Transfer.- Parameters:
bytes
- the bytesserver
- the serverhost
- the hosttarget
- the targetremotePosn
- the remote posnsize
- the size- Returns:
- the long
- Throws:
MasterException
- the master exceptionIOException
- Signals that an I/O exception has occurred.
-
getDataMoverInterface
Gets the client interface.- Parameters:
name
- the name- Returns:
- the client interface
-
resetTransferServer
-
resetDestination
Reset destination.- Parameters:
destination
- the destinationcomment
- the comment
-
proxyHostIsAlive
Proxy host is alive. Called when a ProxyHost sends an update to the Master.- Specified by:
proxyHostIsAlive
in interfaceMasterInterface
- Parameters:
name
- the name- Returns:
- the long
-
addRoot
Adds the root. Adds the root.- Overrides:
addRoot
in classECaccessProvider
- Parameters:
access
- the accesshost
- the hostroot
- the rootservice
- the service
-
removeExpired
Removes the expired root. Removes the expired.- Overrides:
removeExpired
in classECaccessProvider
- Parameters:
root
- the rootservice
- the service
-
importECUser
Import ec user. Import EC user.- Specified by:
importECUser
in classECaccessServer
- Parameters:
uid
- the user- Returns:
- the EC user
- Throws:
EccmdException
RemoteException
-
handleECuserUpdate
Handle the ECuser update. To be overwritten by classes that wish to do some special processing when a ECuser is updated. Handle E cuser update. This method is called when an ECUser change is detected (when the database has just been updated with a new version from NIS).- Overrides:
handleECuserUpdate
in classECaccessServer
- Parameters:
ecuser
- the ecuser
-
getMBeanInfo
Gets the MBean info. Gets the MBean info. Gets the MBean info. Gets the MBean info.- Specified by:
getMBeanInfo
in interfaceMBeanService
- Overrides:
getMBeanInfo
in classECaccessServer
- Returns:
- the MBean info
-
getAttribute
Gets the attribute. Gets the attribute. Gets the attribute. Gets the attribute.- Specified by:
getAttribute
in interfaceMBeanService
- Overrides:
getAttribute
in classECaccessServer
- Parameters:
attributeName
- the attribute name- Returns:
- the attribute
- Throws:
AttributeNotFoundException
- the attribute not found exceptionMBeanException
- the MBean exception
-
setAttribute
public boolean setAttribute(String name, Object value) throws InvalidAttributeValueException, MBeanException Sets the attribute. Sets the attribute. Sets the attribute. Sets the attribute.- Specified by:
setAttribute
in interfaceMBeanService
- Overrides:
setAttribute
in classECaccessServer
- Parameters:
name
- the namevalue
- the value- Returns:
- true, if successful
- Throws:
InvalidAttributeValueException
- the invalid attribute value exceptionMBeanException
- the MBean exception
-
invoke
public Object invoke(String operationName, Object[] params, String[] signature) throws NoSuchMethodException, MBeanException Invoke. Invoke. Invoke. Invoke.- Specified by:
invoke
in interfaceMBeanService
- Overrides:
invoke
in classECaccessServer
- Parameters:
operationName
- the operation nameparams
- the paramssignature
- the signature- Returns:
- the object
- Throws:
NoSuchMethodException
- the no such method exceptionMBeanException
- the MBean exception
-
updateDataTransfers
Update data transfers. Update data transfers.- Specified by:
updateDataTransfers
in interfaceMasterInterface
- Parameters:
transfers
- the transfers- Throws:
IOException
- Signals that an I/O exception has occurred.
-
updateDownloadProgress
Update download progress. Update download progress.- Specified by:
updateDownloadProgress
in interfaceMasterInterface
- Parameters:
progress
- the progress- Returns:
- the list of DownloadProgress to interrupt (not found on the MasterServer)
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
checkPendingTicket
Check pending ticket.- Parameters:
transfer
- the transferupdateRepository
- the update repository
-
updateDataTransfer
Update data transfer.- Parameters:
transfer
- the transfer
-
addDataTransfer
Adds the data transfer.- Parameters:
transfer
- the transfer
-
removeDataTransfer
Removes the data transfer.- Parameters:
transfer
- the transfer
-
removeDataFileAndDataTransfers
public void removeDataFileAndDataTransfers(DataFile file, String username, String byAndFrom) throws MasterException, DataBaseException Removes the data file and data transfers.- Parameters:
file
- the fileusername
- the usernamebyAndFrom
- the comment- Throws:
MasterException
- the master exceptionDataBaseException
- the data base exception
-
addTransferHistory
Adds the transfer history.- Parameters:
transfer
- the transfer
-
addTransferHistory
Adds the transfer history.- Parameters:
transfer
- the transfercode
- the codecomment
- the comment
-
addTransferHistory
public void addTransferHistory(DataTransfer transfer, Host source, String code, String comment, boolean error) Adds the transfer history.- Parameters:
transfer
- the transfersource
- source hostcode
- the codecomment
- the commenterror
- is it an error?
-
getProgressInterface
Gets the progress interface either from the download schedulers or the ecpds plugin (depending on how the data file is retrieved).- Parameters:
dataFileId
- the data file id- Returns:
- the progress interface
-
getRetrieved
public long getRetrieved(long dataFileId) Gets the number of bytes retrieved. If the thread is not found on both download schedulers then -1 is returned.- Parameters:
dataFileId
- the data file id- Returns:
- the retrieved
-
getTransferServerName
Gets the transfer server name.- Parameters:
dataFileId
- the data file id- Returns:
- the transfer server name
-
getDataTransferFromCache
Gets the data transfer from cache.- Parameters:
id
- the id- Returns:
- the data transfer from cache
-
getStatus
-
getDataTransfers
Gets the data transfers.- Parameters:
destinationName
- the destination name- Returns:
- the data transfers
-
getDataTransfer
Gets the data transfer.- Parameters:
id
- the id- Returns:
- the data transfer
-
getDataTransfer
Gets the data transfer.- Parameters:
transfer
- the transfer- Returns:
- the data transfer
-
sendECpdsMessage
Sends the ecpds message.- Parameters:
transfer
- the transfer
-
sendECpdsMessage
public void sendECpdsMessage(String from, String to, String cc, String subject, String content, String attachmentName, String attachmentContent) Sends the ecpds message.- Parameters:
from
- the fromto
- the tocc
- the ccsubject
- the subjectcontent
- the contentattachmentName
- the attachment nameattachmentContent
- the attachment content
-
sendECpdsMessage
-
isAvailable
public long isAvailable()Checks if it is available. Checks if is available.- Specified by:
isAvailable
in interfaceProviderInterface
- Returns:
- the long
-
updateData
Update data. Update data. This method is used from the MoverProvider on the MoverServer (updateMSUser) to update the Host. The method will make sure the Host was not updated by a newer version. If a newer version exists then this update will not be done. The only field updated in this method is the DATA.- Specified by:
updateData
in interfaceMasterInterface
- Parameters:
host
- the host- Throws:
DataBaseException
- the data base exception
-
updateData
Update data. Update data. This method is used from the MoverProvider on the MoverServer (updateMSUser) to update the Host. The method will make sure the Host was not updated by a newer version. If a newer version exists then this update will not be done. The only field updated in this method is the DATA.- Specified by:
updateData
in interfaceMasterInterface
- Parameters:
hostId
- the host iddata
- the host data- Throws:
DataBaseException
- the data base exception
-
updateLocation
Update location. Update location. This method is used from the MoverProvider on the MoverServer (getMSUser) to update the Host location. This is triggered when the MoverServer has detected a change in the IP address. It is also called from the Web monitoring and JMX interface.- Specified by:
updateLocation
in interfaceMasterInterface
- Parameters:
host
- the host
-
updateHostLocations
public int updateHostLocations()This method is updating the locations for every Host in the database (called from the JMX interface).- Returns:
- the int
-
getECauthToken
Gets the ecauth token. Gets the ecauth token.- Specified by:
getECauthToken
in interfaceMasterInterface
- Parameters:
user
- the user- Returns:
- the ecauth token
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getETag
Gets the ETag for a given dataTransferId. Gets the e tag.- Specified by:
getETag
in interfaceMasterInterface
- Parameters:
dataTransferId
- the data transfer id- Returns:
- the ETag
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
copyHost
Copy a Host within the same Destination.- Parameters:
destinationName
- the destination namehostName
- the host name- Returns:
- the host
- Throws:
DataBaseException
- the data base exception
-
copyDestination
public Destination copyDestination(String fromDestinationName, String toDestinationName, String comment, boolean copySharedHost) throws MasterException, DataBaseException Copy a destination.- Parameters:
fromDestinationName
- the from destination nametoDestinationName
- the target destination namecomment
- the commentcopySharedHost
- the copy shared host- Returns:
- the destination
- Throws:
MasterException
- the master exceptionDataBaseException
- the data base exception
-
importDestination
public void importDestination(Destination fromDestination, Association[] linkedAssociations, boolean copySharedHost) throws MasterException, DataBaseException Import destination from another Master Server. Import destination.- Specified by:
importDestination
in interfaceMasterInterface
- Parameters:
fromDestination
- the from destinationlinkedAssociations
- the linked associationscopySharedHost
- the copy shared host- Throws:
MasterException
- the master exceptionDataBaseException
- the data base exception
-
exportDestination
public void exportDestination(String targetMaster, String fromDestination, boolean copySharedHost) throws MasterException, DataBaseException Export destination.- Parameters:
targetMaster
- the target master in the form host:fromDestination
- the from destinationcopySharedHost
- the copy shared host- Throws:
MasterException
- the master exceptionDataBaseException
- the data base exception
-
updateRemoteTransferStatus
public boolean updateRemoteTransferStatus(String remoteMaster, boolean standby, String destination, String target, String uniqueKey, String status) throws MasterException Update data transfer status to another Master Server.- Parameters:
remoteMaster
- the remote masterstandby
- the standby flagdestination
- the destination nametarget
- the target nameuniqueKey
- the unique keystatus
- the status- Returns:
- true, if successful
- Throws:
MasterException
- the master exception
-
updateLocalTransferStatus
public boolean updateLocalTransferStatus(String remoteMaster, boolean standby, String destination, String target, String uniqueKey, String status) throws MasterException Update data transfer status from another Master Server. Update local transfer status.- Specified by:
updateLocalTransferStatus
in interfaceMasterInterface
- Parameters:
remoteMaster
- the remote masterstandby
- the standby flagdestination
- the destination nametarget
- the target nameuniqueKey
- the unique namestatus
- the status- Returns:
- true, if successful
- Throws:
MasterException
- the master exception
-
getWebUser
Allow getting a Web User. The credentials are checked before returning the Web User.- Parameters:
user
- the usercredentials
- the credentialsroot
- the root- Returns:
- the web user
- Throws:
MasterException
- the master exception
-
saveWebUser
Creates the web user.- Parameters:
webUser
- the web user- Throws:
MasterException
- the master exceptionDataBaseException
- the data base exception
-
shutdown
public void shutdown()Shutdown. Shutdown. Shutdown. Shutdown. Shutdown.- Specified by:
shutdown
in interfaceToBeStarted
- Overrides:
shutdown
in classECaccessProvider
-
handle
Handle. Handle.- Specified by:
handle
in interfaceHandlerInterface
- Overrides:
handle
in classStarterServer
- Parameters:
event
- the event
-
handle
Handle. Handle.- Specified by:
handle
in interfaceHandlerInterface
- Overrides:
handle
in classStarterServer
- Parameters:
events
- the events
-
getInitialDataTransferEvents
Submit the initial data transfer events to the handler specified by its target name.- Parameters:
target
- the target
-
getInitialProductStatusEvents
Submit the initial product status events to the handler specified by its target name.- Parameters:
target
- the target
-
getInitialChangeHostEvents
Submit the initial change host events to the handler specified by its target name.- Parameters:
target
- the target
-
getRoot
Gets the root. Gets the root.- Specified by:
getRoot
in interfaceClientInterface
- Returns:
- the root
-
getService
Gets the service. Gets the service.- Specified by:
getService
in interfaceClientInterface
- Returns:
- the service
-
getPassword
Gets the password. Gets the password.- Specified by:
getPassword
in interfaceClientInterface
- Returns:
- the password
-
updatePluginEvents
Update plugin events.- Parameters:
events
- the events- Throws:
Exception
- the exception
-