public class com.codahale.metrics.graphite.Graphite extends java.lang.Object implements com.codahale.metrics.graphite.GraphiteSender
{
private final java.lang.String hostname;
private final int port;
private final java.net.InetSocketAddress address;
private final javax.net.SocketFactory socketFactory;
private final java.nio.charset.Charset charset;
private java.net.Socket socket;
private java.io.Writer writer;
private int failures;
private static final org.slf4j.Logger LOGGER;
public void <init>(java.lang.String, int)
{
javax.net.SocketFactory v;
int v;
java.lang.String v;
com.codahale.metrics.graphite.Graphite v;
v := @this: com.codahale.metrics.graphite.Graphite;
v := @parameter: java.lang.String;
v := @parameter: int;
v = staticinvoke <javax.net.SocketFactory: javax.net.SocketFactory getDefault()>();
specialinvoke v.<com.codahale.metrics.graphite.Graphite: void <init>(java.lang.String,int,javax.net.SocketFactory)>(v, v, v);
return;
}
public void <init>(java.lang.String, int, javax.net.SocketFactory)
{
javax.net.SocketFactory v;
java.nio.charset.Charset v;
int v;
java.lang.String v;
com.codahale.metrics.graphite.Graphite v;
v := @this: com.codahale.metrics.graphite.Graphite;
v := @parameter: java.lang.String;
v := @parameter: int;
v := @parameter: javax.net.SocketFactory;
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset UTF_8>;
specialinvoke v.<com.codahale.metrics.graphite.Graphite: void <init>(java.lang.String,int,javax.net.SocketFactory,java.nio.charset.Charset)>(v, v, v, v);
return;
}
public void <init>(java.lang.String, int, javax.net.SocketFactory, java.nio.charset.Charset)
{
com.codahale.metrics.graphite.Graphite v;
java.lang.IllegalArgumentException v, v;
javax.net.SocketFactory v;
java.nio.charset.Charset v;
int v, v;
java.lang.Object v, v;
java.lang.String v;
boolean v;
v := @this: com.codahale.metrics.graphite.Graphite;
v := @parameter: java.lang.String;
v := @parameter: int;
v := @parameter: javax.net.SocketFactory;
v := @parameter: java.nio.charset.Charset;
specialinvoke v.<java.lang.Object: void <init>()>();
if v == null goto label;
v = virtualinvoke v.<java.lang.String: boolean isEmpty()>();
if v == 0 goto label;
label:
v = new java.lang.IllegalArgumentException;
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>("hostname must not be null or empty");
throw v;
label:
if v < 0 goto label;
v = (int) 65535;
if v <= v goto label;
label:
v = new java.lang.IllegalArgumentException;
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>("port must be a valid IP port (0-65535)");
throw v;
label:
v.<com.codahale.metrics.graphite.Graphite: java.lang.String hostname> = v;
v.<com.codahale.metrics.graphite.Graphite: int port> = v;
v.<com.codahale.metrics.graphite.Graphite: java.net.InetSocketAddress address> = null;
v = staticinvoke <java.util.Objects: java.lang.Object requireNonNull(java.lang.Object,java.lang.String)>(v, "socketFactory must not be null");
v.<com.codahale.metrics.graphite.Graphite: javax.net.SocketFactory socketFactory> = v;
v = staticinvoke <java.util.Objects: java.lang.Object requireNonNull(java.lang.Object,java.lang.String)>(v, "charset must not be null");
v.<com.codahale.metrics.graphite.Graphite: java.nio.charset.Charset charset> = v;
return;
}
public void <init>(java.net.InetSocketAddress)
{
javax.net.SocketFactory v;
com.codahale.metrics.graphite.Graphite v;
java.net.InetSocketAddress v;
v := @this: com.codahale.metrics.graphite.Graphite;
v := @parameter: java.net.InetSocketAddress;
v = staticinvoke <javax.net.SocketFactory: javax.net.SocketFactory getDefault()>();
specialinvoke v.<com.codahale.metrics.graphite.Graphite: void <init>(java.net.InetSocketAddress,javax.net.SocketFactory)>(v, v);
return;
}
public void <init>(java.net.InetSocketAddress, javax.net.SocketFactory)
{
javax.net.SocketFactory v;
java.nio.charset.Charset v;
com.codahale.metrics.graphite.Graphite v;
java.net.InetSocketAddress v;
v := @this: com.codahale.metrics.graphite.Graphite;
v := @parameter: java.net.InetSocketAddress;
v := @parameter: javax.net.SocketFactory;
v = <java.nio.charset.StandardCharsets: java.nio.charset.Charset UTF_8>;
specialinvoke v.<com.codahale.metrics.graphite.Graphite: void <init>(java.net.InetSocketAddress,javax.net.SocketFactory,java.nio.charset.Charset)>(v, v, v);
return;
}
public void <init>(java.net.InetSocketAddress, javax.net.SocketFactory, java.nio.charset.Charset)
{
com.codahale.metrics.graphite.Graphite v;
java.net.InetSocketAddress v;
javax.net.SocketFactory v;
java.nio.charset.Charset v;
int v;
java.lang.Object v, v, v;
v := @this: com.codahale.metrics.graphite.Graphite;
v := @parameter: java.net.InetSocketAddress;
v := @parameter: javax.net.SocketFactory;
v := @parameter: java.nio.charset.Charset;
specialinvoke v.<java.lang.Object: void <init>()>();
v.<com.codahale.metrics.graphite.Graphite: java.lang.String hostname> = null;
v = (int) -1;
v.<com.codahale.metrics.graphite.Graphite: int port> = v;
v = staticinvoke <java.util.Objects: java.lang.Object requireNonNull(java.lang.Object,java.lang.String)>(v, "address must not be null");
v.<com.codahale.metrics.graphite.Graphite: java.net.InetSocketAddress address> = v;
v = staticinvoke <java.util.Objects: java.lang.Object requireNonNull(java.lang.Object,java.lang.String)>(v, "socketFactory must not be null");
v.<com.codahale.metrics.graphite.Graphite: javax.net.SocketFactory socketFactory> = v;
v = staticinvoke <java.util.Objects: java.lang.Object requireNonNull(java.lang.Object,java.lang.String)>(v, "charset must not be null");
v.<com.codahale.metrics.graphite.Graphite: java.nio.charset.Charset charset> = v;
return;
}
public void connect() throws java.lang.IllegalStateException, java.io.IOException
{
java.lang.IllegalStateException v;
java.net.Socket v, v;
java.net.InetAddress v, v;
java.nio.charset.Charset v;
int v, v;
java.io.OutputStreamWriter v;
java.lang.String v, v, v, v;
boolean v;
java.io.OutputStream v;
java.io.BufferedWriter v;
com.codahale.metrics.graphite.Graphite v;
java.net.InetSocketAddress v, v;
java.net.UnknownHostException v;
javax.net.SocketFactory v;
v := @this: com.codahale.metrics.graphite.Graphite;
v = virtualinvoke v.<com.codahale.metrics.graphite.Graphite: boolean isConnected()>();
if v == 0 goto label;
v = new java.lang.IllegalStateException;
specialinvoke v.<java.lang.IllegalStateException: void <init>(java.lang.String)>("Already connected");
throw v;
label:
v = v.<com.codahale.metrics.graphite.Graphite: java.net.InetSocketAddress address>;
if v == null goto label;
v = virtualinvoke v.<java.net.InetSocketAddress: java.lang.String getHostName()>();
if v != null goto label;
v = v.<com.codahale.metrics.graphite.Graphite: java.lang.String hostname>;
if v == null goto label;
label:
v = new java.net.InetSocketAddress;
v = v.<com.codahale.metrics.graphite.Graphite: java.lang.String hostname>;
v = v.<com.codahale.metrics.graphite.Graphite: int port>;
specialinvoke v.<java.net.InetSocketAddress: void <init>(java.lang.String,int)>(v, v);
v = v;
label:
v = virtualinvoke v.<java.net.InetSocketAddress: java.net.InetAddress getAddress()>();
if v != null goto label;
v = new java.net.UnknownHostException;
v = virtualinvoke v.<java.net.InetSocketAddress: java.lang.String getHostName()>();
specialinvoke v.<java.net.UnknownHostException: void <init>(java.lang.String)>(v);
throw v;
label:
v = v.<com.codahale.metrics.graphite.Graphite: javax.net.SocketFactory socketFactory>;
v = virtualinvoke v.<java.net.InetSocketAddress: java.net.InetAddress getAddress()>();
v = virtualinvoke v.<java.net.InetSocketAddress: int getPort()>();
v = virtualinvoke v.<javax.net.SocketFactory: java.net.Socket createSocket(java.net.InetAddress,int)>(v, v);
v.<com.codahale.metrics.graphite.Graphite: java.net.Socket socket> = v;
v = new java.io.BufferedWriter;
v = new java.io.OutputStreamWriter;
v = v.<com.codahale.metrics.graphite.Graphite: java.net.Socket socket>;
v = virtualinvoke v.<java.net.Socket: java.io.OutputStream getOutputStream()>();
v = v.<com.codahale.metrics.graphite.Graphite: java.nio.charset.Charset charset>;
specialinvoke v.<java.io.OutputStreamWriter: void <init>(java.io.OutputStream,java.nio.charset.Charset)>(v, v);
specialinvoke v.<java.io.BufferedWriter: void <init>(java.io.Writer)>(v);
v.<com.codahale.metrics.graphite.Graphite: java.io.Writer writer> = v;
return;
}
public boolean isConnected()
{
java.net.Socket v, v, v;
com.codahale.metrics.graphite.Graphite v;
boolean v, v, v;
v := @this: com.codahale.metrics.graphite.Graphite;
v = v.<com.codahale.metrics.graphite.Graphite: java.net.Socket socket>;
if v == null goto label;
v = v.<com.codahale.metrics.graphite.Graphite: java.net.Socket socket>;
v = virtualinvoke v.<java.net.Socket: boolean isConnected()>();
if v == 0 goto label;
v = v.<com.codahale.metrics.graphite.Graphite: java.net.Socket socket>;
v = virtualinvoke v.<java.net.Socket: boolean isClosed()>();
if v != 0 goto label;
v = 1;
goto label;
label:
v = 0;
label:
return v;
}
public void send(java.lang.String, java.lang.String, long) throws java.io.IOException
{
long v;
int v, v;
java.lang.String v, v, v, v, v;
java.io.IOException v;
com.codahale.metrics.graphite.Graphite v;
java.io.Writer v, v, v, v, v, v;
v := @this: com.codahale.metrics.graphite.Graphite;
v := @parameter: java.lang.String;
v := @parameter: java.lang.String;
v := @parameter: long;
label:
v = v.<com.codahale.metrics.graphite.Graphite: java.io.Writer writer>;
v = virtualinvoke v.<com.codahale.metrics.graphite.Graphite: java.lang.String sanitize(java.lang.String)>(v);
virtualinvoke v.<java.io.Writer: void write(java.lang.String)>(v);
v = v.<com.codahale.metrics.graphite.Graphite: java.io.Writer writer>;
virtualinvoke v.<java.io.Writer: void write(int)>(32);
v = v.<com.codahale.metrics.graphite.Graphite: java.io.Writer writer>;
v = virtualinvoke v.<com.codahale.metrics.graphite.Graphite: java.lang.String sanitize(java.lang.String)>(v);
virtualinvoke v.<java.io.Writer: void write(java.lang.String)>(v);
v = v.<com.codahale.metrics.graphite.Graphite: java.io.Writer writer>;
virtualinvoke v.<java.io.Writer: void write(int)>(32);
v = v.<com.codahale.metrics.graphite.Graphite: java.io.Writer writer>;
v = staticinvoke <java.lang.Long: java.lang.String toString(long)>(v);
virtualinvoke v.<java.io.Writer: void write(java.lang.String)>(v);
v = v.<com.codahale.metrics.graphite.Graphite: java.io.Writer writer>;
virtualinvoke v.<java.io.Writer: void write(int)>(10);
v.<com.codahale.metrics.graphite.Graphite: int failures> = 0;
label:
goto label;
label:
v := @caughtexception;
v = v.<com.codahale.metrics.graphite.Graphite: int failures>;
v = v + 1;
v.<com.codahale.metrics.graphite.Graphite: int failures> = v;
throw v;
label:
return;
catch java.io.IOException from label to label with label;
}
public int getFailures()
{
int v;
com.codahale.metrics.graphite.Graphite v;
v := @this: com.codahale.metrics.graphite.Graphite;
v = v.<com.codahale.metrics.graphite.Graphite: int failures>;
return v;
}
public void flush() throws java.io.IOException
{
java.io.Writer v, v;
com.codahale.metrics.graphite.Graphite v;
v := @this: com.codahale.metrics.graphite.Graphite;
v = v.<com.codahale.metrics.graphite.Graphite: java.io.Writer writer>;
if v == null goto label;
v = v.<com.codahale.metrics.graphite.Graphite: java.io.Writer writer>;
virtualinvoke v.<java.io.Writer: void flush()>();
label:
return;
}
public void close() throws java.io.IOException
{
java.lang.Throwable v, v;
java.net.Socket v, v;
org.slf4j.Logger v, v;
java.io.IOException v, v;
com.codahale.metrics.graphite.Graphite v;
java.io.Writer v, v;
v := @this: com.codahale.metrics.graphite.Graphite;
label:
v = v.<com.codahale.metrics.graphite.Graphite: java.io.Writer writer>;
if v == null goto label;
v = v.<com.codahale.metrics.graphite.Graphite: java.io.Writer writer>;
virtualinvoke v.<java.io.Writer: void close()>();
label:
v.<com.codahale.metrics.graphite.Graphite: java.io.Writer writer> = null;
goto label;
label:
v := @caughtexception;
v = <com.codahale.metrics.graphite.Graphite: org.slf4j.Logger LOGGER>;
interfaceinvoke v.<org.slf4j.Logger: void debug(java.lang.String,java.lang.Throwable)>("Error closing writer", v);
label:
v.<com.codahale.metrics.graphite.Graphite: java.io.Writer writer> = null;
goto label;
label:
v := @caughtexception;
v.<com.codahale.metrics.graphite.Graphite: java.io.Writer writer> = null;
throw v;
label:
v = v.<com.codahale.metrics.graphite.Graphite: java.net.Socket socket>;
if v == null goto label;
v = v.<com.codahale.metrics.graphite.Graphite: java.net.Socket socket>;
virtualinvoke v.<java.net.Socket: void close()>();
label:
v.<com.codahale.metrics.graphite.Graphite: java.net.Socket socket> = null;
goto label;
label:
v := @caughtexception;
v = <com.codahale.metrics.graphite.Graphite: org.slf4j.Logger LOGGER>;
interfaceinvoke v.<org.slf4j.Logger: void debug(java.lang.String,java.lang.Throwable)>("Error closing socket", v);
label:
v.<com.codahale.metrics.graphite.Graphite: java.net.Socket socket> = null;
goto label;
label:
v := @caughtexception;
v.<com.codahale.metrics.graphite.Graphite: java.net.Socket socket> = null;
throw v;
label:
return;
catch java.io.IOException from label to label with label;
catch java.lang.Throwable from label to label with label;
catch java.lang.Throwable from label to label with label;
catch java.io.IOException from label to label with label;
catch java.lang.Throwable from label to label with label;
catch java.lang.Throwable from label to label with label;
}
protected java.lang.String sanitize(java.lang.String)
{
java.lang.String v, v;
com.codahale.metrics.graphite.Graphite v;
v := @this: com.codahale.metrics.graphite.Graphite;
v := @parameter: java.lang.String;
v = staticinvoke <com.codahale.metrics.graphite.GraphiteSanitize: java.lang.String sanitize(java.lang.String)>(v);
return v;
}
static void <clinit>()
{
org.slf4j.Logger v;
v = staticinvoke <org.slf4j.LoggerFactory: org.slf4j.Logger getLogger(java.lang.Class)>(class "Lcom/codahale/metrics/graphite/Graphite;");
<com.codahale.metrics.graphite.Graphite: org.slf4j.Logger LOGGER> = v;
return;
}
}