Search in sources :

Example 71 with Connection

use of com.google.cloud.bigquery.connection.v1.Connection in project COSMIC-CryoEM-Gateway by cianfrocco-lab.

the class SFTPFileHandler method moveFile.

public void moveFile(String fileName, String newFileName) throws IOException {
    Connection conn = getConnection();
    SFTPv3Client client = null;
    try {
        client = new SFTPv3Client(conn);
        m_log.debug("Moving " + fileName + " to " + newFileName + " via " + m_host);
        client.mv(fileName, newFileName);
    } catch (SFTPException sftpErr) {
        m_log.debug(sftpErr.getServerErrorMessage() + ": " + sftpErr.getServerErrorCodeVerbose());
        throw sftpErr;
    } finally {
        if (client != null)
            client.close();
        conn.close();
    }
}
Also used : Connection(com.trilead.ssh2.Connection) SFTPv3Client(com.trilead.ssh2.SFTPv3Client) SFTPException(com.trilead.ssh2.SFTPException)

Example 72 with Connection

use of com.google.cloud.bigquery.connection.v1.Connection in project COSMIC-CryoEM-Gateway by cianfrocco-lab.

the class SFTPFileHandler method writeFile.

public void writeFile(String fileName, InputStream inStream) throws IOException {
    Connection conn = getConnection();
    SFTPv3Client client = null;
    try {
        client = new SFTPv3Client(conn);
        writeFile(client, fileName, inStream);
    } finally {
        if (client != null)
            client.close();
        conn.close();
    }
}
Also used : Connection(com.trilead.ssh2.Connection) SFTPv3Client(com.trilead.ssh2.SFTPv3Client)

Example 73 with Connection

use of com.google.cloud.bigquery.connection.v1.Connection in project COSMIC-CryoEM-Gateway by cianfrocco-lab.

the class SFTPFileHandler method getAttributes.

private SFTPv3FileAttributes getAttributes(String fileName) throws IOException {
    Connection conn = getConnection();
    SFTPv3Client client = null;
    try {
        client = new SFTPv3Client(conn);
        return client.stat(fileName);
    } finally {
        if (client != null)
            client.close();
        conn.close();
    }
}
Also used : Connection(com.trilead.ssh2.Connection) SFTPv3Client(com.trilead.ssh2.SFTPv3Client)

Example 74 with Connection

use of com.google.cloud.bigquery.connection.v1.Connection in project COSMIC-CryoEM-Gateway by cianfrocco-lab.

the class SFTPFileHandler method removeFile.

public void removeFile(String fileName) throws IOException {
    Connection conn = getConnection();
    SFTPv3Client client = null;
    try {
        client = new SFTPv3Client(conn);
        client.rm(fileName);
        m_log.debug("Removed " + fileName);
    } finally {
        if (client != null)
            client.close();
        conn.close();
    }
}
Also used : Connection(com.trilead.ssh2.Connection) SFTPv3Client(com.trilead.ssh2.SFTPv3Client)

Example 75 with Connection

use of com.google.cloud.bigquery.connection.v1.Connection in project pinpoint by naver.

the class MethodInvocationHandlerInterceptor method createTrace.

/**
 * Creates the trace.
 *
 * @param target the target
 * @param args the args
 * @return the trace
 */
private Trace createTrace(final Object target, final Object[] args) {
    final Trace trace = traceContext.newTraceObject();
    final Connection connection = RemotingContext.getConnection();
    final String remoteAddress = JbossUtility.fetchRemoteAddress(connection);
    if (trace.canSampled()) {
        final SpanRecorder recorder = trace.getSpanRecorder();
        final String methodName = getMethodName(args);
        recordRootSpan(recorder, methodName, remoteAddress);
        if (isDebug) {
            logger.debug("Trace sampling is true, Recording trace. methodInvoked:{}, remoteAddress:{}", methodName, remoteAddress);
        }
    } else {
        if (isDebug) {
            final String methodName = getMethodName(args);
            logger.debug("Trace sampling is false, Skip recording trace. methodInvoked:{}, remoteAddress:{}", methodName, remoteAddress);
        }
    }
    return trace;
}
Also used : Trace(com.navercorp.pinpoint.bootstrap.context.Trace) SpanRecorder(com.navercorp.pinpoint.bootstrap.context.SpanRecorder) Connection(org.jboss.remoting3.Connection)

Aggregations

IOException (java.io.IOException)87 Connection (com.trilead.ssh2.Connection)70 Connection (org.ovirt.engine.sdk4.Connection)64 Connection (org.osate.aadl2.Connection)58 Connection (ch.ethz.ssh2.Connection)47 Test (org.junit.Test)35 Session (com.trilead.ssh2.Session)33 Connection (okhttp3.Connection)33 Connection (org.jboss.remoting3.Connection)33 Connection (com.google.cloud.bigquery.connection.v1.Connection)31 InputStream (java.io.InputStream)31 VmsService (org.ovirt.engine.sdk4.services.VmsService)30 Vm (org.ovirt.engine.sdk4.types.Vm)30 Request (okhttp3.Request)23 Response (okhttp3.Response)20 Subcomponent (org.osate.aadl2.Subcomponent)20 ArrayList (java.util.ArrayList)19 FeatureGroupConnection (org.osate.aadl2.FeatureGroupConnection)19 VmService (org.ovirt.engine.sdk4.services.VmService)18 ResponseBody (okhttp3.ResponseBody)17