Class MasterServer
- All Implemented Interfaces:
ClientInterface, HandlerInterface, ProviderInterface, RemoteServer, MBeanListener, MBeanService, MonitorCallback, ToBeStarted, MasterInterface, Serializable, Remote
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classThe Class AcqDownloadScheduler.final classThe Class AcquisitionScheduler.final classThe Class BackupScheduler.final classThe Class DissDownloadScheduler.classThe Class DownloadScheduler.final classThe Class EventScheduler.final classThe Class FilterScheduler.final classThe Class MoverAvailabilityScheduler.final classThe Class PortalBytesScheduler.final classThe Class PortalTrafficScheduler.final classThe Class ProxyScheduler.final classThe Class PurgeScheduler.final classThe Class ReplicateScheduler.static final classHolds the result of a combined volume usage computation.Nested classes/interfaces inherited from class ECaccessProvider
ECaccessProvider.ProviderMBean -
Field Summary
FieldsFields inherited from class RemoteObject
ref -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDataTransfer(DataTransfer transfer) Adds the data transfer.voidaddRoot(ClientInterface access, String host, String root, String service) Registers a new service root.voidaddTransferHistory(DataTransfer transfer) Adds the transfer history.voidaddTransferHistory(DataTransfer transfer, Host source, String code, String comment, boolean error) Adds the transfer history.voidaddTransferHistory(DataTransfer transfer, String code, String comment) Adds the transfer history.voidcheckPendingTicket(DataTransfer transfer, boolean updateRepository) Check pending ticket.voidcleanDataWindow(Host host) Clean the Data Window of the selected Host.Clone a host without associating it to any destination.voidClose all incoming connections from all data movers.voidcloseAllIncomingConnections(String transferServerName) Close all incoming connections on a data mover.booleanClose an incoming connection from its identifier.Computes aggregated volume usage for the given transfer group in a single pass over all data movers, returning oneMasterServer.VolumeUsageResultper volume index.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.booleandeleteDataFile(DataFile file) Delete data file.execDirScript(Host host, String script) Execute a Directory script on the appropriate DataMover and return the GZIPped result.voidexportDestination(String targetMaster, String fromDestination, String toDestinationName, boolean copySharedHost) Export destination.fetchUrlContent(Host host, String source, int maxBytes) Fetch the raw content of a remote URL/path via the host's configured ECtrans module on a DataMover.longfindSubscriberIdByPassword(String inuId, String password) Find the PSB_ID of the active subscriber that matches the given password for the given IncomingUser.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 e tag.Gets the event script content.getHostReport(Host proxyHost, Host host) Gets the host report.intgetIncomingConnectionCount(String incomingUser) Get the current number of active connections for the specified incoming user across all data movers.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.getIncomingProfileNoAuth(String incomingUser) Returns a fresh IncomingProfile for an already-authenticated user without re-running credential validation, TOTP, connection-count checks, or last-login updates.getIncomingUserHash(String incomingUser) Gets the incoming user hash.voidgetInitialChangeHostEvents(String target) Submit the initial change host events to the handler specified by its target name.voidgetInitialDataTransferEvents(String target) Submit the initial data transfer events to the handler specified by its target name.voidgetInitialProductStatusEvents(String target, String stream, String time) Submit the initial product status events to the handler specified by its target name and optionally stream and/or time.Gets the management interface.Gets the MBean info.getMoverReport(Host proxyHost) Gets the mover report.getMoverVolumeSnapshot(String moverName) Returns a snapshot of the per-volume disk usage for one or all DataMovers, sourced from the in-memory cache populated by the background polling cycle.intGet the number of clients connected to all the MQTT brokers.Get the output for the specified Host.Gets the password.longgetPortalBytesUsed(String userId, boolean upload, long windowMs) Returns the total bytes transferred by the given portal user within the specified rolling window (milliseconds).getPortalSubscriberEmail(long psbId) Get the email address of the portal subscriber with the given PSB_ID.getPortalTraffic(String userId, int hours) Gets portal traffic statistics.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.longgetRetrieved(long dataFileId) Gets the number of bytes retrieved.getRoot()Gets the root.byte[]getS3AuthorizationSignature(String incomingUser, String prefix, String data, String algorithm) Gets the s 3 authorization signature.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.voidhandle(PluginEvent<?> event) Handle.voidhandle(PluginEvent<?>[] events) Handle.voidhandleECuserUpdate(ECUser ecuser) Handle E cuser update.voidimportDestination(Destination fromDestination, Association[] linkedAssociations, boolean copySharedHost) Import destination.importECUser(String uid) Import EC user.voidinterruptAquisitionFor(Host host) This method is called to interrupt the acquisition thread activity for the specified host.voidinvalidatePortalSessionAcrossMovers(String token, String excludeMoverName) Broadcast a portal session token invalidation to all currently connected data movers except the calling one.voidInvalidate all portal HTTPS session cookies for the given data user on all movers.Invoke.booleanisAcquisitionRunning(Host host) Check whether the acquisition scheduler currently has a live thread running for the specified Host.booleanisAnonymousIncomingUser(String incomingUser) Check whether an IncomingUser is configured for anonymous (password-free) access.longChecks if is available.longisRegistred(String root, String service) Checks if it is registred.booleanisSubscriberActive(long psbId) Check whether a specific portal subscriber is still active.booleanisValidDataFile(boolean isProxy, long dataFileId) Checks if is valid data file.voidlockDataFile(String key) Lock a data file.lockTransfer(String key, ProgressInterface plugin) Check if a lock has not yet been set on the specific key.longproxyHostIsAlive(String name) Called when a ProxyHost sends an update to the Master.voidpublishToMQTTBroker(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.voidpurgeDataBase(long milliseconds) Purge data base.purgeDataFile(DataFile file, String byAndFrom) Purge data file.voidreleaseConnectionSlot(String incomingUser) Gets the incoming profile.booleanreloadDestination(DataTransfer transfer) Reload destination.voidremoveDataFileAndDataTransfers(DataFile file, String username, String byAndFrom) Removes the data file and data transfers.voidremoveDataTransfer(DataTransfer transfer) Removes the data transfer.voidremoveExpired(String root, String service) Removes the expired.voidremoveFromMQTTBroker(String topic) Remove MQTT retain message from all transfers servers from all transfer groups.voidresetDestination(Destination destination, String comment) Reset destination.voidresetHostStats(Host host) Reset the host stats of the selected Host.voidresetTransferServer(String root, String comment) Reset transfer server.static StringresolveAcqOutput(String text) Resolve acquisition-format output for preview.resolveDirText(Host host, String text) Resolve all static placeholder tokens in a plain-text Directory field and return the resolved text.resolvePortalSessionAcrossMovers(String token, String excludeMoverName) Locate a portal session token on any currently connected data mover other than the one named byexcludeMoverName.voidsaveWebUser(WebUser webUser) Creates the web user.selfRegisterUser(String id, String name, String email, String iso) Self-register a new data portal user (self-service flow).voidsendECpdsMessage(DataTransfer transfer) Sends the ecpds message.voidsendECpdsMessage(String to, String subject, String content) Sends the ecpds message.voidsendECpdsMessage(String to, String cc, String subject, String content, String attachmentName, String attachmentContent) Sends the ecpds message.voidsendNotificationEmail(String to, String subject, String body) Send an email notification via the MasterServer mail infrastructure.booleansetAttribute(String name, Object value) Sets the attribute.voidshutdown()Shutdown.longtransfer(byte[] bytes, TransferServer server, Host host, String target, long remotePosn, long size) Transfer.booleantransferIsLocked(String key) Check if the data transfer for the specified unique key is locked.voidtriggerAcquisition(Host host) Trigger acquisition for the specified Host immediately by resetting the acquisition time, causing the AcquisitionScheduler to pick it up on its next cycle.voidunlockTransfer(String key) Unlock the data transfer and associated data file for the specified unique key.voidupdateData(Host host) Update data.voidupdateData(String hostId, String data) Update data.voidupdateDataTransfer(DataTransfer transfer) Update data transfer.voidupdateDataTransfers(DataTransfer[] transfers) Update data transfers.updateDownloadProgress(DownloadProgress[] progress) Update download progress.intThis method is updating the locations for every Host in the database (called from the JMX interface and at startup).voidupdateIncomingConnectionIds(String serverName, List<IncomingConnection> incomingConnections) Update incoming connection ids.booleanupdateLocalTransferStatus(String remoteMaster, boolean standby, String destination, String target, String uniqueKey, String status) Update local transfer status.voidupdateLocation(Host host) Update location.voidupdatePluginEvents(PluginEvent<?>[] events) Update plugin events.booleanupdateRemoteTransferStatus(String remoteMaster, boolean standby, String destination, String target, String uniqueKey, String status) Update data transfer status to another Master Server.booleanupdateTransferStatus(long id, String code, boolean commit, String username, String byAndFrom, boolean synchronous, boolean reset, boolean addHistory) Update transfer status.booleanupdateTransferStatus(DataTransfer transfer, String code) Update transfer status.booleanupdateTransferStatus(DataTransfer transfer, String code, boolean commit, String username, String byAndFrom, boolean synchronous, boolean reset, boolean addHistory) Update transfer status.verifyRegistrationToken(String token, boolean autoApprove) Verify a self-registration token.Methods inherited from class ECaccessProvider
existsClientInterface, getClientInterface, getClientInterface, getClientInterfaces, getClientRoots, getMonitorManager, lastUpdateForClientInterface, subscribeMethods inherited from class ECaccessServer
getDataBase, getDataBase, getECUser, isRegistredUser, newActivity, newActivity, newEvent, purgeDataBase, updateECUser, updateECUsersMethods inherited from class StarterServer
exit, getGraceful, getInstance, getInstance, getMBeanCenter, getPluginContainer, getPluginInfos, getRemoteCnf, getRestart, getStartDate, handleNotification, shutdownMethods inherited from class CallBackObject
createOrGetRegistry, getPort, unexportMethods inherited from class UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObjectMethods inherited from class RemoteServer
getClientHost, getLog, setLogMethods inherited from interface ProviderInterface
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.- Specified by:
getVersionin classStarterServer- Returns:
- the version
-
getManagementInterface
Gets the management interface.- Returns:
- the management interface
-
getDataBaseInterface
Gets the data base interface.- Returns:
- the data base interface
-
getAttachmentAccessInterface
Gets the attachment access interface.- Returns:
- the attachment access interface
-
getDataFileAccessInterface
Gets the data file access interface.- Specified by:
getDataFileAccessInterfacein interfaceMasterInterface- Returns:
- the data file access interface
-
getEventScriptContent
Gets the event script content.- Returns:
- the event script content
-
getDestination
Gets the destination.- Specified by:
getDestinationin interfaceMasterInterface- Parameters:
name- the name- Returns:
- the destination
-
isValidDataFile
public boolean isValidDataFile(boolean isProxy, long dataFileId) 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. In case of error, the data file is considered as valid to avoid its deletion.- Specified by:
isValidDataFilein interfaceMasterInterface- Parameters:
isProxy- the is proxydataFileId- the data file id- Returns:
- true, if is valid data file
-
getIncomingUserHash
Gets the incoming user hash.- Specified by:
getIncomingUserHashin interfaceMasterInterface- Parameters:
incomingUser- the incoming user- Returns:
- the incoming user hash
-
isAnonymousIncomingUser
Check whether an IncomingUser is configured for anonymous (password-free) access.- Specified by:
isAnonymousIncomingUserin interfaceMasterInterface- Parameters:
incomingUser- the incoming user name- Returns:
- true if the user exists and has portal service set to open-access
-
getIncomingConnectionCount
Get the current number of active connections for the specified incoming user across all data movers.- Specified by:
getIncomingConnectionCountin interfaceMasterInterface- Parameters:
incomingUser- the incoming user name- Returns:
- the active connection count
-
getPortalBytesUsed
Returns the total bytes transferred by the given portal user within the specified rolling window (milliseconds).- Specified by:
getPortalBytesUsedin interfaceMasterInterface- Parameters:
userId- the user idupload- true for upload bytes, false for download byteswindowMs- the rolling window in milliseconds- Returns:
- total bytes within the window, or 0 if none recorded
- Throws:
RemoteException- if the call fails
-
getPortalTraffic
Description copied from interface:MasterInterfaceGets portal traffic statistics. Returns minute-bucket rows for the given user (or all users if userId is empty), covering the specified number of hours back from now.- Specified by:
getPortalTrafficin interfaceMasterInterface- Parameters:
userId- the incoming user ID, or empty string for system-widehours- how many hours of history to return- Returns:
- list of PortalTraffic rows ordered by time descending
- Throws:
RemoteException- the remote exception
-
getS3AuthorizationSignature
public byte[] getS3AuthorizationSignature(String incomingUser, String prefix, String data, String algorithm) Gets the s 3 authorization signature.- Specified by:
getS3AuthorizationSignaturein interfaceMasterInterface- Parameters:
incomingUser- the incoming userprefix- the prefixdata- the dataalgorithm- the algorithm- Returns:
- the s 3 authorization signature
-
releaseConnectionSlot
Gets the incoming profile.- Specified by:
releaseConnectionSlotin interfaceMasterInterface- Parameters:
incomingUser- the incoming userincomingPassword- the incoming passwordfrom- the from- Throws:
RemoteException- the remote exception
-
getIncomingProfile
public IncomingProfile getIncomingProfile(String incomingUser, String incomingPassword, String from) throws RemoteException Gets the incoming profile.- Specified by:
getIncomingProfilein interfaceMasterInterface- Parameters:
incomingUser- the incoming userincomingPassword- the incoming passwordfrom- the from- Returns:
- the incoming profile
- Throws:
RemoteException- the remote exception
-
getIncomingProfileNoAuth
Returns a fresh IncomingProfile for an already-authenticated user without re-running credential validation, TOTP, connection-count checks, or last-login updates. Returns a fresh IncomingProfile for an already-authenticated user without re-running credential validation, TOTP, connection-count checks, or last-login updates.- Specified by:
getIncomingProfileNoAuthin interfaceMasterInterface- Parameters:
incomingUser- the incoming user id- Returns:
- the incoming profile
- Throws:
RemoteException- the remote 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 data base.- Specified by:
purgeDataBasein 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
public String getReport(Host host) throws DataBaseException, IOException, TransferServerProvider.TransferServerException 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.TransferServerProvider.TransferServerException
-
isAcquisitionRunning
Check whether the acquisition scheduler currently has a live thread running for the specified Host.- Parameters:
host- the host- Returns:
- true if an acquisition thread for this host is active right now
-
triggerAcquisition
Trigger acquisition for the specified Host immediately by resetting the acquisition time, causing the AcquisitionScheduler to pick it up on its next cycle. Does nothing if the host is already running.- Parameters:
host- the host- Throws:
DataBaseException- if the database update fails
-
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.
-
execDirScript
public String execDirScript(Host host, String script) throws IOException, TransferServerProvider.TransferServerException, DataBaseException Execute a Directory script on the appropriate DataMover and return the GZIPped result.- Parameters:
host- the host whose transfer group is used to select a DataMoverscript- the script content (e.g. "python:..." or "js:...")- Returns:
- a GZIPped input stream containing the script output
- Throws:
IOException- Signals that an I/O exception has occurred.TransferServerProvider.TransferServerException- if no DataMover is available in the host's transfer groupDataBaseException- the data base exception
-
resolveDirText
Resolve all static placeholder tokens in a plain-text Directory field and return the resolved text. Substitutes $host[...], $transferMethod[...], $ectransModule[...] and $date/$dirdate date tokens using the current date. Does not require a DataMover — runs entirely on the MasterServer.- Parameters:
host- the host whose fields are used for substitutiontext- the plain-text directory content- Returns:
- the resolved text
- Throws:
DataBaseException- the data base exception
-
resolveAcqOutput
Resolve acquisition-format output for preview. Processes each line by:- Stripping a leading
[key=value;...]options block and extractingdateformat/datedeltafrom it. - Resolving
$date/$dirdatetokens using those per-line options (with token-level inline params taking precedence). - Stripping a trailing
{regex}filter suffix — it is the filename filter used by the AcquisitionScheduler and is not part of the path.
resolveDirText(Directory field preview) and byTestScriptAction(Python/JS script output preview).- Parameters:
text- the raw multi-line acquisition output- Returns:
- the cleaned, date-resolved text ready for the Preview mechanism
- Stripping a leading
-
fetchUrlContent
public String fetchUrlContent(Host host, String source, int maxBytes) throws IOException, TransferServerProvider.TransferServerException, DataBaseException Fetch the raw content of a remote URL/path via the host's configured ECtrans module on a DataMover. Routes through TransferScheduler to pick a DataMover from the host's transfer group — same path as production retrieval.- Parameters:
host- the host whose ECtrans module is used for retrievalsource- the remote URL or path to retrievemaxBytes- maximum number of bytes to return- Returns:
- the content as a UTF-8 string (truncated if needed)
- Throws:
IOException- if no DataMover is available or retrieval failsTransferServerProvider.TransferServerException- the transfer server exceptionDataBaseException- the data base exception
-
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.- Specified by:
updateIncomingConnectionIdsin 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
-
computeAllVolumeUsageAndMovers
public MasterServer.VolumeUsageResult[] computeAllVolumeUsageAndMovers(TransferGroup group) throws RemoteException Computes aggregated volume usage for the given transfer group in a single pass over all data movers, returning oneMasterServer.VolumeUsageResultper volume index.Contacts each data mover in the group exactly once and builds all per-volume sorted-mover lists in a single in-memory pass. The result is a
VolumeUsageResult[]where indexicontains the aggregated usage and the list of movers sorted by ascending used space on volumei.All returned
MasterServer.VolumeUsageResultentries share the sameaggregatedUsagearray reference — it is safe to read but must not be mutated by callers.- Parameters:
group- the transfer group whose data movers are queried- Returns:
- an array of
MasterServer.VolumeUsageResultwith one entry per volume index; may be empty if no movers responded with valid data - Throws:
RemoteException- if a remote communication error occurs while querying a data mover
-
getMoverVolumeSnapshot
Returns a snapshot of the per-volume disk usage for one or all DataMovers, sourced from the in-memory cache populated by the background polling cycle.Each entry maps a DataMover name to the
long[2][volumeCount]array last received from that mover:[0][i]= used bytes on volumei,[1][i]= total bytes.- Parameters:
moverName- the DataMover name to query, ornullfor all movers- Returns:
- a map of mover name to
long[2][volumeCount]; nevernull
-
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, boolean addHistory) throws MasterException Update transfer status.- Parameters:
id- the idcode- the codecommit- the commitusername- the usernamebyAndFrom- the commentsynchronous- the synchronousreset- the resetaddHistory- the add history- 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, boolean addHistory) throws MasterException Update transfer status.- Parameters:
transfer- the transfercode- the codecommit- the commitusername- the usernamebyAndFrom- the commentsynchronous- the synchronousreset- the resetaddHistory- the add history- 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
-
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
Called when a ProxyHost sends an update to the Master.- Specified by:
proxyHostIsAlivein interfaceMasterInterface- Parameters:
name- the name- Returns:
- the long
-
addRoot
Registers a new service root.If the service is a DataMover or DataProxy, the corresponding TransferServer is reset to reflect a potential restart.
For DataMover services, this method also verifies the ECproxy address and port advertised by the mover and optionally updates the database entry if a change is detected.
- Overrides:
addRootin classECaccessProvider- Parameters:
access- the client interface used to communicate with the servicehost- the hostname from which the service is connectingroot- the logical root name identifying the TransferServerservice- the service type (e.g. "DataMover", "DataProxy")
-
removeExpired
Removes the expired.- Overrides:
removeExpiredin classECaccessProvider- Parameters:
root- the rootservice- the service
-
isRegistred
Checks if it is registred. Checks if is registred. Records a heartbeat for DataMover services in the in-memory availability buffer so the MoverAvailabilityScheduler can persist per-minute availability to the database.- Specified by:
isRegistredin interfaceProviderInterface- Overrides:
isRegistredin classECaccessProvider- Parameters:
root- the rootservice- the service- Returns:
- the long
-
importECUser
Import EC user.- Specified by:
importECUserin classECaccessServer- Parameters:
uid- the uid- Returns:
- the EC user
- Throws:
EccmdException- the eccmd exceptionRemoteException- the remote exception
-
handleECuserUpdate
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:
handleECuserUpdatein classECaccessServer- Parameters:
ecuser- the ecuser
-
getMBeanInfo
Gets the MBean info.- Specified by:
getMBeanInfoin interfaceMBeanService- Overrides:
getMBeanInfoin classECaccessServer- Returns:
- the MBean info
-
getAttribute
Gets the attribute.- Specified by:
getAttributein interfaceMBeanService- Overrides:
getAttributein 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.- Specified by:
setAttributein interfaceMBeanService- Overrides:
setAttributein 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.- Specified by:
invokein interfaceMBeanService- Overrides:
invokein 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.- Specified by:
updateDataTransfersin interfaceMasterInterface- Parameters:
transfers- the transfers- Throws:
RemoteException- the remote exception
-
updateDownloadProgress
public DownloadProgress[] updateDownloadProgress(DownloadProgress[] progress) throws RemoteException Update download progress.- Specified by:
updateDownloadProgressin interfaceMasterInterface- Parameters:
progress- the progress- Returns:
- the download progress[]
- Throws:
RemoteException- the remote exception
-
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 to, String cc, String subject, String content, String attachmentName, String attachmentContent) Sends the ecpds message.- Parameters:
to- the tocc- the ccsubject- the subjectcontent- the contentattachmentName- the attachment nameattachmentContent- the attachment content
-
sendECpdsMessage
-
selfRegisterUser
public String selfRegisterUser(String id, String name, String email, String iso) throws DataBaseException, RemoteException Description copied from interface:MasterInterfaceSelf-register a new data portal user (self-service flow). Creates an inactive IncomingUser with portal_service="self-service", generates a verification token stored in INU_VERIFY_TOKEN, and returns the token so the caller can send a verification email.- Specified by:
selfRegisterUserin interfaceMasterInterface- Parameters:
id- the requested usernamename- the user's full name (stored in comment field)email- the user's email addressiso- ISO 3166-1 alpha-2 country code- Returns:
- the generated verification token
- Throws:
DataBaseException- if id already exists or is invalidRemoteException- the remote exception
-
verifyRegistrationToken
public String verifyRegistrationToken(String token, boolean autoApprove) throws DataBaseException, RemoteException Description copied from interface:MasterInterfaceVerify a self-registration token. If autoApprove is true and the token is valid: activates the user, clears the token, generates a random password, and returns "activated:userId:password". If autoApprove is false and the token is valid: marks the email as verified (sets token to "VERIFIED") and returns "verified:userId". Returns "invalid" if the token is not found.- Specified by:
verifyRegistrationTokenin interfaceMasterInterface- Parameters:
token- the verification token from the email linkautoApprove- whether to activate the account immediately- Returns:
- status string: "activated:userId:password", "verified:userId", or "invalid"
- Throws:
DataBaseException- the data base exceptionRemoteException- the remote exception
-
isSubscriberActive
Description copied from interface:MasterInterfaceCheck whether a specific portal subscriber is still active. This is a lightweight single-row lookup by primary key used on every cookie re-auth to detect deactivated subscribers without a full password re-validation.- Specified by:
isSubscriberActivein interfaceMasterInterface- Parameters:
psbId- the PortalSubscriber primary key- Returns:
trueif the subscriber exists andPSB_ACTIVE = true- Throws:
RemoteException- the remote exception
-
findSubscriberIdByPassword
Description copied from interface:MasterInterfaceFind the PSB_ID of the active subscriber that matches the given password for the given IncomingUser. Returns-1if no active subscriber with that password exists (e.g. standard-login or open-access user).- Specified by:
findSubscriberIdByPasswordin interfaceMasterInterface- Parameters:
inuId- the IncomingUser loginpassword- the subscriber password to match- Returns:
- the subscriber's PSB_ID, or
-1if not found - Throws:
RemoteException- the remote exception
-
getPortalSubscriberEmail
Description copied from interface:MasterInterfaceGet the email address of the portal subscriber with the given PSB_ID. Returns an empty string if the subscriber does not exist or has no email recorded.- Specified by:
getPortalSubscriberEmailin interfaceMasterInterface- Parameters:
psbId- the portal subscriber PSB_ID- Returns:
- the subscriber email, or an empty string if not found
- Throws:
RemoteException- the remote exception
-
sendNotificationEmail
Description copied from interface:MasterInterfaceSend an email notification via the MasterServer mail infrastructure.- Specified by:
sendNotificationEmailin interfaceMasterInterface- Parameters:
to- the recipient email addresssubject- the email subjectbody- the HTML email body- Throws:
RemoteException- the remote exception
-
invalidatePortalSessionsForUser
Invalidate all portal HTTPS session cookies for the given data user on all movers. Forces the user (and any subscribers) to re-authenticate on their next request. Call this whenever the user's Portal Service mode or password changes.- Specified by:
invalidatePortalSessionsForUserin interfaceMasterInterface- Parameters:
user- the data user login name- Throws:
RemoteException- the remote exception
-
resolvePortalSessionAcrossMovers
public String resolvePortalSessionAcrossMovers(String token, String excludeMoverName) throws RemoteException Locate a portal session token on any currently connected data mover other than the one named byexcludeMoverName. Used for cross-mover session migration after a load-balancer failover so the user does not have to re-authenticate.The search iterates all active
Searches all active data movers (except the calling one) in parallel for the given portal session token. Returns the first serialised entry found, orTransferServerentries and callsMoverInterface.resolvePortalSession(String)on each (in parallel). The first non-null result is returned immediately.null.- Specified by:
resolvePortalSessionAcrossMoversin interfaceMasterInterface- Parameters:
token- the portal session token to search forexcludeMoverName- the name of the calling mover (skipped to avoid a self-lookup round-trip)- Returns:
- the serialised session entry (
user\tsubscriberId\tsubscriberEmail\texpiryEpochMs), ornullif not found on any mover - Throws:
RemoteException- the remote exception
-
invalidatePortalSessionAcrossMovers
public void invalidatePortalSessionAcrossMovers(String token, String excludeMoverName) throws RemoteException Broadcast a portal session token invalidation to all currently connected data movers except the calling one. Used after a user-initiated logout so that any mover that imported the token via cross-mover session migration also evicts it, preventing the user from remaining logged in if a load-balancer routes their next request to a different mover. Broadcast a portal session token invalidation to all connected data movers except the calling one. Each mover is called in parallel (best-effort); failures are logged but do not propagate so a single unreachable mover does not prevent the others from being notified.- Specified by:
invalidatePortalSessionAcrossMoversin interfaceMasterInterface- Parameters:
token- the portal session token to invalidateexcludeMoverName- the name of the calling mover (already invalidated locally — skipped to avoid a redundant round-trip)- Throws:
RemoteException- the remote exception
-
isAvailable
public long isAvailable()Checks if is available.- Specified by:
isAvailablein interfaceProviderInterface- Returns:
- the long
-
interruptAquisitionFor
This method is called to interrupt the acquisition thread activity for the specified host.- Parameters:
host- the host- Throws:
DataBaseException- the data base exception
-
updateData
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:
updateDatain interfaceMasterInterface- Parameters:
host- the host- Throws:
RemoteException- the remote exception
-
updateData
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:
updateDatain interfaceMasterInterface- Parameters:
hostId- the host iddata- the data- Throws:
RemoteException- the remote exception
-
updateLocation
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:
updateLocationin 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 and at startup). It always forces a GeoIP re-resolution regardless of whether the IP has changed, so that any forced locations added to the[GeoIP]config section are picked up immediately.- Returns:
- the number of hosts processed
-
getECauthToken
Gets the ecauth token.- Specified by:
getECauthTokenin interfaceMasterInterface- Parameters:
user- the user- Returns:
- the ecauth token
- Throws:
RemoteException- the remote exception
-
getETag
Gets the e tag.- Specified by:
getETagin interfaceMasterInterface- Parameters:
dataTransferId- the data transfer id- Returns:
- the e tag
- Throws:
RemoteException- the remote exception
-
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
-
cloneHost
Clone a host without associating it to any destination. Used to duplicate Proxy hosts and any host directly from its own page.- Parameters:
hostName- the name of the host to clone- Returns:
- the new cloned 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 RemoteException Import destination.- Specified by:
importDestinationin interfaceMasterInterface- Parameters:
fromDestination- the from destinationlinkedAssociations- the linked associationscopySharedHost- the copy shared host- Throws:
RemoteException- the remote exception
-
exportDestination
public void exportDestination(String targetMaster, String fromDestination, String toDestinationName, boolean copySharedHost) throws RemoteException, DataBaseException, MalformedURLException, NotBoundException Export destination.- Parameters:
targetMaster- the target master in the form host:fromDestination- the from destinationtoDestinationName- the optional alternative name for the destination on the target master (empty or null to keep the source name)copySharedHost- the copy shared host- Throws:
RemoteException- the remote exceptionDataBaseException- the data base exceptionMalformedURLException- the malformed URL exceptionNotBoundException- the not bound exception
-
updateRemoteTransferStatus
public boolean updateRemoteTransferStatus(String remoteMaster, boolean standby, String destination, String target, String uniqueKey, String status) throws RemoteException, MalformedURLException, NotBoundException 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:
RemoteException- the remote exceptionMalformedURLException- the malformed URL exceptionNotBoundException- the not bound exception
-
updateLocalTransferStatus
public boolean updateLocalTransferStatus(String remoteMaster, boolean standby, String destination, String target, String uniqueKey, String status) throws RemoteException Update local transfer status.- Specified by:
updateLocalTransferStatusin interfaceMasterInterface- Parameters:
remoteMaster- the remote masterstandby- the standbydestination- the destinationtarget- the targetuniqueKey- the unique keystatus- the status- Returns:
- true, if successful
- Throws:
RemoteException- the remote 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 exceptionDataBaseException- the data base exceptionRemoteException- the remote 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.- Specified by:
shutdownin interfaceToBeStarted- Overrides:
shutdownin classECaccessProvider
-
handle
Handle.- Specified by:
handlein interfaceHandlerInterface- Overrides:
handlein classStarterServer- Parameters:
event- the event
-
handle
Handle.- Specified by:
handlein interfaceHandlerInterface- Overrides:
handlein 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
-
getInitialChangeHostEvents
Submit the initial change host events to the handler specified by its target name.- Parameters:
target- the target
-
getRoot
Gets the root.- Specified by:
getRootin interfaceClientInterface- Returns:
- the root
-
getService
Gets the service.- Specified by:
getServicein interfaceClientInterface- Returns:
- the service
-
getPassword
Gets the password.- Specified by:
getPasswordin interfaceClientInterface- Returns:
- the password
-
updatePluginEvents
Update plugin events.- Parameters:
events- the events- Throws:
Exception- the exception
-