Search in sources :

Example 1 with IrodsVersion

use of org.irods.jargon.core.connection.IrodsVersion in project metalnx-web by irods-contrib.

the class IRODSServicesImpl method findIRodsVersion.

@Override
public String findIRodsVersion() throws DataGridConnectionRefusedException {
    String version = "";
    try {
        EnvironmentalInfoAO envInfoAO = irodsAccessObjectFactory.getEnvironmentalInfoAO(irodsAccount);
        IrodsVersion iv = envInfoAO.getIRODSServerPropertiesFromIRODSServer().getIrodsVersion();
        version = String.format("%s.%s.%s", iv.getMajorAsString(), iv.getMinorAsString(), iv.getPatchAsString());
    } catch (JargonException e) {
        logger.error("Could not find iRODS version: ", e);
        if (e.getCause() instanceof ConnectException) {
            throw new DataGridConnectionRefusedException(e.getMessage());
        }
    }
    return version;
}
Also used : EnvironmentalInfoAO(org.irods.jargon.core.pub.EnvironmentalInfoAO) DataGridConnectionRefusedException(com.emc.metalnx.core.domain.exceptions.DataGridConnectionRefusedException) JargonException(org.irods.jargon.core.exception.JargonException) IrodsVersion(org.irods.jargon.core.connection.IrodsVersion) ConnectException(java.net.ConnectException)

Aggregations

DataGridConnectionRefusedException (com.emc.metalnx.core.domain.exceptions.DataGridConnectionRefusedException)1 ConnectException (java.net.ConnectException)1 IrodsVersion (org.irods.jargon.core.connection.IrodsVersion)1 JargonException (org.irods.jargon.core.exception.JargonException)1 EnvironmentalInfoAO (org.irods.jargon.core.pub.EnvironmentalInfoAO)1