+ public Status getStatus() {
+ final Status[] result = new Status[1];
+
+ result[0] = Status.INVALID;
+
+ ConnectActionClientObject action = null;
+ try {
+ Instance.getTraceHandler().trace("Getting remote lib status...");
+ action = new ConnectActionClientObject(host, port, true) {
+ @Override
+ public void action(Version serverVersion) throws Exception {
+ Object rep = send(new Object[] { md5, "PING" });
+ if ("PONG".equals(rep)) {
+ result[0] = Status.READY;
+ } else {
+ result[0] = Status.UNAUTORIZED;
+ }
+ }
+
+ @Override
+ protected void onError(Exception e) {
+ result[0] = Status.UNAVAILABLE;
+ }
+ };
+
+ } catch (UnknownHostException e) {
+ result[0] = Status.INVALID;
+ } catch (IllegalArgumentException e) {
+ result[0] = Status.INVALID;
+ } catch (Exception e) {
+ result[0] = Status.UNAVAILABLE;
+ }
+
+ if (action != null) {
+ try {
+ action.connect();
+ } catch (Exception e) {
+ result[0] = Status.UNAVAILABLE;
+ }
+ }
+
+ Instance.getTraceHandler().trace("Remote lib status: " + result[0]);
+ return result[0];
+ }
+
+ @Override
+ public Image getCover(final String luid) {
+ final Image[] result = new Image[1];