From 949a1d8baca30819da9863d4166db42abf5aede0 Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 1 Feb 2018 19:33:51 -0800 Subject: [PATCH 1/3] DS2 List Responder (not complete). Use DSByteBuffer instead of java ByteBuffer. --- .../iot/dsa/dslink/io/DSByteBuffer.java | 439 ++++++++---- .../dslink/io/DSSynchronizedByteBuffer.java | 366 ++++++++++ .../protocol_v1/DS1LinkConnection.java | 2 +- .../protocol/protocol_v1/DS1Session.java | 2 +- .../protocol_v1/responder/DS1InboundList.java | 668 +----------------- .../responder/DS1InboundRequest.java | 12 +- .../protocol_v1/responder/DS1Responder.java | 103 ++- .../protocol_v2/DS2MessageWriter.java | 4 +- .../protocol_v2/responder/DS2InboundList.java | 667 +---------------- .../responder/DS2InboundRequest.java | 92 --- .../protocol_v2/responder/DS2Responder.java | 53 +- .../protocol/responder/DSInboundRequest.java | 5 +- .../iot/dsa/dslink/test/TestTransport.java | 189 +---- .../dslink/transport/DSBinaryTransport.java | 16 +- .../dsa/dslink/transport/SocketTransport.java | 34 +- .../org/iot/dsa/io/msgpack/MsgpackWriter.java | 43 +- .../org/iot/dsa/dslink/DSByteBufferTest.java | 67 +- .../java/org/iot/dsa/dslink/MsgpackTest.java | 25 +- .../dslink/websocket/WsBinaryTransport.java | 155 ++-- 19 files changed, 893 insertions(+), 2049 deletions(-) create mode 100644 dslink-core/src/main/java/com/acuity/iot/dsa/dslink/io/DSSynchronizedByteBuffer.java delete mode 100644 dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/responder/DS2InboundRequest.java diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/io/DSByteBuffer.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/io/DSByteBuffer.java index c27f4ccb..deb2963f 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/io/DSByteBuffer.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/io/DSByteBuffer.java @@ -1,10 +1,13 @@ package com.acuity.iot.dsa.dslink.io; +import com.acuity.iot.dsa.dslink.transport.DSBinaryTransport; +import java.io.OutputStream; import java.nio.ByteBuffer; +import org.iot.dsa.util.DSException; /** * A buffer for storing bytes being pushed from an input stream. Useful when bytes are - * coming in faster than can be processed. + * coming in faster than can be processed. This is not synchronized. * * @author Aaron Hansen */ @@ -15,11 +18,8 @@ public class DSByteBuffer { /////////////////////////////////////////////////////////////////////////// private byte[] buffer; - private RuntimeException closeException; private int length = 0; private int offset = 0; - private boolean open = false; - private long timeout = 60000; ///////////////////////////////////////////////////////////////// // Methods - Constructors @@ -38,93 +38,98 @@ public DSByteBuffer(int initialCapacity) { ///////////////////////////////////////////////////////////////// /** - * The number of bytes available for reading. + * Number of bytes available for reading. */ public int available() { return length; } - public synchronized void clear() { + public void clear() { length = 0; offset = 0; - notify(); } /** - * Important for notifying waiting threads. + * Increases the childCount of the buffer to at least the given. */ - public synchronized DSByteBuffer close() { - if (!open) { - return this; + private void growBuffer(int minSize) { + int size = buffer.length; + while (size < minSize) { + size *= 2; } - open = false; - notify(); - return this; + byte[] tmp = new byte[size]; + System.arraycopy(buffer, offset, tmp, 0, length); + buffer = tmp; + offset = 0; } /** - * Important for notifying waiting threads. + * Number of bytes available for reading. */ - public synchronized DSByteBuffer close(RuntimeException toThrow) { - if (!open) { - return this; - } - this.closeException = toThrow; - open = false; - notify(); - return this; + public int length() { + return length; } /** - * Number of millis the read methods will block before throwing an IOException. - * - * @return Zero or less is indefinite. + * Overwrites bytes in the internal buffer, does not change the current length or position. */ - public long getTimeout() { - return timeout; + public void overwrite(int dest, byte b1, byte b2) { + buffer[dest] = b1; + buffer[++dest] = b2; } /** - * Increases the childCount of the buffer to at least the given. + * Overwrites bytes in the internal buffer, does not change the current length or position. */ - private void growBuffer(int minSize) { - int size = buffer.length; - while (size < minSize) { - size *= 2; - } - byte[] tmp = new byte[size]; - System.arraycopy(buffer, offset, tmp, 0, length); - buffer = tmp; - offset = 0; - } - - public boolean isOpen() { - return open; + public void overwrite(int dest, byte b1, byte b2, byte b3, byte b4) { + buffer[dest] = b1; + buffer[++dest] = b2; + buffer[++dest] = b3; + buffer[++dest] = b4; } - public int length() { - return length; + /** + * Overwrites the primitive in the internal buffer. Does not change the buffer length or + * position. + * + * @param dest The offset in the internal buffer to write the bytes. + * @param v The value to encode. + * @param bigEndian Whether to encode in big or little endian byte ordering. + */ + public void overwriteInt(int dest, int v, boolean bigEndian) { + if (bigEndian) { + overwrite(dest, (byte) ((v >>> 24) & 0xFF), + (byte) ((v >>> 16) & 0xFF), + (byte) ((v >>> 8) & 0xFF), + (byte) ((v >>> 0) & 0xFF)); + } else { + overwrite(dest, (byte) ((v >>> 0) & 0xFF), + (byte) ((v >>> 8) & 0xFF), + (byte) ((v >>> 16) & 0xFF), + (byte) ((v >>> 24) & 0xFF)); + } } - public synchronized DSByteBuffer open() { - if (open) { - return this; + /** + * Overwrites the primitive in the internal buffer. Does not change the buffer length or* + * position. + * + * @param dest The offset in the internal buffer to write the bytes. + * @param v The value to encode. + * @param bigEndian Whether to encode in big or little endian byte ordering. + */ + public void overwriteShort(int dest, short v, boolean bigEndian) { + if (bigEndian) { + overwrite(dest, (byte) ((v >>> 8) & 0xFF), (byte) ((v >>> 0) & 0xFF)); + } else { + overwrite(dest, (byte) ((v >>> 0) & 0xFF), (byte) ((v >>> 8) & 0xFF)); } - length = 0; - offset = 0; - open = true; - closeException = null; - notify(); - return this; } /** * Gets the bytes from the given buffer, which will be flipped, then cleared. */ - public synchronized void put(ByteBuffer buf) { - if (!open) { - throw new DSIoException("Closed"); - } + public void put(ByteBuffer buf) { int len = buf.position(); int bufLen = buffer.length; if ((len + length + offset) >= bufLen) { @@ -139,16 +144,12 @@ public synchronized void put(ByteBuffer buf) { buf.get(buffer, length + offset, len); buf.clear(); length += len; - notify(); } /** * Add the byte to the buffer for reading. */ - public synchronized void put(byte b) { - if (!open) { - throw new DSIoException("Closed"); - } + public void put(byte b) { int bufLen = buffer.length; int msgLen = 1; if ((msgLen + length + offset) >= bufLen) { @@ -161,7 +162,74 @@ public synchronized void put(byte b) { } buffer[length + offset] = b; length++; - notify(); + } + + /** + * Add the byte to the buffer for reading. + */ + public void put(byte b1, byte b2) { + int bufLen = buffer.length; + int msgLen = 2; + if ((msgLen + length + offset) >= bufLen) { + if ((msgLen + length) > bufLen) { + growBuffer(msgLen + length); + } else { //offset must be > 0 + System.arraycopy(buffer, offset, buffer, 0, length); + offset = 0; + } + } + int idx = length + offset; + buffer[idx] = b1; + buffer[++idx] = b2; + length += msgLen; + } + + /** + * Add the byte to the buffer for reading. + */ + public void put(byte b1, byte b2, byte b3, byte b4) { + int bufLen = buffer.length; + int msgLen = 4; + if ((msgLen + length + offset) >= bufLen) { + if ((msgLen + length) > bufLen) { + growBuffer(msgLen + length); + } else { //offset must be > 0 + System.arraycopy(buffer, offset, buffer, 0, length); + offset = 0; + } + } + int idx = length + offset; + buffer[idx] = b1; + buffer[++idx] = b2; + buffer[++idx] = b3; + buffer[++idx] = b4; + length += msgLen; + } + + /** + * Add the byte to the buffer for reading. + */ + public void put(byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7, byte b8) { + int bufLen = buffer.length; + int msgLen = 8; + if ((msgLen + length + offset) >= bufLen) { + if ((msgLen + length) > bufLen) { + growBuffer(msgLen + length); + } else { //offset must be > 0 + System.arraycopy(buffer, offset, buffer, 0, length); + offset = 0; + } + } + int idx = length + offset; + buffer[idx] = b1; + buffer[++idx] = b2; + buffer[++idx] = b3; + buffer[++idx] = b4; + buffer[++idx] = b5; + buffer[++idx] = b6; + buffer[++idx] = b7; + buffer[++idx] = b8; + length += msgLen; } /** @@ -169,7 +237,7 @@ public synchronized void put(byte b) { * * @param msg The data source. */ - public synchronized void put(byte[] msg) { + public void put(byte[] msg) { put(msg, 0, msg.length); } @@ -180,10 +248,7 @@ public synchronized void put(byte[] msg) { * @param off The start offset in the buffer to put data. * @param len The maximum number of bytes to read. */ - public synchronized void put(byte[] msg, int off, int len) { - if (!open) { - throw new DSIoException("Closed"); - } + public void put(byte[] msg, int off, int len) { int bufLen = buffer.length; if ((len + length + offset) >= bufLen) { if ((len + length) > bufLen) { //the buffer is too small @@ -195,7 +260,6 @@ public synchronized void put(byte[] msg, int off, int len) { } System.arraycopy(msg, off, buffer, length + offset, len); length += len; - notify(); } /** @@ -204,12 +268,9 @@ public synchronized void put(byte[] msg, int off, int len) { * @param dest The internal destination offset. * @param msg The data source. * @param off The start offset in the msg to put data. - * @param len The maximum number of bytes to read. + * @param len The maximum number of bytes to put. */ - public synchronized void put(int dest, byte[] msg, int off, int len) { - if (!open) { - throw new DSIoException("Closed"); - } + public void put(int dest, byte[] msg, int off, int len) { if (offset > 0) { System.arraycopy(buffer, offset, buffer, 0, length); offset = 0; @@ -225,35 +286,131 @@ public synchronized void put(int dest, byte[] msg, int off, int len) { if ((dest + len) > length) { length += len; } - notify(); } /** - * Returns the next incoming byte, or -1 when end of stream has been reached. + * Encodes the primitive into buffer using big endian encoding. + */ + public void putDouble(double v) { + putDouble(v, true); + } + + /** + * Encodes the primitive into the buffer. * - * @throws DSIoException if there are any issues. + * @param v The value to encode. + * @param bigEndian Whether to encode in big or little endian byte ordering. */ - public synchronized int read() { - while (open && (length == 0)) { - try { - if (timeout > 0) { - wait(timeout); - } else { - wait(); - } - } catch (InterruptedException ignore) { - } + public void putDouble(double v, boolean bigEndian) { + putLong(Double.doubleToRawLongBits(v), bigEndian); + } + + /** + * Encodes the primitive into buffer using big endian encoding. + */ + public void putFloat(float v) { + putFloat(v, true); + } + + /** + * Encodes the primitive into the buffer. + * + * @param v The value to encode. + * @param bigEndian Whether to encode in big or little endian byte ordering. + */ + public void putFloat(float v, boolean bigEndian) { + putInt(Float.floatToIntBits(v), bigEndian); + } + + /** + * Encodes the primitive into buffer using big endian encoding. + */ + public void putInt(int v) { + putInt(v, true); + } + + /** + * Encodes the primitive into buffer. + * + * @param v The value to encode. + * @param bigEndian Whether to encode in big or little endian byte ordering. + */ + public void putInt(int v, boolean bigEndian) { + if (bigEndian) { + put((byte) ((v >>> 24) & 0xFF), + (byte) ((v >>> 16) & 0xFF), + (byte) ((v >>> 8) & 0xFF), + (byte) ((v >>> 0) & 0xFF)); + } else { + put((byte) ((v >>> 0) & 0xFF), + (byte) ((v >>> 8) & 0xFF), + (byte) ((v >>> 16) & 0xFF), + (byte) ((v >>> 24) & 0xFF)); } - notify(); - if (!open) { - if (length == 0) { - if (closeException != null) { - throw closeException; - } - return -1; - } - } else if (length == 0) { - throw new DSIoException("Read timeout"); + } + + /** + * Encodes the primitive into the buffer using big endian encoding. + */ + public void putLong(long v) { + putLong(v, true); + } + + /** + * Encodes the primitive into the buffer. + * + * @param v The value to encode. + * @param bigEndian Whether to encode in big or little endian byte ordering. + */ + public void putLong(long v, boolean bigEndian) { + if (bigEndian) { + put((byte) (v >>> 56), + (byte) (v >>> 48), + (byte) (v >>> 40), + (byte) (v >>> 32), + (byte) (v >>> 24), + (byte) (v >>> 16), + (byte) (v >>> 8), + (byte) (v >>> 0)); + } else { + put((byte) (v >>> 0), + (byte) (v >>> 8), + (byte) (v >>> 16), + (byte) (v >>> 24), + (byte) (v >>> 32), + (byte) (v >>> 40), + (byte) (v >>> 48), + (byte) (v >>> 56)); + } + } + + /** + * Encodes the primitive into the buffer using big endian. + */ + public void putShort(short v) { + putShort(v, true); + } + + /** + * Encodes the primitive into the buffer. + * + * @param v The value to encode. + * @param bigEndian Whether to encode in big or little endian byte ordering. + */ + public void putShort(short v, boolean bigEndian) { + if (bigEndian) { + put((byte) ((v >>> 8) & 0xFF), (byte) ((v >>> 0) & 0xFF)); + } else { + put((byte) ((v >>> 0) & 0xFF), (byte) ((v >>> 8) & 0xFF)); + } + } + + /** + * Returns the next byte in the buffer, or -1 when nothing is available. + */ + public int read() { + if (length == 0) { + return -1; } int ret = buffer[offset]; offset++; @@ -262,35 +419,16 @@ public synchronized int read() { } /** - * Reads incoming bytes into the given buffer. + * Push bytes from the internal buffer to the given buffer. * * @param buf The buffer into which data is read. * @param off The start offset in the buffer to put data. * @param len The maximum number of bytes to read. - * @return The number of bytes read or -1 for end of stream. - * @throws DSIoException if there are any issues. + * @return The number of bytes read. */ - public synchronized int read(byte[] buf, int off, int len) { - while (open && (length < len)) { - try { - if (timeout > 0) { - wait(timeout); - } else { - wait(); - } - } catch (InterruptedException ignore) { - } - } - notify(); - if (!open) { - if (length == 0) { - if (closeException != null) { - throw closeException; - } - return -1; - } - } else if (length == 0) { - throw new DSIoException("Read timeout"); + public int sendTo(byte[] buf, int off, int len) { + if (length == 0) { + return 0; } len = Math.min(len, length); System.arraycopy(buffer, offset, buf, off, len); @@ -304,33 +442,14 @@ public synchronized int read(byte[] buf, int off, int len) { } /** - * Reads incoming bytes into the given buffer. + * Push bytes from the internal buffer to the given buffer. * * @param buf The buffer into which data is read. - * @return The number of bytes read or -1 for end of stream. - * @throws DSIoException if there are any issues. + * @return The number of bytes read. */ - public synchronized int read(ByteBuffer buf) { - while (open && (length == 0)) { - try { - if (timeout > 0) { - wait(timeout); - } else { - wait(); - } - } catch (InterruptedException ignore) { - } - } - notify(); - if (!open) { - if (length == 0) { - if (closeException != null) { - throw closeException; - } - return -1; - } - } else if (length == 0) { - throw new DSIoException("Read timeout"); + public int sendTo(ByteBuffer buf) { + if (length == 0) { + return 0; } int len = Math.min(buf.remaining(), length); buf.put(buffer, offset, len); @@ -344,14 +463,28 @@ public synchronized int read(ByteBuffer buf) { } /** - * Number of millis the read methods will block before throwing an DSIoException. - * - * @param timeout Zero or less for indefinite. - * @return This + * Push bytes from the internal buffer to the transport. */ - public DSByteBuffer setTimeout(long timeout) { - this.timeout = timeout; - return this; + public void sendTo(DSBinaryTransport transport, boolean isLast) { + transport.write(buffer, offset, length, isLast); + offset = 0; + length = 0; + } + + /** + * Push bytes from the internal buffer to the stream. + */ + public void sendTo(OutputStream out) { + if (length == 0) { + return; + } + try { + out.write(buffer, offset, length); + offset = 0; + length = 0; + } catch (Exception x) { + DSException.throwRuntime(x); + } } /** @@ -359,7 +492,7 @@ public DSByteBuffer setTimeout(long timeout) { */ public byte[] toByteArray() { byte[] ret = new byte[length]; - read(ret, 0, length); + sendTo(ret, 0, length); return ret; } diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/io/DSSynchronizedByteBuffer.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/io/DSSynchronizedByteBuffer.java new file mode 100644 index 00000000..50229e73 --- /dev/null +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/io/DSSynchronizedByteBuffer.java @@ -0,0 +1,366 @@ +package com.acuity.iot.dsa.dslink.io; + +import java.nio.ByteBuffer; + +/** + * A buffer for storing bytes being pushed from an input stream. Useful when bytes are + * coming in faster than can be processed. + * + * @author Aaron Hansen + */ +public class DSSynchronizedByteBuffer { + + /////////////////////////////////////////////////////////////////////////// + // Fields + /////////////////////////////////////////////////////////////////////////// + + private byte[] buffer; + private RuntimeException closeException; + private int length = 0; + private int offset = 0; + private boolean open = false; + private long timeout = 60000; + + ///////////////////////////////////////////////////////////////// + // Methods - Constructors + ///////////////////////////////////////////////////////////////// + + public DSSynchronizedByteBuffer() { + this(8192); + } + + public DSSynchronizedByteBuffer(int initialCapacity) { + buffer = new byte[initialCapacity]; + } + + ///////////////////////////////////////////////////////////////// + // Methods - In alphabetical order by method name. + ///////////////////////////////////////////////////////////////// + + /** + * The number of bytes available for reading. + */ + public int available() { + return length; + } + + public synchronized void clear() { + length = 0; + offset = 0; + notify(); + } + + /** + * Important for notifying waiting threads. + */ + public synchronized DSSynchronizedByteBuffer close() { + if (!open) { + return this; + } + open = false; + notify(); + return this; + } + + /** + * Important for notifying waiting threads. + */ + public synchronized DSSynchronizedByteBuffer close(RuntimeException toThrow) { + if (!open) { + return this; + } + this.closeException = toThrow; + open = false; + notify(); + return this; + } + + /** + * Number of millis the read methods will block before throwing an IOException. + * + * @return Zero or less is indefinite. + */ + public long getTimeout() { + return timeout; + } + + /** + * Increases the childCount of the buffer to at least the given. + */ + private void growBuffer(int minSize) { + int size = buffer.length; + while (size < minSize) { + size *= 2; + } + byte[] tmp = new byte[size]; + System.arraycopy(buffer, offset, tmp, 0, length); + buffer = tmp; + offset = 0; + } + + public boolean isOpen() { + return open; + } + + public int length() { + return length; + } + + public synchronized DSSynchronizedByteBuffer open() { + if (open) { + return this; + } + length = 0; + offset = 0; + open = true; + closeException = null; + notify(); + return this; + } + + /** + * Gets the bytes from the given buffer, which will be flipped, then cleared. + */ + public synchronized void put(ByteBuffer buf) { + if (!open) { + throw new DSIoException("Closed"); + } + int len = buf.position(); + int bufLen = buffer.length; + if ((len + length + offset) >= bufLen) { + if ((len + length) > bufLen) { //the buffer is too small + growBuffer(len + length); + } else { //offset must be > 0, shift everything to index 0 + System.arraycopy(buffer, offset, buffer, 0, length); + offset = 0; + } + } + buf.flip(); + buf.get(buffer, length + offset, len); + buf.clear(); + length += len; + notify(); + } + + /** + * Add the byte to the buffer for reading. + */ + public synchronized void put(byte b) { + if (!open) { + throw new DSIoException("Closed"); + } + int bufLen = buffer.length; + int msgLen = 1; + if ((msgLen + length + offset) >= bufLen) { + if ((msgLen + length) > bufLen) { + growBuffer(msgLen + length); + } else { //offset must be > 0 + System.arraycopy(buffer, offset, buffer, 0, length); + offset = 0; + } + } + buffer[length + offset] = b; + length++; + notify(); + } + + /** + * Add bytes to the buffer for reading. + * + * @param msg The data source. + */ + public synchronized void put(byte[] msg) { + put(msg, 0, msg.length); + } + + /** + * Add bytes to the buffer for reading. + * + * @param msg The data source. + * @param off The start offset in the buffer to put data. + * @param len The maximum number of bytes to read. + */ + public synchronized void put(byte[] msg, int off, int len) { + if (!open) { + throw new DSIoException("Closed"); + } + int bufLen = buffer.length; + if ((len + length + offset) >= bufLen) { + if ((len + length) > bufLen) { //the buffer is too small + growBuffer(len + length); + } else { //offset must be > 0, shift everything to index 0 + System.arraycopy(buffer, offset, buffer, 0, length); + offset = 0; + } + } + System.arraycopy(msg, off, buffer, length + offset, len); + length += len; + notify(); + } + + /** + * Overwrite bytes in the internal buffer (which begins at index 0). + * + * @param dest The internal destination offset. + * @param msg The data source. + * @param off The start offset in the msg to put data. + * @param len The maximum number of bytes to read. + */ + public synchronized void put(int dest, byte[] msg, int off, int len) { + if (!open) { + throw new DSIoException("Closed"); + } + if (offset > 0) { + System.arraycopy(buffer, offset, buffer, 0, length); + offset = 0; + } + int newLen = dest + len; + if (newLen >= buffer.length) { + growBuffer(newLen); + } + System.arraycopy(msg, off, buffer, dest, len); + if (newLen > length) { + length = newLen; + } + if ((dest + len) > length) { + length += len; + } + notify(); + } + + /** + * Returns the next incoming byte, or -1 when end of stream has been reached. + * + * @throws DSIoException if there are any issues. + */ + public synchronized int read() { + while (open && (length == 0)) { + try { + if (timeout > 0) { + wait(timeout); + } else { + wait(); + } + } catch (InterruptedException ignore) { + } + } + notify(); + if (!open) { + if (length == 0) { + if (closeException != null) { + throw closeException; + } + return -1; + } + } else if (length == 0) { + throw new DSIoException("Read timeout"); + } + int ret = buffer[offset]; + offset++; + length--; + return ret; + } + + /** + * Reads incoming bytes into the given buffer. + * + * @param buf The buffer into which data is read. + * @param off The start offset in the buffer to put data. + * @param len The maximum number of bytes to read. + * @return The number of bytes read or -1 for end of stream. + * @throws DSIoException if there are any issues. + */ + public synchronized int read(byte[] buf, int off, int len) { + while (open && (length < len)) { + try { + if (timeout > 0) { + wait(timeout); + } else { + wait(); + } + } catch (InterruptedException ignore) { + } + } + notify(); + if (!open) { + if (length == 0) { + if (closeException != null) { + throw closeException; + } + return -1; + } + } else if (length == 0) { + throw new DSIoException("Read timeout"); + } + len = Math.min(len, length); + System.arraycopy(buffer, offset, buf, off, len); + length -= len; + if (length == 0) { + offset = 0; + } else { + offset += len; + } + return len; + } + + /** + * Reads incoming bytes into the given buffer. + * + * @param buf The buffer into which data is read. + * @return The number of bytes read or -1 for end of stream. + * @throws DSIoException if there are any issues. + */ + public synchronized int read(ByteBuffer buf) { + while (open && (length == 0)) { + try { + if (timeout > 0) { + wait(timeout); + } else { + wait(); + } + } catch (InterruptedException ignore) { + } + } + notify(); + if (!open) { + if (length == 0) { + if (closeException != null) { + throw closeException; + } + return -1; + } + } else if (length == 0) { + throw new DSIoException("Read timeout"); + } + int len = Math.min(buf.remaining(), length); + buf.put(buffer, offset, len); + length -= len; + if (length == 0) { + offset = 0; + } else { + offset += len; + } + return len; + } + + /** + * Number of millis the read methods will block before throwing an DSIoException. + * + * @param timeout Zero or less for indefinite. + * @return This + */ + public DSSynchronizedByteBuffer setTimeout(long timeout) { + this.timeout = timeout; + return this; + } + + /** + * Returns a new array. + */ + public byte[] toByteArray() { + byte[] ret = new byte[length]; + read(ret, 0, length); + return ret; + } + +} diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/DS1LinkConnection.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/DS1LinkConnection.java index 15a73dba..6d0a29a1 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/DS1LinkConnection.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/DS1LinkConnection.java @@ -201,7 +201,7 @@ public void onComplete() { x.printStackTrace(); } */ - trans.write(byteBuffer, true); + writeTo(trans); } }; } else if (transport instanceof DSTextTransport) { diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/DS1Session.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/DS1Session.java index aaff50c1..36f7c9ba 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/DS1Session.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/DS1Session.java @@ -337,7 +337,7 @@ protected void processMessages(DSIReader reader, boolean areRequests) { throw new DSProtocolException("Response missing rid"); } if (areRequests) { - responder.processRequest(rid, req); + responder.handleRequest(rid, req); } else { requester.processResponse(rid, req); } diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1InboundList.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1InboundList.java index 99bbb045..72487d90 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1InboundList.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1InboundList.java @@ -1,678 +1,28 @@ package com.acuity.iot.dsa.dslink.protocol.protocol_v1.responder; -import com.acuity.iot.dsa.dslink.protocol.DSStream; import com.acuity.iot.dsa.dslink.protocol.message.ErrorResponse; -import com.acuity.iot.dsa.dslink.protocol.message.MessageWriter; -import com.acuity.iot.dsa.dslink.protocol.message.OutboundMessage; -import com.acuity.iot.dsa.dslink.protocol.message.RequestPath; -import java.util.Iterator; -import org.iot.dsa.DSRuntime; -import org.iot.dsa.dslink.DSIResponder; -import org.iot.dsa.dslink.responder.ApiObject; -import org.iot.dsa.dslink.responder.InboundListRequest; -import org.iot.dsa.dslink.responder.OutboundListResponse; -import org.iot.dsa.io.DSIWriter; -import org.iot.dsa.node.DSElement; -import org.iot.dsa.node.DSIValue; -import org.iot.dsa.node.DSInfo; -import org.iot.dsa.node.DSList; +import com.acuity.iot.dsa.dslink.protocol.responder.DSInboundList; import org.iot.dsa.node.DSMap; -import org.iot.dsa.node.DSMap.Entry; -import org.iot.dsa.node.DSMetadata; -import org.iot.dsa.node.DSNode; -import org.iot.dsa.node.DSPath; -import org.iot.dsa.node.action.ActionSpec; -import org.iot.dsa.node.action.DSAction; -import org.iot.dsa.node.event.DSIEvent; -import org.iot.dsa.node.event.DSISubscriber; -import org.iot.dsa.node.event.DSInfoTopic; -import org.iot.dsa.node.event.DSTopic; /** * List implementation for a responder. * * @author Aaron Hansen */ -class DS1InboundList extends DS1InboundRequest - implements DSISubscriber, DSStream, InboundListRequest, OutboundMessage, - OutboundListResponse, Runnable { +class DS1InboundList extends DSInboundList { - /////////////////////////////////////////////////////////////////////////// - // Constants - /////////////////////////////////////////////////////////////////////////// - - private static final int STATE_INIT = 0; - private static final int STATE_CHILDREN = 1; - private static final int STATE_UPDATES = 2; - private static final int STATE_CLOSE_PENDING = 3; - private static final int STATE_CLOSED = 4; - - /////////////////////////////////////////////////////////////////////////// - // Fields - /////////////////////////////////////////////////////////////////////////// - - private StringBuilder cacheBuf = new StringBuilder(); - private DSMap cacheMap = new DSMap(); - private DSMetadata cacheMeta = new DSMetadata(cacheMap); - private Iterator children; - private Exception closeReason; - private DSInfo info; - private DSNode node; - private OutboundListResponse response; - private boolean enqueued = false; - private int state = STATE_INIT; - private Update updateHead; - private Update updateTail; - - /////////////////////////////////////////////////////////////////////////// - // Constructors - /////////////////////////////////////////////////////////////////////////// - - DS1InboundList() { - } - - /////////////////////////////////////////////////////////////////////////// - // Methods in alphabetical order - /////////////////////////////////////////////////////////////////////////// - - @Override - public void childAdded(ApiObject child) { - if (!isClosed()) { - enqueue(new Update(child, true)); - } - } + private DSMap request; @Override - public void childRemoved(ApiObject child) { - if (!isClosed()) { - enqueue(new Update(child, false)); - } - } - - @Override - public void close() { - if (!isOpen()) { - return; - } - state = STATE_CLOSE_PENDING; - enqueueResponse(); - fine(fine() ? getPath() + " list closed locally" : null); - } - - @Override - public void close(Exception reason) { - if (!isOpen()) { - return; - } - state = STATE_CLOSE_PENDING; - closeReason = reason; - enqueueResponse(); - fine(fine() ? getPath() + " list closed locally" : null); - } - - /** - * Remove an update from the queue. - */ - private synchronized Update dequeue() { - if (updateHead == null) { - return null; - } - Update ret = null; - ret = updateHead; - if (updateHead == updateTail) { - updateHead = null; - updateTail = null; - } else { - updateHead = updateHead.next; - } - ret.next = null; + protected ErrorResponse makeError(Throwable reason) { + ErrorResponse ret = new ErrorResponse(reason); + ret.parseRequest(request); return ret; } - private void doClose() { - state = STATE_CLOSED; - getResponder().removeRequest(getRequestId()); - if (response == null) { - return; - } - DSRuntime.run(new Runnable() { - @Override - public void run() { - try { - response.onClose(); - } catch (Exception x) { - severe(getPath(), x); - } - } - }); - } - - private void encodeChild(ApiObject child, DSIWriter out) { - out.beginList(); - String name = child.getName(); - String displayName = null; - if (DSPath.encodeName(name, cacheBuf)) { - displayName = name; - out.value(cacheBuf.toString()); - } else { - out.value(name); - } - cacheBuf.setLength(0); - out.beginMap(); - child.getMetadata(cacheMap.clear()); - DSElement e = cacheMap.remove(DSMetadata.DISPLAY_NAME); - if (e != null) { - out.key("$name").value(e); - } else if (displayName != null) { - out.key("$name").value(displayName); - } - e = cacheMap.remove("$is"); - if (e != null) { - out.key("$is").value(e); - } else { - out.key("$is").value("node"); - } - if (child.isAction()) { - ActionSpec action = child.getAction(); - e = cacheMap.remove("$invokable"); - if (e != null) { - out.key("$invokable").value(e); - } else { - out.key("$invokable").value(action.getPermission().toString()); - } - } else if (child.isValue()) { - out.key("$type"); - e = cacheMap.remove("$type"); - if (e != null) { - out.value(e); - } else { - encodeType(child.getValue(), cacheMeta, out); - } - if (!child.isReadOnly()) { - e = cacheMap.remove("$writable"); - if (e != null) { - out.key("$writable").value(e); - } else { - out.key("$writable").value(child.isAdmin() ? "config" : "write"); - } - } - } else if (child.isAdmin()) { - e = cacheMap.remove("$permission"); - if (e != null) { - out.key("$permission").value(e); - } else { - out.key("$permission").value("config"); - } - } - out.endMap().endList(); - cacheMap.clear(); - } - - /** - * Encode all the meta data about the root target of a list request. - */ - private void encodeTarget(ApiObject object, DSIWriter out) { - if (object instanceof DSInfo) { - DSMetadata.getMetadata((DSInfo) object, cacheMap.clear()); - } else { - object.getMetadata(cacheMap.clear()); - } - DSElement e = cacheMap.remove("$is"); - if (e == null) { - out.beginList().value("$is").value("node").endList(); - } else { - out.beginList().value("$is").value(e).endList(); - - } - e = cacheMap.get("$name"); - if (e == null) { - String safeName = object.getName(); - if (DSPath.encodeName(safeName, cacheBuf)) { - safeName = cacheBuf.toString(); - } - cacheBuf.setLength(0); - out.beginList().value("$name").value(safeName).endList(); - } else { - out.beginList().value("$name").value(e).endList(); - } - if (object.isAction()) { - encodeTargetAction(object, out); - } else if (object.isValue()) { - encodeTargetValue(object, out); - } else if (object.isAdmin()) { - e = cacheMap.remove("$permission"); - if (e == null) { - out.beginList().value("$permission").value("config").endList(); - } else { - out.beginList().value("$permission").value(e).endList(); - } - } - encodeTargetMetadata(cacheMap, out); - cacheMap.clear(); - } - - /** - * Called by encodeTarget for actions. - */ - private void encodeTargetAction(ApiObject object, DSIWriter out) { - DSInfo info = null; - if (object instanceof DSInfo) { - info = (DSInfo) object; - } - ActionSpec action = object.getAction(); - DSAction dsAction = null; - if (action instanceof DSAction) { - dsAction = (DSAction) action; - } - DSElement e = cacheMap.remove("$invokable"); - out.beginList().value("$invokable"); - if (e == null) { - out.value(action.getPermission().toString()).endList(); - } else { - out.value(e).endList(); - } - e = cacheMap.remove("params"); - out.beginList().value("$params"); - if (e == null) { - out.beginList(); - Iterator params = action.getParameters(); - if (params != null) { - DSMap param; - while (params.hasNext()) { - param = params.next(); - if (dsAction != null) { - dsAction.prepareParameter(info, param); - } - out.value(fixType(param)); - } - } - out.endList(); - } else { - out.value(e); - } - out.endList(); - if (action.getResultType().isValues()) { - e = cacheMap.remove("$columns"); - out.beginList().value("$columns"); - if (e == null) { - out.beginList(); - Iterator params = action.getParameters(); - if (params != null) { - DSMap param; - while (params.hasNext()) { - param = params.next(); - if (dsAction != null) { - dsAction.prepareParameter(info, param); - } - out.value(fixType(param)); - } - } - out.endList(); - } else { - out.value(e); - } - out.endList(); - } - e = cacheMap.remove("$result"); - if (e != null) { - out.beginList().value("$result").value(e).endList(); - } else if (!action.getResultType().isVoid()) { - out.beginList().value("$result").value(action.getResultType().toString()).endList(); - } - } - - /** - * Called by encodeTarget, encodes meta-data as configs. - */ - private void encodeTargetMetadata(DSMap metadata, DSIWriter out) { - if (cacheMap.isEmpty()) { - return; - } - Entry entry; - String name; - for (int i = 0, len = cacheMap.size(); i < len; i++) { - entry = cacheMap.getEntry(i); - out.beginList(); - name = entry.getKey(); - switch (name.charAt(0)) { - case '$': - case '@': - out.value(name); - default: - cacheBuf.append("@"); //TODO ? - DSPath.encodeName(name, cacheBuf); - out.value(cacheBuf.toString()); - cacheBuf.setLength(0); - - } - out.value(entry.getValue()); - out.endList(); - } - } - - /** - * Called by encodeTarget for values. - */ - private void encodeTargetValue(ApiObject object, DSIWriter out) { - DSElement e = cacheMap.remove("$type"); - out.beginList(); - out.value("$type"); - if (e != null) { - out.value(e); - } else { - encodeType(object.getValue(), cacheMeta, out); - } - out.endList(); - e = cacheMap.remove("$writable"); - if (e != null) { - out.beginList() - .value("$writable") - .value(e) - .endList(); - } else if (!object.isReadOnly()) { - out.beginList() - .value("$writable") - .value(object.isAdmin() ? "config" : "write") - .endList(); - } - } - - private void encodeType(DSIValue value, DSMetadata meta, DSIWriter out) { - String type = meta.getType(); - if ((type == null) && (value != null)) { - meta.setType(value); - } - fixType(meta.getMap()); - DSElement e = cacheMap.remove(DSMetadata.TYPE); - if (e == null) { - throw new IllegalArgumentException("Missing type"); - } - out.value(e); - } - - private void encodeUpdate(Update update, DSIWriter out) { - if (!isOpen()) { - return; - } - if (update.added) { - encodeChild(update.child, out); - } else { - out.beginMap(); - out.key("name").value(DSPath.encodeName(update.child.getName())); - out.key("change").value("remove"); - out.endMap(); - } - } - - private void enqueue(Update update) { - if (!isOpen()) { - return; - } - synchronized (this) { - if (updateHead == null) { - updateHead = update; - updateTail = update; - } else { - updateTail.next = update; - updateTail = update; - } - if (enqueued) { - return; - } - } - getResponder().sendResponse(this); - } - - /** - * Enqueues in the session. - */ - private void enqueueResponse() { - synchronized (this) { - if (enqueued) { - return; - } - enqueued = true; - } - getResponder().sendResponse(this); - } - - /** - * Combines boolean and enum ranges into the type name. - */ - private DSMap fixType(DSMap arg) { - String type = arg.getString(DSMetadata.TYPE); - if ("bool".equals(type)) { - DSList range = (DSList) arg.remove(DSMetadata.BOOLEAN_RANGE); - if ((range == null) || (range.size() != 2)) { - return arg; - } else { - cacheBuf.setLength(0); - cacheBuf.append(type); - cacheBuf.append('['); - cacheBuf.append(range.get(0).toString()); - cacheBuf.append(','); - cacheBuf.append(range.get(1).toString()); - cacheBuf.append(']'); - arg.put(DSMetadata.TYPE, cacheBuf.toString()); - } - } else if ("enum".equals(type)) { - DSList range = (DSList) arg.remove(DSMetadata.ENUM_RANGE); - if (range == null) { - return arg; - } - cacheBuf.setLength(0); - cacheBuf.append(type); - cacheBuf.append('['); - for (int i = 0, len = range.size(); i < len; i++) { - if (i > 0) { - cacheBuf.append(','); - } - cacheBuf.append(range.get(i).toString()); - } - cacheBuf.append(']'); - arg.put(DSMetadata.TYPE, cacheBuf.toString()); - } - return arg; - } - - @Override - public ApiObject getTarget() { - return info; - } - - private boolean isClosed() { - return state == STATE_CLOSED; - } - - private boolean isClosePending() { - return state == STATE_CLOSE_PENDING; - } - - /** - * Not closed or closed pending. - */ - @Override - public boolean isOpen() { - return (state != STATE_CLOSE_PENDING) && (state != STATE_CLOSED); - } - - @Override - public void onClose() { - if (node != null) { - node.unsubscribe(DSNode.INFO_TOPIC, null, this); - } - } - - @Override - public void onEvent(DSTopic topic, DSIEvent event, DSNode node, DSInfo child, - Object... params) { - switch ((DSInfoTopic.Event) event) { - case CHILD_ADDED: - childAdded(child); - break; - case CHILD_REMOVED: - childRemoved(child); - break; - case METADATA_CHANGED: //TODO - break; - default: - } - } - - @Override - public void onUnsubscribed(DSTopic topic, DSNode node, DSInfo child) { - close(); - } - - @Override - public void run() { - try { - RequestPath path = new RequestPath(getPath(), getLink()); - if (path.isResponder()) { - DSIResponder responder = (DSIResponder) path.getTarget(); - setPath(path.getPath()); - response = responder.onList(this); - } else { - info = path.getInfo(); - if (info.isNode()) { - node = info.getNode(); - node.subscribe(DSNode.INFO_TOPIC, null, this); - } - response = this; - } - } catch (Exception x) { - severe(getPath(), x); - close(x); - return; - } - if (response == null) { - close(); - } else { - enqueueResponse(); - } - } - - @Override - public void onClose(Integer requestId) { - if (isClosed()) { - return; - } - state = STATE_CLOSED; - fine(finer() ? getPath() + " list closed" : null); - synchronized (this) { - updateHead = updateTail = null; - } - doClose(); - } - - @Override - public void write(MessageWriter writer) { - DSIWriter out = writer.getWriter(); - enqueued = false; - if (isClosed()) { - return; - } - if (isClosePending() && (updateHead == null) && (closeReason != null)) { - ErrorResponse res = new ErrorResponse(closeReason); - res.parseRequest(getRequest()); - res.write(writer); - doClose(); - return; - } - int last = state; - out.beginMap(); - out.key("rid").value(getRequestId()); - switch (state) { - case STATE_INIT: - out.key("updates").beginList(); - writeInit(out); - break; - case STATE_CHILDREN: - out.key("updates").beginList(); - writeChildren(out); - break; - case STATE_CLOSE_PENDING: - case STATE_UPDATES: - out.key("updates").beginList(); - writeUpdates(out); - break; - default: - ; - } - out.endList(); - if ((state != last) && (state == STATE_UPDATES)) { - out.key("stream").value("open"); - } else if (isClosePending() && (updateHead == null)) { - if (closeReason != null) { - ErrorResponse res = new ErrorResponse(closeReason); - res.parseRequest(getRequest()); - getResponder().sendResponse(res); - } else { - out.key("stream").value("closed"); - } - doClose(); - } - out.endMap(); - } - - private void writeChildren(DSIWriter out) { - if (children != null) { - ApiObject child; - while (children.hasNext()) { - child = children.next(); - if (!child.isHidden()) { - encodeChild(child, out); - } - if (getResponder().shouldEndMessage()) { - enqueueResponse(); - return; - } - } - } - children = null; - state = STATE_UPDATES; - } - - private void writeInit(DSIWriter out) { - ApiObject target = response.getTarget(); - encodeTarget(target, out); - if (target.hasChildren()) { - state = STATE_CHILDREN; - children = target.getChildren(); - writeChildren(out); - } else { - state = STATE_UPDATES; - writeUpdates(out); - } - } - - private void writeUpdates(DSIWriter out) { - DS1Responder session = getResponder(); - Update update = dequeue(); - while (update != null) { - encodeUpdate(update, out); - if (session.shouldEndMessage()) { - enqueueResponse(); - break; - } - update = dequeue(); - } - } - - /////////////////////////////////////////////////////////////////////////// - // Inner Classes - /////////////////////////////////////////////////////////////////////////// - - private static class Update { - - boolean added; - ApiObject child; - Update next; - - Update(ApiObject child, boolean added) { - this.child = child; - this.added = added; - } + public DS1InboundList setRequest(DSMap request) { + this.request = request; + return this; } } diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1InboundRequest.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1InboundRequest.java index 40bb5960..d5070b16 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1InboundRequest.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1InboundRequest.java @@ -1,10 +1,8 @@ package com.acuity.iot.dsa.dslink.protocol.protocol_v1.responder; -import com.acuity.iot.dsa.dslink.protocol.protocol_v1.DS1Session; +import com.acuity.iot.dsa.dslink.protocol.message.ErrorResponse; import com.acuity.iot.dsa.dslink.protocol.responder.DSInboundRequest; -import org.iot.dsa.dslink.DSLink; import org.iot.dsa.dslink.responder.InboundRequest; -import org.iot.dsa.logging.DSLogger; import org.iot.dsa.node.DSMap; /** @@ -20,7 +18,13 @@ public DSMap getRequest() { return request; } - public DS1InboundRequest setRequest(DSMap request){ + protected ErrorResponse makeError(Throwable reason) { + ErrorResponse ret = new ErrorResponse(reason); + ret.parseRequest(request); + return ret; + } + + public DS1InboundRequest setRequest(DSMap request) { this.request = request; return this; } diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1Responder.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1Responder.java index 18dde7b6..5ec5f9d5 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1Responder.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1Responder.java @@ -53,59 +53,10 @@ public DS1InboundSubscriptions getSubscriptions() { return subscriptions; } - public void onConnect() { - } - - public void onConnectFail() { - } - - public void onDisconnect() { - finer(finer() ? "Close" : null); - subscriptions.close(); - for (Map.Entry entry : getRequests().entrySet()) { - try { - entry.getValue().onClose(entry.getKey()); - } catch (Exception x) { - finer(finer() ? "Close" : null, x); - } - } - getRequests().clear(); - } - - /** - * Handles an invoke request. - */ - private void processInvoke(Integer rid, DSMap req) { - DS1InboundInvoke invokeImpl = new DS1InboundInvoke(req); - invokeImpl.setRequest(req) - .setPath(getPath(req)) - .setSession(getSession()) - .setRequestId(rid) - .setLink(getLink()) - .setResponder(this); - putRequest(rid, invokeImpl); - DSRuntime.run(invokeImpl); - } - - /** - * Handles a list request. - */ - private void processList(Integer rid, DSMap req) { - DS1InboundList listImpl = new DS1InboundList(); - listImpl.setRequest(req) - .setPath(getPath(req)) - .setSession(getSession()) - .setRequestId(rid) - .setLink(getLink()) - .setResponder(this); - putRequest(listImpl.getRequestId(), listImpl); - DSRuntime.run(listImpl); - } - /** * Process an individual request. */ - public void processRequest(final Integer rid, final DSMap map) { + public void handleRequest(final Integer rid, final DSMap map) { String method = map.get("method", null); try { if ((method == null) || method.isEmpty()) { @@ -123,8 +74,7 @@ public void run() { try { req.onClose(rid); } catch (Exception x) { - getConnection().getLink().getLogger().log( - Level.FINE, getConnection().getConnectionId(), x); + fine(getPath(), x); } } }); @@ -192,6 +142,55 @@ public void run() { } } + public void onConnect() { + } + + public void onConnectFail() { + } + + public void onDisconnect() { + finer(finer() ? "Close" : null); + subscriptions.close(); + for (Map.Entry entry : getRequests().entrySet()) { + try { + entry.getValue().onClose(entry.getKey()); + } catch (Exception x) { + finer(finer() ? "Close" : null, x); + } + } + getRequests().clear(); + } + + /** + * Handles an invoke request. + */ + private void processInvoke(Integer rid, DSMap req) { + DS1InboundInvoke invokeImpl = new DS1InboundInvoke(req); + invokeImpl.setRequest(req) + .setPath(getPath(req)) + .setSession(getSession()) + .setRequestId(rid) + .setLink(getLink()) + .setResponder(this); + putRequest(rid, invokeImpl); + DSRuntime.run(invokeImpl); + } + + /** + * Handles a list request. + */ + private void processList(Integer rid, DSMap req) { + DS1InboundList listImpl = new DS1InboundList(); + listImpl.setRequest(req) + .setPath(getPath(req)) + .setSession(getSession()) + .setRequestId(rid) + .setLink(getLink()) + .setResponder(this); + putRequest(listImpl.getRequestId(), listImpl); + DSRuntime.run(listImpl); + } + /** * Handles a set request. */ diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/DS2MessageWriter.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/DS2MessageWriter.java index 85f94436..fce6282c 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/DS2MessageWriter.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/DS2MessageWriter.java @@ -193,8 +193,8 @@ public byte[] toByteArray() { */ public DS2MessageWriter write(DSBinaryTransport out) { encodeHeaderLengths(); - out.write(header, false); - out.write(body, true); + //TODO out.write(header, false); + //TODO out.write(body, true); return this; } diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/responder/DS2InboundList.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/responder/DS2InboundList.java index 47464244..a1f10ef9 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/responder/DS2InboundList.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/responder/DS2InboundList.java @@ -1,678 +1,29 @@ package com.acuity.iot.dsa.dslink.protocol.protocol_v2.responder; -import com.acuity.iot.dsa.dslink.protocol.DSStream; import com.acuity.iot.dsa.dslink.protocol.message.ErrorResponse; import com.acuity.iot.dsa.dslink.protocol.message.MessageWriter; -import com.acuity.iot.dsa.dslink.protocol.message.OutboundMessage; -import com.acuity.iot.dsa.dslink.protocol.message.RequestPath; -import java.util.Iterator; -import org.iot.dsa.DSRuntime; -import org.iot.dsa.dslink.DSIResponder; -import org.iot.dsa.dslink.responder.ApiObject; -import org.iot.dsa.dslink.responder.InboundListRequest; -import org.iot.dsa.dslink.responder.OutboundListResponse; -import org.iot.dsa.io.DSIWriter; -import org.iot.dsa.node.DSElement; -import org.iot.dsa.node.DSIValue; -import org.iot.dsa.node.DSInfo; -import org.iot.dsa.node.DSList; -import org.iot.dsa.node.DSMap; -import org.iot.dsa.node.DSMap.Entry; -import org.iot.dsa.node.DSMetadata; -import org.iot.dsa.node.DSNode; -import org.iot.dsa.node.DSPath; -import org.iot.dsa.node.action.ActionSpec; -import org.iot.dsa.node.action.DSAction; -import org.iot.dsa.node.event.DSIEvent; -import org.iot.dsa.node.event.DSISubscriber; -import org.iot.dsa.node.event.DSInfoTopic; -import org.iot.dsa.node.event.DSTopic; +import com.acuity.iot.dsa.dslink.protocol.responder.DSInboundList; /** * List implementation for a responder. * * @author Aaron Hansen */ -class DS2InboundList extends DS2InboundRequest - implements DSISubscriber, DSStream, InboundListRequest, OutboundMessage, - OutboundListResponse, Runnable { - - /////////////////////////////////////////////////////////////////////////// - // Constants - /////////////////////////////////////////////////////////////////////////// - - private static final int STATE_INIT = 0; - private static final int STATE_CHILDREN = 1; - private static final int STATE_UPDATES = 2; - private static final int STATE_CLOSE_PENDING = 3; - private static final int STATE_CLOSED = 4; - - /////////////////////////////////////////////////////////////////////////// - // Fields - /////////////////////////////////////////////////////////////////////////// - - private StringBuilder cacheBuf = new StringBuilder(); - private DSMap cacheMap = new DSMap(); - private DSMetadata cacheMeta = new DSMetadata(cacheMap); - private Iterator children; - private Exception closeReason; - private DSInfo info; - private DSNode node; - private OutboundListResponse response; - private boolean enqueued = false; - private int state = STATE_INIT; - private Update updateHead; - private Update updateTail; - - /////////////////////////////////////////////////////////////////////////// - // Constructors - /////////////////////////////////////////////////////////////////////////// - - DS2InboundList() { - } - - /////////////////////////////////////////////////////////////////////////// - // Methods in alphabetical order - /////////////////////////////////////////////////////////////////////////// - - @Override - public void childAdded(ApiObject child) { - if (!isClosed()) { - enqueue(new Update(child, true)); - } - } - - @Override - public void childRemoved(ApiObject child) { - if (!isClosed()) { - enqueue(new Update(child, false)); - } - } - - @Override - public void close() { - if (!isOpen()) { - return; - } - state = STATE_CLOSE_PENDING; - enqueueResponse(); - fine(fine() ? getPath() + " list closed locally" : null); - } +class DS2InboundList extends DSInboundList { @Override - public void close(Exception reason) { - if (!isOpen()) { - return; - } - state = STATE_CLOSE_PENDING; - closeReason = reason; - enqueueResponse(); - fine(fine() ? getPath() + " list closed locally" : null); - } - - /** - * Remove an update from the queue. - */ - private synchronized Update dequeue() { - if (updateHead == null) { - return null; - } - Update ret = null; - ret = updateHead; - if (updateHead == updateTail) { - updateHead = null; - updateTail = null; - } else { - updateHead = updateHead.next; - } - ret.next = null; + protected ErrorResponse makeError(Throwable reason) { + ErrorResponse ret = new ErrorResponse(reason); + //TODO return ret; } - private void doClose() { - state = STATE_CLOSED; - getResponder().removeInboundRequest(getRequestId()); - if (response == null) { - return; - } - DSRuntime.run(new Runnable() { - @Override - public void run() { - try { - response.onClose(); - } catch (Exception x) { - severe(getPath(), x); - } - } - }); - } - - private void encodeChild(ApiObject child, DSIWriter out) { - out.beginList(); - String name = child.getName(); - String displayName = null; - if (DSPath.encodeName(name, cacheBuf)) { - displayName = name; - out.value(cacheBuf.toString()); - } else { - out.value(name); - } - cacheBuf.setLength(0); - out.beginMap(); - child.getMetadata(cacheMap.clear()); - DSElement e = cacheMap.remove(DSMetadata.DISPLAY_NAME); - if (e != null) { - out.key("$name").value(e); - } else if (displayName != null) { - out.key("$name").value(displayName); - } - e = cacheMap.remove("$is"); - if (e != null) { - out.key("$is").value(e); - } else { - out.key("$is").value("node"); - } - if (child.isAction()) { - ActionSpec action = child.getAction(); - e = cacheMap.remove("$invokable"); - if (e != null) { - out.key("$invokable").value(e); - } else { - out.key("$invokable").value(action.getPermission().toString()); - } - } else if (child.isValue()) { - out.key("$type"); - e = cacheMap.remove("$type"); - if (e != null) { - out.value(e); - } else { - encodeType(child.getValue(), cacheMeta, out); - } - if (!child.isReadOnly()) { - e = cacheMap.remove("$writable"); - if (e != null) { - out.key("$writable").value(e); - } else { - out.key("$writable").value(child.isAdmin() ? "config" : "write"); - } - } - } else if (child.isAdmin()) { - e = cacheMap.remove("$permission"); - if (e != null) { - out.key("$permission").value(e); - } else { - out.key("$permission").value("config"); - } - } - out.endMap().endList(); - cacheMap.clear(); - } - - /** - * Encode all the meta data about the root target of a list request. - */ - private void encodeTarget(ApiObject object, DSIWriter out) { - if (object instanceof DSInfo) { - DSMetadata.getMetadata((DSInfo) object, cacheMap.clear()); - } else { - object.getMetadata(cacheMap.clear()); - } - DSElement e = cacheMap.remove("$is"); - if (e == null) { - out.beginList().value("$is").value("node").endList(); - } else { - out.beginList().value("$is").value(e).endList(); - - } - e = cacheMap.get("$name"); - if (e == null) { - String safeName = object.getName(); - if (DSPath.encodeName(safeName, cacheBuf)) { - safeName = cacheBuf.toString(); - } - cacheBuf.setLength(0); - out.beginList().value("$name").value(safeName).endList(); - } else { - out.beginList().value("$name").value(e).endList(); - } - if (object.isAction()) { - encodeTargetAction(object, out); - } else if (object.isValue()) { - encodeTargetValue(object, out); - } else if (object.isAdmin()) { - e = cacheMap.remove("$permission"); - if (e == null) { - out.beginList().value("$permission").value("config").endList(); - } else { - out.beginList().value("$permission").value(e).endList(); - } - } - encodeTargetMetadata(cacheMap, out); - cacheMap.clear(); - } - - /** - * Called by encodeTarget for actions. - */ - private void encodeTargetAction(ApiObject object, DSIWriter out) { - DSInfo info = null; - if (object instanceof DSInfo) { - info = (DSInfo) object; - } - ActionSpec action = object.getAction(); - DSAction dsAction = null; - if (action instanceof DSAction) { - dsAction = (DSAction) action; - } - DSElement e = cacheMap.remove("$invokable"); - out.beginList().value("$invokable"); - if (e == null) { - out.value(action.getPermission().toString()).endList(); - } else { - out.value(e).endList(); - } - e = cacheMap.remove("params"); - out.beginList().value("$params"); - if (e == null) { - out.beginList(); - Iterator params = action.getParameters(); - if (params != null) { - DSMap param; - while (params.hasNext()) { - param = params.next(); - if (dsAction != null) { - dsAction.prepareParameter(info, param); - } - out.value(fixType(param)); - } - } - out.endList(); - } else { - out.value(e); - } - out.endList(); - if (action.getResultType().isValues()) { - e = cacheMap.remove("$columns"); - out.beginList().value("$columns"); - if (e == null) { - out.beginList(); - Iterator params = action.getParameters(); - if (params != null) { - DSMap param; - while (params.hasNext()) { - param = params.next(); - if (dsAction != null) { - dsAction.prepareParameter(info, param); - } - out.value(fixType(param)); - } - } - out.endList(); - } else { - out.value(e); - } - out.endList(); - } - e = cacheMap.remove("$result"); - if (e != null) { - out.beginList().value("$result").value(e).endList(); - } else if (!action.getResultType().isVoid()) { - out.beginList().value("$result").value(action.getResultType().toString()).endList(); - } - } - - /** - * Called by encodeTarget, encodes meta-data as configs. - */ - private void encodeTargetMetadata(DSMap metadata, DSIWriter out) { - if (cacheMap.isEmpty()) { - return; - } - Entry entry; - String name; - for (int i = 0, len = cacheMap.size(); i < len; i++) { - entry = cacheMap.getEntry(i); - out.beginList(); - name = entry.getKey(); - switch (name.charAt(0)) { - case '$': - case '@': - out.value(name); - default: - cacheBuf.append("@"); //TODO ? - DSPath.encodeName(name, cacheBuf); - out.value(cacheBuf.toString()); - cacheBuf.setLength(0); - - } - out.value(entry.getValue()); - out.endList(); - } - } - - /** - * Called by encodeTarget for values. - */ - private void encodeTargetValue(ApiObject object, DSIWriter out) { - DSElement e = cacheMap.remove("$type"); - out.beginList(); - out.value("$type"); - if (e != null) { - out.value(e); - } else { - encodeType(object.getValue(), cacheMeta, out); - } - out.endList(); - e = cacheMap.remove("$writable"); - if (e != null) { - out.beginList() - .value("$writable") - .value(e) - .endList(); - } else if (!object.isReadOnly()) { - out.beginList() - .value("$writable") - .value(object.isAdmin() ? "config" : "write") - .endList(); - } - } - - private void encodeType(DSIValue value, DSMetadata meta, DSIWriter out) { - String type = meta.getType(); - if ((type == null) && (value != null)) { - meta.setType(value); - } - fixType(meta.getMap()); - DSElement e = cacheMap.remove(DSMetadata.TYPE); - if (e == null) { - throw new IllegalArgumentException("Missing type"); - } - out.value(e); - } - - private void encodeUpdate(Update update, DSIWriter out) { - if (!isOpen()) { - return; - } - if (update.added) { - encodeChild(update.child, out); - } else { - out.beginMap(); - out.key("name").value(DSPath.encodeName(update.child.getName())); - out.key("change").value("remove"); - out.endMap(); - } - } - - private void enqueue(Update update) { - if (!isOpen()) { - return; - } - synchronized (this) { - if (updateHead == null) { - updateHead = update; - updateTail = update; - } else { - updateTail.next = update; - updateTail = update; - } - if (enqueued) { - return; - } - } - getResponder().sendResponse(this); - } - - /** - * Enqueues in the session. - */ - private void enqueueResponse() { - synchronized (this) { - if (enqueued) { - return; - } - enqueued = true; - } - getResponder().sendResponse(this); - } - - /** - * Combines boolean and enum ranges into the type name. - */ - private DSMap fixType(DSMap arg) { - String type = arg.getString(DSMetadata.TYPE); - if ("bool".equals(type)) { - DSList range = (DSList) arg.remove(DSMetadata.BOOLEAN_RANGE); - if ((range == null) || (range.size() != 2)) { - return arg; - } else { - cacheBuf.setLength(0); - cacheBuf.append(type); - cacheBuf.append('['); - cacheBuf.append(range.get(0).toString()); - cacheBuf.append(','); - cacheBuf.append(range.get(1).toString()); - cacheBuf.append(']'); - arg.put(DSMetadata.TYPE, cacheBuf.toString()); - } - } else if ("enum".equals(type)) { - DSList range = (DSList) arg.remove(DSMetadata.ENUM_RANGE); - if (range == null) { - return arg; - } - cacheBuf.setLength(0); - cacheBuf.append(type); - cacheBuf.append('['); - for (int i = 0, len = range.size(); i < len; i++) { - if (i > 0) { - cacheBuf.append(','); - } - cacheBuf.append(range.get(i).toString()); - } - cacheBuf.append(']'); - arg.put(DSMetadata.TYPE, cacheBuf.toString()); - } - return arg; - } - - @Override - public ApiObject getTarget() { - return info; - } - - private boolean isClosed() { - return state == STATE_CLOSED; - } - - private boolean isClosePending() { - return state == STATE_CLOSE_PENDING; - } - - /** - * Not closed or closed pending. - */ - @Override - public boolean isOpen() { - return (state != STATE_CLOSE_PENDING) && (state != STATE_CLOSED); - } - - @Override - public void onClose() { - if (node != null) { - node.unsubscribe(DSNode.INFO_TOPIC, null, this); - } - } - - @Override - public void onEvent(DSTopic topic, DSIEvent event, DSNode node, DSInfo child, - Object... params) { - switch ((DSInfoTopic.Event) event) { - case CHILD_ADDED: - childAdded(child); - break; - case CHILD_REMOVED: - childRemoved(child); - break; - case METADATA_CHANGED: //TODO - break; - default: - } - } - - @Override - public void onUnsubscribed(DSTopic topic, DSNode node, DSInfo child) { - close(); - } - - @Override - public void run() { - try { - RequestPath path = new RequestPath(getPath(), getLink()); - if (path.isResponder()) { - DSIResponder responder = (DSIResponder) path.getTarget(); - setPath(path.getPath()); - response = responder.onList(this); - } else { - info = path.getInfo(); - if (info.isNode()) { - node = info.getNode(); - node.subscribe(DSNode.INFO_TOPIC, null, this); - } - response = this; - } - } catch (Exception x) { - severe(getPath(), x); - close(x); - return; - } - if (response == null) { - close(); - } else { - enqueueResponse(); - } - } - - @Override - public void onClose(Integer requestId) { - if (isClosed()) { - return; - } - state = STATE_CLOSED; - fine(finer() ? getPath() + " list closed" : null); - synchronized (this) { - updateHead = updateTail = null; - } - doClose(); - } - @Override public void write(MessageWriter writer) { - DSIWriter out = writer.getWriter(); - enqueued = false; - if (isClosed()) { - return; - } - if (isClosePending() && (updateHead == null) && (closeReason != null)) { - ErrorResponse res = new ErrorResponse(closeReason); - res.parseRequest(getRequest()); - res.write(writer); - doClose(); - return; - } - int last = state; - out.beginMap(); - out.key("rid").value(getRequestId()); - switch (state) { - case STATE_INIT: - out.key("updates").beginList(); - writeInit(out); - break; - case STATE_CHILDREN: - out.key("updates").beginList(); - writeChildren(out); - break; - case STATE_CLOSE_PENDING: - case STATE_UPDATES: - out.key("updates").beginList(); - writeUpdates(out); - break; - default: - ; - } - out.endList(); - if ((state != last) && (state == STATE_UPDATES)) { - out.key("stream").value("open"); - } else if (isClosePending() && (updateHead == null)) { - if (closeReason != null) { - ErrorResponse res = new ErrorResponse(closeReason); - res.parseRequest(getRequest()); - getResponder().sendResponse(res); - } else { - out.key("stream").value("closed"); - } - doClose(); - } - out.endMap(); - } - - private void writeChildren(DSIWriter out) { - if (children != null) { - ApiObject child; - while (children.hasNext()) { - child = children.next(); - if (!child.isHidden()) { - encodeChild(child, out); - } - if (getResponder().shouldEndMessage()) { - enqueueResponse(); - return; - } - } - } - children = null; - state = STATE_UPDATES; - } - - private void writeInit(DSIWriter out) { - ApiObject target = response.getTarget(); - encodeTarget(target, out); - if (target.hasChildren()) { - state = STATE_CHILDREN; - children = target.getChildren(); - writeChildren(out); - } else { - state = STATE_UPDATES; - writeUpdates(out); - } - } - - private void writeUpdates(DSIWriter out) { - DS2Responder session = getResponder(); - Update update = dequeue(); - while (update != null) { - encodeUpdate(update, out); - if (session.shouldEndMessage()) { - enqueueResponse(); - break; - } - update = dequeue(); - } - } - - /////////////////////////////////////////////////////////////////////////// - // Inner Classes - /////////////////////////////////////////////////////////////////////////// - - private static class Update { - - boolean added; - ApiObject child; - Update next; - - Update(ApiObject child, boolean added) { - this.child = child; - this.added = added; - } + //Prep response + //if multipart message, send next part + super.write(writer); + //get bytes determine if multi part message } } diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/responder/DS2InboundRequest.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/responder/DS2InboundRequest.java deleted file mode 100644 index b305257f..00000000 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/responder/DS2InboundRequest.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.acuity.iot.dsa.dslink.protocol.protocol_v2.responder; - -import com.acuity.iot.dsa.dslink.protocol.protocol_v2.DS2Session; -import org.iot.dsa.dslink.DSLink; -import org.iot.dsa.dslink.responder.InboundRequest; -import org.iot.dsa.logging.DSLogger; -import org.iot.dsa.node.DSMap; - -/** - * Getters and setters common to most requests. - * - * @author Aaron Hansen - */ -class DS2InboundRequest extends DSLogger implements InboundRequest { - - /////////////////////////////////////////////////////////////////////////// - // Fields - /////////////////////////////////////////////////////////////////////////// - - private DSLink link; - private String path; - private DSMap request; - private Integer requestId; - private DS2Responder responder; - private DS2Session session; - - /////////////////////////////////////////////////////////////////////////// - // Constructors - /////////////////////////////////////////////////////////////////////////// - - DS2InboundRequest() { - } - - /////////////////////////////////////////////////////////////////////////// - // Methods in alphabetical order - /////////////////////////////////////////////////////////////////////////// - - public DSLink getLink() { - return link; - } - - public String getPath() { - return path; - } - - public DSMap getRequest() { - return request; - } - - public DS2Responder getResponder() { - return responder; - } - - public Integer getRequestId() { - return requestId; - } - - public DS2Session getSession() { - return session; - } - - public DS2InboundRequest setLink(DSLink link) { - this.link = link; - return this; - } - - public DS2InboundRequest setPath(String path) { - this.path = path; - return this; - } - - public DS2InboundRequest setSession(DS2Session session) { - this.session = session; - return this; - } - - public DS2InboundRequest setRequest(DSMap request) { - this.request = request; - return this; - } - - public DS2InboundRequest setRequestId(Integer requestId) { - this.requestId = requestId; - return this; - } - - public DS2InboundRequest setResponder(DS2Responder responder) { - this.responder = responder; - return this; - } - -} diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/responder/DS2Responder.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/responder/DS2Responder.java index a075a49c..6a27c645 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/responder/DS2Responder.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/responder/DS2Responder.java @@ -1,22 +1,17 @@ package com.acuity.iot.dsa.dslink.protocol.protocol_v2.responder; -import com.acuity.iot.dsa.dslink.protocol.DSStream; -import com.acuity.iot.dsa.dslink.protocol.message.OutboundMessage; +import com.acuity.iot.dsa.dslink.protocol.protocol_v2.DS2MessageReader; import com.acuity.iot.dsa.dslink.protocol.protocol_v2.DS2Session; import com.acuity.iot.dsa.dslink.protocol.protocol_v2.MessageConstants; -import com.acuity.iot.dsa.dslink.protocol.protocol_v2.DS2MessageReader; -import java.util.concurrent.ConcurrentHashMap; -import java.util.logging.Logger; +import com.acuity.iot.dsa.dslink.protocol.responder.DSResponder; import org.iot.dsa.DSRuntime; -import org.iot.dsa.dslink.DSLinkConnection; -import org.iot.dsa.node.DSNode; /** * Implements DSA 1.1.2 * * @author Aaron Hansen */ -public class DS2Responder extends DSNode implements MessageConstants { +public class DS2Responder extends DSResponder implements MessageConstants { /////////////////////////////////////////////////////////////////////////// // Constants @@ -26,11 +21,6 @@ public class DS2Responder extends DSNode implements MessageConstants { // Fields /////////////////////////////////////////////////////////////////////////// - private ConcurrentHashMap inboundRequests = - new ConcurrentHashMap(); - private Logger logger; - private DS2Session session; - private DS2Responder responder; //private DS2InboundSubscriptions subscriptions = //new DS2InboundSubscriptions(this); @@ -39,32 +29,13 @@ public class DS2Responder extends DSNode implements MessageConstants { ///////////////////////////////////////////////////////////////// public DS2Responder(DS2Session session) { - this.session = session; + super(session); } ///////////////////////////////////////////////////////////////// // Methods - In alphabetical order by method name. ///////////////////////////////////////////////////////////////// - public DSLinkConnection getConnection() { - return session.getConnection(); - } - - @Override - public Logger getLogger() { - if (logger == null) { - logger = Logger.getLogger( - getConnection().getLink().getLinkName() + ".responderSession"); - } - return logger; - } - - /* - public DS2InboundSubscriptions getSubscriptions() { - return subscriptions; - } - */ - /** * Process an individual request. */ @@ -129,10 +100,10 @@ private void processList(DS2MessageReader msg) { String path = (String) msg.getHeader(HDR_TARGET_PATH); DS2InboundList listImpl = new DS2InboundList(); listImpl.setPath(path) - .setSession(session) + .setSession(getSession()) .setRequestId(rid) .setResponder(this); - inboundRequests.put(listImpl.getRequestId(), listImpl); + putRequest(listImpl.getRequestId(), listImpl); DSRuntime.run(listImpl); } @@ -193,18 +164,6 @@ private void processSubscribe(int rid, DSMap req) { * } */ - void removeInboundRequest(Integer requestId) { - inboundRequests.remove(requestId); - } - - public boolean shouldEndMessage() { - return session.shouldEndMessage(); - } - - public void sendResponse(OutboundMessage res) { - session.enqueueOutgoingResponse(res); - } - /** * Used throughout processRequest. private void throwInvalidMethod(String methodName, DSMap request) { diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/responder/DSInboundRequest.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/responder/DSInboundRequest.java index c76265b3..8ec29dbf 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/responder/DSInboundRequest.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/responder/DSInboundRequest.java @@ -1,6 +1,7 @@ package com.acuity.iot.dsa.dslink.protocol.responder; import com.acuity.iot.dsa.dslink.DSSession; +import com.acuity.iot.dsa.dslink.protocol.message.ErrorResponse; import org.iot.dsa.dslink.DSLink; import org.iot.dsa.dslink.responder.InboundRequest; import org.iot.dsa.logging.DSLogger; @@ -10,7 +11,7 @@ * * @author Aaron Hansen */ -public class DSInboundRequest extends DSLogger implements InboundRequest { +public abstract class DSInboundRequest extends DSLogger implements InboundRequest { /////////////////////////////////////////////////////////////////////////// // Fields @@ -46,6 +47,8 @@ public DSSession getSession() { return session; } + protected abstract ErrorResponse makeError(Throwable reason); + public DSInboundRequest setLink(DSLink link) { this.link = link; return this; diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/test/TestTransport.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/test/TestTransport.java index 7c9e78c4..d68df623 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/test/TestTransport.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/test/TestTransport.java @@ -1,209 +1,36 @@ package com.acuity.iot.dsa.dslink.test; -import com.acuity.iot.dsa.dslink.transport.DSBinaryTransport; -import com.acuity.iot.dsa.dslink.transport.DSTransport; -import java.io.IOException; -import java.io.InputStream; -import java.nio.ByteBuffer; -import org.iot.dsa.dslink.DSLinkConnection; -import com.acuity.iot.dsa.dslink.io.DSByteBuffer; -import com.acuity.iot.dsa.dslink.io.DSIoException; +import com.acuity.iot.dsa.dslink.transport.PushBinaryTransport; /** * Routes requests and responses back to self. * * @author Aaron Hansen */ -public class TestTransport extends DSBinaryTransport { +public class TestTransport extends PushBinaryTransport { /////////////////////////////////////////////////////////////////////////// // Fields /////////////////////////////////////////////////////////////////////////// - private DSByteBuffer buffer = new DSByteBuffer(); - private DSLinkConnection connection; - private String connectionUri; private int messageSize; - private boolean open = false; ///////////////////////////////////////////////////////////////// // Methods - In alphabetical order by method name. ///////////////////////////////////////////////////////////////// - @Override - public DSTransport beginMessage() { - synchronized (buffer) { - while (buffer.available() > 0) { - try { - buffer.wait(1000); - } catch (Exception ignore) { - } - } - } - return this; - } - - @Override - public DSTransport close() { - if (!open) { - return this; - } - open = false; - return this; - } - - @Override - public DSTransport endMessage() { - messageSize = 0; - return this; - } - - @Override - public DSLinkConnection getConnection() { - return connection; - } - - @Override - public InputStream getInput() { - return new MyInputStream(); - } - - @Override - public boolean isOpen() { - return open; - } - @Override public int messageSize() { - return buffer.length(); - } - - @Override - public DSTransport open() { - if (open) { - return this; - } - open = true; - buffer.open(); - return this; - } - - /** - * Returns the nextRun incoming byte, or -1 when end of stream has been reached. - * - * @throws DSIoException if there are any issues. - */ - private int read() { - return buffer.read(); - } - - /** - * Reads incoming bytes into the given buffer. - * - * @param buf The buffer into which data is read. - * @param off The start offset in the buffer to put data. - * @param len The maximum number of bytes to read. - * @return The number of bytes read or -1 for end of stream. - * @throws DSIoException if there are any issues. - */ - private int read(byte[] buf, int off, int len) { - return buffer.read(buf, off, len); - } - - @Override - public DSTransport setConnection(DSLinkConnection connection) { - this.connection = connection; - return this; + return messageSize; } @Override - public DSTransport setConnectionUrl(String uri) { - this.connectionUri = uri; - return this; - } - - @Override - public DSTransport setReadTimeout(long millis) { - buffer.setTimeout(millis); - return this; - } - - @Override - public void write(ByteBuffer buf, boolean isLast) { - buffer.put(buf); - } - - ///////////////////////////////////////////////////////////////// - // Inner Classes - ///////////////////////////////////////////////////////////////// - - private class MyInputStream extends InputStream { - - @Override - public int available() { - return buffer.available(); - } - - @Override - public void close() { - TestTransport.this.close(); - } - - @Override - public int read() throws IOException { - if (!open) { - if (buffer.available() == 0) { - throw new IOException("Closed " + connectionUri); - } - } - return TestTransport.this.read(); + public void write(byte[] buf, int off, int len, boolean isLast) { + messageSize += len; + push(buf, off, len); + if (isLast) { + messageSize = 0; } - - @Override - public int read(byte[] buf) throws IOException { - if (!open) { - if (buffer.available() == 0) { - throw new IOException("Closed " + connectionUri); - } - } - return TestTransport.this.read(buf, 0, buf.length); - } - - @Override - public int read(byte[] buf, int off, int len) throws IOException { - if (!open) { - if (buffer.available() == 0) { - throw new IOException("Closed " + connectionUri); - } - } - return TestTransport.this.read(buf, off, len); - } - } - - /* - private class MyOutputStream extends OutputStream { - - @Override - public void close() { - TestTransport.this.close(); - } - - @Override - public void write(int b) throws IOException { - TestTransport.this.write(b); - } - - @Override - public void write(byte[] buf) throws IOException { - TestTransport.this.write(buf, 0, buf.length, false); - } - - @Override - public void write(byte[] buf, int off, int len) throws IOException { - TestTransport.this.write(buf, off, len, false); - } - } - */ } diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/DSBinaryTransport.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/DSBinaryTransport.java index 99a266f2..492a84d8 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/DSBinaryTransport.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/DSBinaryTransport.java @@ -1,7 +1,6 @@ package com.acuity.iot.dsa.dslink.transport; import java.io.InputStream; -import java.nio.ByteBuffer; /** * Transport that reads and writes binary data. @@ -10,8 +9,21 @@ */ public abstract class DSBinaryTransport extends DSTransport { + /** + * For reading raw bytes from the underlying transport. The DSK does not care about frame + * oriented transports. + */ public abstract InputStream getInput(); - public abstract void write(ByteBuffer buf, boolean isLast); + /** + * Writes bytes to the underlying transport. + * + * @param buf The buffer containing the bytes to write. + * @param off The index in the buffer of the first byte to write. + * @param len The number of bytes to write. + * @param isLast Indicator of end of frame (message) for frame oriented transports such as + * websockets. + */ + public abstract void write(byte[] buf, int off, int len, boolean isLast); } diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/SocketTransport.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/SocketTransport.java index 1cfe4d7e..09166891 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/SocketTransport.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/SocketTransport.java @@ -14,24 +14,15 @@ */ public class SocketTransport extends DSBinaryTransport { - /////////////////////////////////////////////////////////////////////////// - // Constants - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// // Fields /////////////////////////////////////////////////////////////////////////// - private byte[] buffer = new byte[8192]; private int messageSize; private OutputStream out; private boolean open = false; private Socket socket; - ///////////////////////////////////////////////////////////////// - // Methods - Constructors - ///////////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////////////// // Methods - In alphabetical order by method name. ///////////////////////////////////////////////////////////////// @@ -95,10 +86,10 @@ public int messageSize() { @Override public DSTransport open() { + if (open) { + throw new IllegalStateException("Already open"); + } try { - if (open) { - return this; - } socket = new Socket(getConnectionUrl(), 443); open = true; fine(fine() ? "SocketTransport open" : null); @@ -109,26 +100,15 @@ public DSTransport open() { } /** - * Flips the buffer, writes it, then clears it. + * Write the bytes to the socket, isLast is ignored. */ - public void write(ByteBuffer buf, boolean isLast) { - messageSize += buf.position(); + public void write(byte[] buf, int off, int len, boolean isLast) { try { + messageSize += len; if (out == null) { out = socket.getOutputStream(); } - buf.flip(); - int len = buf.remaining(); - while (len > 0) { - len = Math.min(buf.remaining(), buffer.length); - buf.get(buffer, 0, len); - out.write(buffer, 0, len); - len = buf.remaining(); - } - buf.clear(); - if (isLast) { - messageSize = 0; - } + out.write(buf, 0, len); } catch (IOException x) { DSException.throwRuntime(x); } diff --git a/dslink-core/src/main/java/org/iot/dsa/io/msgpack/MsgpackWriter.java b/dslink-core/src/main/java/org/iot/dsa/io/msgpack/MsgpackWriter.java index 6d47e7e4..449e9e4f 100644 --- a/dslink-core/src/main/java/org/iot/dsa/io/msgpack/MsgpackWriter.java +++ b/dslink-core/src/main/java/org/iot/dsa/io/msgpack/MsgpackWriter.java @@ -1,5 +1,7 @@ package org.iot.dsa.io.msgpack; +import com.acuity.iot.dsa.dslink.io.DSByteBuffer; +import com.acuity.iot.dsa.dslink.transport.DSBinaryTransport; import java.io.IOException; import java.io.OutputStream; import java.nio.ByteBuffer; @@ -17,7 +19,7 @@ public class MsgpackWriter extends AbstractWriter implements MsgpackConstants { // Fields // ------ - protected ByteBuffer byteBuffer; + protected DSByteBuffer byteBuffer = new DSByteBuffer(); private CharBuffer charBuffer; private Frame frame; private CharsetEncoder encoder = DSString.UTF8.newEncoder(); @@ -27,11 +29,6 @@ public class MsgpackWriter extends AbstractWriter implements MsgpackConstants { // ------------ public MsgpackWriter() { - byteBuffer = ByteBuffer.allocate(1024 * 64); - } - - public MsgpackWriter(ByteBuffer buffer) { - this.byteBuffer = buffer; } // Methods @@ -105,7 +102,7 @@ private ByteBuffer getStringBuffer(int len) { * Returns the number of bytes in the outgoing byte buffer. */ public int length() { - return byteBuffer.position(); + return byteBuffer.length(); } /** @@ -114,6 +111,10 @@ public int length() { public void onComplete() { } + public byte[] toByteArray() { + return byteBuffer.toByteArray(); + } + @Override protected void writeSeparator() throws IOException { } @@ -237,7 +238,7 @@ protected void writeListStart(int len) throws IOException { this.frame = new Frame(true); if (len < 0) { byteBuffer.put(LIST16); - frame.offset = byteBuffer.position(); + frame.offset = byteBuffer.length(); byteBuffer.putShort((short) 0); } else if (len < (1 << 4)) { byteBuffer.put((byte) (FIXLIST_PREFIX | len)); @@ -270,7 +271,7 @@ protected void writeMapStart(int len) throws IOException { this.frame = new Frame(true); if (len < 0) { byteBuffer.put(MAP16); - frame.offset = byteBuffer.position(); + frame.offset = byteBuffer.length(); byteBuffer.putShort((short) 0); } else if (len < (1 << 4)) { byteBuffer.put((byte) (FIXMAP_PREFIX | len)); @@ -295,8 +296,7 @@ private void writeString(CharSequence arg) throws IOException { CharBuffer chars = getCharBuffer(arg); ByteBuffer strBuffer = getStringBuffer(chars.position() * (int) encoder.maxBytesPerChar()); encoder.encode(chars, strBuffer, false); - strBuffer.flip(); - int len = strBuffer.remaining(); + int len = strBuffer.position(); if (len < (1 << 5)) { byteBuffer.put((byte) (FIXSTR_PREFIX | len)); } else if (len < (1 << 8)) { @@ -317,9 +317,14 @@ private void writeString(CharSequence arg) throws IOException { * Writes the internal buffer to the parameter. The internal buffer will be cleared. */ public void writeTo(ByteBuffer out) { - byteBuffer.flip(); - out.put(byteBuffer); - byteBuffer.clear(); + byteBuffer.sendTo(out); + } + + /** + * Writes the internal buffer to the parameter. The internal buffer will be cleared. + */ + public void writeTo(DSBinaryTransport out) { + byteBuffer.sendTo(out, (frame == null)); } /** @@ -329,12 +334,8 @@ public void writeTo(ByteBuffer out) { */ public void writeTo(OutputStream out) { try { - byteBuffer.flip(); - while (byteBuffer.hasRemaining()) { - out.write(byteBuffer.get()); - } - byteBuffer.clear(); - } catch (IOException x) { + byteBuffer.sendTo(out); + } catch (Exception x) { DSException.throwRuntime(x); } } @@ -372,7 +373,7 @@ boolean isMap() { void writeSize() { if (offset >= 0) { - byteBuffer.putShort(offset, (short) size); + byteBuffer.overwriteShort(offset, (short) size, true); } } } diff --git a/dslink-core/src/test/java/org/iot/dsa/dslink/DSByteBufferTest.java b/dslink-core/src/test/java/org/iot/dsa/dslink/DSByteBufferTest.java index b985425f..51ceabf1 100644 --- a/dslink-core/src/test/java/org/iot/dsa/dslink/DSByteBufferTest.java +++ b/dslink-core/src/test/java/org/iot/dsa/dslink/DSByteBufferTest.java @@ -1,6 +1,7 @@ package org.iot.dsa.dslink; import com.acuity.iot.dsa.dslink.io.DSByteBuffer; +import java.nio.ByteBuffer; import org.junit.Assert; import org.junit.Test; @@ -9,28 +10,14 @@ */ public class DSByteBufferTest { - // Constants - // --------- - - // Fields - // ------ - - // Constructors - // ------------ - - // Methods - // ------- - @Test public void theTest() throws Exception { DSByteBuffer buffer = new DSByteBuffer(5); - Assert.assertFalse(buffer.isOpen()); - buffer.open(); Assert.assertTrue(buffer.available() == 0); byte[] tmp = new byte[]{1, 2, 3, 4, 5}; buffer.put(tmp, 0, tmp.length); Assert.assertTrue(buffer.available() == tmp.length); - int len = buffer.read(tmp, 0, tmp.length); + int len = buffer.sendTo(tmp, 0, tmp.length); Assert.assertTrue(len == tmp.length); Assert.assertArrayEquals(tmp, new byte[]{1, 2, 3, 4, 5}); buffer.put(tmp, 0, tmp.length); @@ -63,8 +50,52 @@ public void theTest() throws Exception { Assert.assertTrue(buffer.read() == 3); } -// Inner Classes -// ------------- -// + @Test + public void comparisonTest() { + ByteBuffer javaBuf = ByteBuffer.allocate(1024); + javaBuf.put((byte) 1); + DSByteBuffer dsBuf = new DSByteBuffer(); + dsBuf.put((byte) 1); + byte[] dsry = dsBuf.toByteArray(); + byte[] jary = toByteArray(javaBuf); + Assert.assertEquals(dsry.length, jary.length); + Assert.assertArrayEquals(dsry, jary); + //double + javaBuf.putDouble(12345.6); + dsBuf.putDouble(12345.6); + dsry = dsBuf.toByteArray(); + jary = toByteArray(javaBuf); + Assert.assertEquals(dsry.length, jary.length); + Assert.assertArrayEquals(dsry, jary); + //int + javaBuf.putInt(12345); + dsBuf.putInt(12345); + dsry = dsBuf.toByteArray(); + jary = toByteArray(javaBuf); + Assert.assertEquals(dsry.length, jary.length); + Assert.assertArrayEquals(dsry, jary); + //long + javaBuf.putLong(12345); + dsBuf.putLong(12345); + dsry = dsBuf.toByteArray(); + jary = toByteArray(javaBuf); + Assert.assertEquals(dsry.length, jary.length); + Assert.assertArrayEquals(dsry, jary); + //short + javaBuf.putShort((short)123); + dsBuf.putShort((short)123); + dsry = dsBuf.toByteArray(); + jary = toByteArray(javaBuf); + Assert.assertEquals(dsry.length, jary.length); + Assert.assertArrayEquals(dsry, jary); + } + + private byte[] toByteArray(ByteBuffer buf) { + byte[] ret = new byte[buf.position()]; + buf.flip(); + buf.get(ret); + buf.clear(); + return ret; + } } diff --git a/dslink-core/src/test/java/org/iot/dsa/dslink/MsgpackTest.java b/dslink-core/src/test/java/org/iot/dsa/dslink/MsgpackTest.java index 489b7a0f..fee041cd 100644 --- a/dslink-core/src/test/java/org/iot/dsa/dslink/MsgpackTest.java +++ b/dslink-core/src/test/java/org/iot/dsa/dslink/MsgpackTest.java @@ -20,18 +20,6 @@ */ public class MsgpackTest { - // Constants - // --------- - - // Fields - // ------ - - // Constructors - // ------------ - - // Methods - // ------- - @Test public void testStrings() throws Exception { String input = "He wes Leovenaðes sone -- liðe him be Drihten."; @@ -63,6 +51,13 @@ public void testStrings() throws Exception { @Test public void theTest() throws Exception { + MsgpackWriter tmp = new MsgpackWriter(); + tmp.beginList(); + tmp.value("abc"); + tmp.endList(); + DSIReader reader = new MsgpackReader(new ByteArrayInputStream(tmp.toByteArray())); + reader.getElement().toList(); + final ByteArrayOutputStream baos1 = new ByteArrayOutputStream(); MsgpackWriter out = new MsgpackWriter(); out.beginList(); @@ -73,9 +68,9 @@ public void theTest() throws Exception { out.value(new DSMap()); out.value(new DSList()); out.endList(); - out.writeTo(baos1); - out.reset(); - byte[] encoded = baos1.toByteArray(); + //out.writeTo(baos1); + //out.reset(); + byte[] encoded = out.toByteArray(); DSIReader parser = new MsgpackReader(new ByteArrayInputStream(encoded)); DSList list = parser.getElement().toList(); parser.close(); diff --git a/dslink-websocket-standalone/src/main/java/org/iot/dsa/dslink/websocket/WsBinaryTransport.java b/dslink-websocket-standalone/src/main/java/org/iot/dsa/dslink/websocket/WsBinaryTransport.java index cf28b342..ad7305f2 100644 --- a/dslink-websocket-standalone/src/main/java/org/iot/dsa/dslink/websocket/WsBinaryTransport.java +++ b/dslink-websocket-standalone/src/main/java/org/iot/dsa/dslink/websocket/WsBinaryTransport.java @@ -1,9 +1,9 @@ package org.iot.dsa.dslink.websocket; -import com.acuity.iot.dsa.dslink.transport.DSBinaryTransport; +import com.acuity.iot.dsa.dslink.io.DSIoException; import com.acuity.iot.dsa.dslink.transport.DSTransport; +import com.acuity.iot.dsa.dslink.transport.PushBinaryTransport; import java.io.IOException; -import java.io.InputStream; import java.net.URI; import java.nio.ByteBuffer; import javax.websocket.ClientEndpoint; @@ -16,8 +16,6 @@ import javax.websocket.RemoteEndpoint; import javax.websocket.Session; import org.glassfish.tyrus.client.ClientManager; -import com.acuity.iot.dsa.dslink.io.DSByteBuffer; -import com.acuity.iot.dsa.dslink.io.DSIoException; import org.iot.dsa.util.DSException; /** @@ -27,67 +25,42 @@ * @author Aaron Hansen */ @ClientEndpoint -public class WsBinaryTransport extends DSBinaryTransport { - - /////////////////////////////////////////////////////////////////////////// - // Constants - /////////////////////////////////////////////////////////////////////////// +public class WsBinaryTransport extends PushBinaryTransport { /////////////////////////////////////////////////////////////////////////// // Fields /////////////////////////////////////////////////////////////////////////// - private DSByteBuffer buffer = new DSByteBuffer(); private ClientManager client; - private InputStream input = new MyInputStream(); private int messageSize; - private boolean open = false; private Session session; - - ///////////////////////////////////////////////////////////////// - // Methods - Constructors - ///////////////////////////////////////////////////////////////// + private ByteBuffer writeBuffer; ///////////////////////////////////////////////////////////////// // Methods - In alphabetical order by method name. ///////////////////////////////////////////////////////////////// - @Override - public DSTransport beginMessage() { - return this; - } - - @Override - public DSTransport close() { - if (!open) { - return this; - } - open = false; - try { - if (session != null) { - session.close(); + /** + * Called by write(), returns a bytebuffer for the given capacity ready for writing + * (putting). Attempts to reuse the same buffer as much as possible. + */ + private ByteBuffer getByteBuffer(int len) { + if (writeBuffer == null) { + int tmp = 16 * 1024; + while (tmp < len) { + tmp += 1024; } - } catch (Exception x) { - finer(getConnection().getConnectionId(), x); + writeBuffer = ByteBuffer.allocate(tmp); + } else if (writeBuffer.capacity() < len) { + int tmp = writeBuffer.capacity(); + while (tmp < len) { + tmp += 1024; + } + writeBuffer = ByteBuffer.allocate(tmp); + } else { + writeBuffer.clear(); } - session = null; - buffer.close(); - return this; - } - - @Override - public DSTransport endMessage() { - return this; - } - - @Override - public InputStream getInput() { - return input; - } - - @Override - public boolean isOpen() { - return open; + return writeBuffer; } public int messageSize() { @@ -96,111 +69,63 @@ public int messageSize() { @OnClose public void onClose(Session session, CloseReason reason) { - if (open) { - info(getConnectionUrl() + " remotely closed, reason = " + reason.toString()); - close(); - } + info(getConnectionUrl() + " remotely closed, reason = " + reason.toString()); + close(); } @OnError public void onError(Session session, Throwable err) { - if (open) { - open = false; - severe(getConnectionUrl(), err); - buffer.close(DSException.makeRuntime(err)); - if (err instanceof RuntimeException) { - buffer.close((RuntimeException) err); - } else { - buffer.close(new DSException(err)); - } - } + close(err); } @OnMessage public void onMessage(Session session, byte[] msgPart, boolean isLast) { - //isLast is ignored because we treat the incoming bytes as a pure stream. - buffer.put(msgPart, 0, msgPart.length); + push(msgPart, 0, msgPart.length); } @OnOpen public void onOpen(Session session, EndpointConfig config) { - open = true; this.session = session; } @Override public DSTransport open() { try { - if (open) { - return this; - } + super.open(); if (client == null) { client = ClientManager.createClient(); } client.connectToServer(this, new URI(getConnectionUrl())); - buffer.open(); - open = true; fine(fine() ? "Transport open" : null); } catch (Exception x) { + close(x); DSException.throwRuntime(x); } return this; } - /** - * Flips the buffer, writes it, then clears it. - */ - public void write(ByteBuffer buf, boolean isLast) { - if (!open) { - throw new DSIoException("Closed " + getConnectionUrl()); + @Override + public void write(byte[] buf, int off, int len, boolean isLast) { + if (!testOpen()) { + throw new DSIoException("Closed"); } - messageSize += buf.position(); + ByteBuffer byteBuffer = getByteBuffer(len); + messageSize += len; try { - buf.flip(); + byteBuffer.put(buf, off, len); + byteBuffer.flip(); RemoteEndpoint.Basic basic = session.getBasicRemote(); - basic.sendBinary(buf, isLast); - buf.clear(); + basic.sendBinary(byteBuffer, isLast); + byteBuffer.clear(); if (isLast) { messageSize = 0; } } catch (IOException x) { - if (open) { + if (isOpen()) { close(); DSException.throwRuntime(x); } } } - ///////////////////////////////////////////////////////////////// - // Inner Classes - ///////////////////////////////////////////////////////////////// - - private class MyInputStream extends InputStream { - - @Override - public int available() { - return buffer.available(); - } - - @Override - public void close() { - WsBinaryTransport.this.close(); - } - - @Override - public int read() throws IOException { - return buffer.read(); - } - - @Override - public int read(byte[] buf) throws IOException { - return buffer.read(buf, 0, buf.length); - } - - @Override - public int read(byte[] buf, int off, int len) throws IOException { - return buffer.read(buf, off, len); - } - } - } From 5a5fce9387c0b8913119217c6d2e864fe4d4cb39 Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 1 Feb 2018 19:49:01 -0800 Subject: [PATCH 2/3] Use DSByteBuffer instead of java ByteBuffer. --- build.gradle | 2 +- .../protocol/responder/DSInboundList.java | 675 ++++++++++++++++++ .../dslink/transport/PushBinaryTransport.java | 183 +++++ .../dsa/dslink/transport/SocketTransport.java | 2 +- 4 files changed, 860 insertions(+), 2 deletions(-) create mode 100644 dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/responder/DSInboundList.java create mode 100644 dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/PushBinaryTransport.java diff --git a/build.gradle b/build.gradle index b68f028f..4d318744 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'java' apply plugin: 'maven' group 'org.iot.dsa' -version '0.16.0' +version '0.17.0' sourceCompatibility = 1.6 targetCompatibility = 1.6 diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/responder/DSInboundList.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/responder/DSInboundList.java new file mode 100644 index 00000000..5121d996 --- /dev/null +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/responder/DSInboundList.java @@ -0,0 +1,675 @@ +package com.acuity.iot.dsa.dslink.protocol.responder; + +import com.acuity.iot.dsa.dslink.protocol.DSStream; +import com.acuity.iot.dsa.dslink.protocol.message.ErrorResponse; +import com.acuity.iot.dsa.dslink.protocol.message.MessageWriter; +import com.acuity.iot.dsa.dslink.protocol.message.OutboundMessage; +import com.acuity.iot.dsa.dslink.protocol.message.RequestPath; +import java.util.Iterator; +import org.iot.dsa.DSRuntime; +import org.iot.dsa.dslink.DSIResponder; +import org.iot.dsa.dslink.responder.ApiObject; +import org.iot.dsa.dslink.responder.InboundListRequest; +import org.iot.dsa.dslink.responder.OutboundListResponse; +import org.iot.dsa.io.DSIWriter; +import org.iot.dsa.node.DSElement; +import org.iot.dsa.node.DSIValue; +import org.iot.dsa.node.DSInfo; +import org.iot.dsa.node.DSList; +import org.iot.dsa.node.DSMap; +import org.iot.dsa.node.DSMap.Entry; +import org.iot.dsa.node.DSMetadata; +import org.iot.dsa.node.DSNode; +import org.iot.dsa.node.DSPath; +import org.iot.dsa.node.action.ActionSpec; +import org.iot.dsa.node.action.DSAction; +import org.iot.dsa.node.event.DSIEvent; +import org.iot.dsa.node.event.DSISubscriber; +import org.iot.dsa.node.event.DSInfoTopic; +import org.iot.dsa.node.event.DSTopic; + +/** + * List implementation for a responder. + * + * @author Aaron Hansen + */ +public abstract class DSInboundList extends DSInboundRequest + implements DSISubscriber, DSStream, InboundListRequest, OutboundMessage, + OutboundListResponse, Runnable { + + /////////////////////////////////////////////////////////////////////////// + // Constants + /////////////////////////////////////////////////////////////////////////// + + private static final int STATE_INIT = 0; + private static final int STATE_CHILDREN = 1; + private static final int STATE_UPDATES = 2; + private static final int STATE_CLOSE_PENDING = 3; + private static final int STATE_CLOSED = 4; + + /////////////////////////////////////////////////////////////////////////// + // Fields + /////////////////////////////////////////////////////////////////////////// + + private StringBuilder cacheBuf = new StringBuilder(); + private DSMap cacheMap = new DSMap(); + private DSMetadata cacheMeta = new DSMetadata(cacheMap); + private Iterator children; + private Exception closeReason; + private DSInfo info; + private DSNode node; + private OutboundListResponse response; + private boolean enqueued = false; + private int state = STATE_INIT; + private Update updateHead; + private Update updateTail; + + /////////////////////////////////////////////////////////////////////////// + // Constructors + /////////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////////////// + // Methods in alphabetical order + /////////////////////////////////////////////////////////////////////////// + + @Override + public void childAdded(ApiObject child) { + if (!isClosed()) { + enqueue(new Update(child, true)); + } + } + + @Override + public void childRemoved(ApiObject child) { + if (!isClosed()) { + enqueue(new Update(child, false)); + } + } + + @Override + public void close() { + if (!isOpen()) { + return; + } + state = STATE_CLOSE_PENDING; + enqueueResponse(); + fine(fine() ? getPath() + " list closed locally" : null); + } + + @Override + public void close(Exception reason) { + if (!isOpen()) { + return; + } + state = STATE_CLOSE_PENDING; + closeReason = reason; + enqueueResponse(); + fine(fine() ? getPath() + " list closed locally" : null); + } + + /** + * Remove an update from the queue. + */ + private synchronized Update dequeue() { + if (updateHead == null) { + return null; + } + Update ret = null; + ret = updateHead; + if (updateHead == updateTail) { + updateHead = null; + updateTail = null; + } else { + updateHead = updateHead.next; + } + ret.next = null; + return ret; + } + + private void doClose() { + state = STATE_CLOSED; + getResponder().removeRequest(getRequestId()); + if (response == null) { + return; + } + DSRuntime.run(new Runnable() { + @Override + public void run() { + try { + response.onClose(); + } catch (Exception x) { + severe(getPath(), x); + } + } + }); + } + + private void encodeChild(ApiObject child, DSIWriter out) { + out.beginList(); + String name = child.getName(); + String displayName = null; + if (DSPath.encodeName(name, cacheBuf)) { + displayName = name; + out.value(cacheBuf.toString()); + } else { + out.value(name); + } + cacheBuf.setLength(0); + out.beginMap(); + child.getMetadata(cacheMap.clear()); + DSElement e = cacheMap.remove(DSMetadata.DISPLAY_NAME); + if (e != null) { + out.key("$name").value(e); + } else if (displayName != null) { + out.key("$name").value(displayName); + } + e = cacheMap.remove("$is"); + if (e != null) { + out.key("$is").value(e); + } else { + out.key("$is").value("node"); + } + if (child.isAction()) { + ActionSpec action = child.getAction(); + e = cacheMap.remove("$invokable"); + if (e != null) { + out.key("$invokable").value(e); + } else { + out.key("$invokable").value(action.getPermission().toString()); + } + } else if (child.isValue()) { + out.key("$type"); + e = cacheMap.remove("$type"); + if (e != null) { + out.value(e); + } else { + encodeType(child.getValue(), cacheMeta, out); + } + if (!child.isReadOnly()) { + e = cacheMap.remove("$writable"); + if (e != null) { + out.key("$writable").value(e); + } else { + out.key("$writable").value(child.isAdmin() ? "config" : "write"); + } + } + } else if (child.isAdmin()) { + e = cacheMap.remove("$permission"); + if (e != null) { + out.key("$permission").value(e); + } else { + out.key("$permission").value("config"); + } + } + out.endMap().endList(); + cacheMap.clear(); + } + + /** + * Encode all the meta data about the root target of a list request. + */ + private void encodeTarget(ApiObject object, DSIWriter out) { + if (object instanceof DSInfo) { + DSMetadata.getMetadata((DSInfo) object, cacheMap.clear()); + } else { + object.getMetadata(cacheMap.clear()); + } + DSElement e = cacheMap.remove("$is"); + if (e == null) { + out.beginList().value("$is").value("node").endList(); + } else { + out.beginList().value("$is").value(e).endList(); + + } + e = cacheMap.get("$name"); + if (e == null) { + String safeName = object.getName(); + if (DSPath.encodeName(safeName, cacheBuf)) { + safeName = cacheBuf.toString(); + } + cacheBuf.setLength(0); + out.beginList().value("$name").value(safeName).endList(); + } else { + out.beginList().value("$name").value(e).endList(); + } + if (object.isAction()) { + encodeTargetAction(object, out); + } else if (object.isValue()) { + encodeTargetValue(object, out); + } else if (object.isAdmin()) { + e = cacheMap.remove("$permission"); + if (e == null) { + out.beginList().value("$permission").value("config").endList(); + } else { + out.beginList().value("$permission").value(e).endList(); + } + } + encodeTargetMetadata(cacheMap, out); + cacheMap.clear(); + } + + /** + * Called by encodeTarget for actions. + */ + private void encodeTargetAction(ApiObject object, DSIWriter out) { + DSInfo info = null; + if (object instanceof DSInfo) { + info = (DSInfo) object; + } + ActionSpec action = object.getAction(); + DSAction dsAction = null; + if (action instanceof DSAction) { + dsAction = (DSAction) action; + } + DSElement e = cacheMap.remove("$invokable"); + out.beginList().value("$invokable"); + if (e == null) { + out.value(action.getPermission().toString()).endList(); + } else { + out.value(e).endList(); + } + e = cacheMap.remove("params"); + out.beginList().value("$params"); + if (e == null) { + out.beginList(); + Iterator params = action.getParameters(); + if (params != null) { + DSMap param; + while (params.hasNext()) { + param = params.next(); + if (dsAction != null) { + dsAction.prepareParameter(info, param); + } + out.value(fixType(param)); + } + } + out.endList(); + } else { + out.value(e); + } + out.endList(); + if (action.getResultType().isValues()) { + e = cacheMap.remove("$columns"); + out.beginList().value("$columns"); + if (e == null) { + out.beginList(); + Iterator params = action.getParameters(); + if (params != null) { + DSMap param; + while (params.hasNext()) { + param = params.next(); + if (dsAction != null) { + dsAction.prepareParameter(info, param); + } + out.value(fixType(param)); + } + } + out.endList(); + } else { + out.value(e); + } + out.endList(); + } + e = cacheMap.remove("$result"); + if (e != null) { + out.beginList().value("$result").value(e).endList(); + } else if (!action.getResultType().isVoid()) { + out.beginList().value("$result").value(action.getResultType().toString()).endList(); + } + } + + /** + * Called by encodeTarget, encodes meta-data as configs. + */ + private void encodeTargetMetadata(DSMap metadata, DSIWriter out) { + if (cacheMap.isEmpty()) { + return; + } + Entry entry; + String name; + for (int i = 0, len = cacheMap.size(); i < len; i++) { + entry = cacheMap.getEntry(i); + out.beginList(); + name = entry.getKey(); + switch (name.charAt(0)) { + case '$': + case '@': + out.value(name); + default: + cacheBuf.append("@"); //TODO ? + DSPath.encodeName(name, cacheBuf); + out.value(cacheBuf.toString()); + cacheBuf.setLength(0); + + } + out.value(entry.getValue()); + out.endList(); + } + } + + /** + * Called by encodeTarget for values. + */ + private void encodeTargetValue(ApiObject object, DSIWriter out) { + DSElement e = cacheMap.remove("$type"); + out.beginList(); + out.value("$type"); + if (e != null) { + out.value(e); + } else { + encodeType(object.getValue(), cacheMeta, out); + } + out.endList(); + e = cacheMap.remove("$writable"); + if (e != null) { + out.beginList() + .value("$writable") + .value(e) + .endList(); + } else if (!object.isReadOnly()) { + out.beginList() + .value("$writable") + .value(object.isAdmin() ? "config" : "write") + .endList(); + } + } + + private void encodeType(DSIValue value, DSMetadata meta, DSIWriter out) { + String type = meta.getType(); + if ((type == null) && (value != null)) { + meta.setType(value); + } + fixType(meta.getMap()); + DSElement e = cacheMap.remove(DSMetadata.TYPE); + if (e == null) { + throw new IllegalArgumentException("Missing type"); + } + out.value(e); + } + + private void encodeUpdate(Update update, DSIWriter out) { + if (!isOpen()) { + return; + } + if (update.added) { + encodeChild(update.child, out); + } else { + out.beginMap(); + out.key("name").value(DSPath.encodeName(update.child.getName())); + out.key("change").value("remove"); + out.endMap(); + } + } + + private void enqueue(Update update) { + if (!isOpen()) { + return; + } + synchronized (this) { + if (updateHead == null) { + updateHead = update; + updateTail = update; + } else { + updateTail.next = update; + updateTail = update; + } + if (enqueued) { + return; + } + } + getResponder().sendResponse(this); + } + + /** + * Enqueues in the session. + */ + private void enqueueResponse() { + synchronized (this) { + if (enqueued) { + return; + } + enqueued = true; + } + getResponder().sendResponse(this); + } + + /** + * Combines boolean and enum ranges into the type name. + */ + private DSMap fixType(DSMap arg) { + String type = arg.getString(DSMetadata.TYPE); + if ("bool".equals(type)) { + DSList range = (DSList) arg.remove(DSMetadata.BOOLEAN_RANGE); + if ((range == null) || (range.size() != 2)) { + return arg; + } else { + cacheBuf.setLength(0); + cacheBuf.append(type); + cacheBuf.append('['); + cacheBuf.append(range.get(0).toString()); + cacheBuf.append(','); + cacheBuf.append(range.get(1).toString()); + cacheBuf.append(']'); + arg.put(DSMetadata.TYPE, cacheBuf.toString()); + } + } else if ("enum".equals(type)) { + DSList range = (DSList) arg.remove(DSMetadata.ENUM_RANGE); + if (range == null) { + return arg; + } + cacheBuf.setLength(0); + cacheBuf.append(type); + cacheBuf.append('['); + for (int i = 0, len = range.size(); i < len; i++) { + if (i > 0) { + cacheBuf.append(','); + } + cacheBuf.append(range.get(i).toString()); + } + cacheBuf.append(']'); + arg.put(DSMetadata.TYPE, cacheBuf.toString()); + } + return arg; + } + + @Override + public ApiObject getTarget() { + return info; + } + + private boolean isClosed() { + return state == STATE_CLOSED; + } + + private boolean isClosePending() { + return state == STATE_CLOSE_PENDING; + } + + /** + * Not closed or closed pending. + */ + @Override + public boolean isOpen() { + return (state != STATE_CLOSE_PENDING) && (state != STATE_CLOSED); + } + + @Override + public void onClose() { + if (node != null) { + node.unsubscribe(DSNode.INFO_TOPIC, null, this); + } + } + + @Override + public void onEvent(DSTopic topic, DSIEvent event, DSNode node, DSInfo child, + Object... params) { + switch ((DSInfoTopic.Event) event) { + case CHILD_ADDED: + childAdded(child); + break; + case CHILD_REMOVED: + childRemoved(child); + break; + case METADATA_CHANGED: //TODO + break; + default: + } + } + + @Override + public void onUnsubscribed(DSTopic topic, DSNode node, DSInfo child) { + close(); + } + + @Override + public void run() { + try { + RequestPath path = new RequestPath(getPath(), getLink()); + if (path.isResponder()) { + DSIResponder responder = (DSIResponder) path.getTarget(); + setPath(path.getPath()); + response = responder.onList(this); + } else { + info = path.getInfo(); + if (info.isNode()) { + node = info.getNode(); + node.subscribe(DSNode.INFO_TOPIC, null, this); + } + response = this; + } + } catch (Exception x) { + severe(getPath(), x); + close(x); + return; + } + if (response == null) { + close(); + } else { + enqueueResponse(); + } + } + + @Override + public void onClose(Integer requestId) { + if (isClosed()) { + return; + } + state = STATE_CLOSED; + fine(finer() ? getPath() + " list closed" : null); + synchronized (this) { + updateHead = updateTail = null; + } + doClose(); + } + + @Override + public void write(MessageWriter writer) { + DSIWriter out = writer.getWriter(); + enqueued = false; + if (isClosed()) { + return; + } + if (isClosePending() && (updateHead == null) && (closeReason != null)) { + ErrorResponse res = makeError(closeReason); + res.write(writer); + doClose(); + return; + } + int last = state; + out.beginMap(); + out.key("rid").value(getRequestId()); + switch (state) { + case STATE_INIT: + out.key("updates").beginList(); + writeInit(writer); + break; + case STATE_CHILDREN: + out.key("updates").beginList(); + writeChildren(writer); + break; + case STATE_CLOSE_PENDING: + case STATE_UPDATES: + out.key("updates").beginList(); + writeUpdates(writer); + break; + default: + ; + } + out.endList(); + if ((state != last) && (state == STATE_UPDATES)) { + out.key("stream").value("open"); + } else if (isClosePending() && (updateHead == null)) { + if (closeReason != null) { + getResponder().sendResponse(makeError(closeReason)); + } else { + out.key("stream").value("closed"); + } + doClose(); + } + out.endMap(); + } + + private void writeChildren(MessageWriter writer) { + DSIWriter out = writer.getWriter(); + if (children != null) { + ApiObject child; + while (children.hasNext()) { + child = children.next(); + if (!child.isHidden()) { + encodeChild(child, out); + } + if (getResponder().shouldEndMessage()) { + enqueueResponse(); + return; + } + } + } + children = null; + state = STATE_UPDATES; + } + + private void writeInit(MessageWriter writer) { + DSIWriter out = writer.getWriter(); + ApiObject target = response.getTarget(); + encodeTarget(target, out); + if (target.hasChildren()) { + state = STATE_CHILDREN; + children = target.getChildren(); + writeChildren(writer); + } else { + state = STATE_UPDATES; + writeUpdates(writer); + } + } + + private void writeUpdates(MessageWriter writer) { + DSIWriter out = writer.getWriter(); + DSResponder responder = getResponder(); + Update update = dequeue(); + while (update != null) { + encodeUpdate(update, out); + if (responder.shouldEndMessage()) { + enqueueResponse(); + break; + } + update = dequeue(); + } + } + + /////////////////////////////////////////////////////////////////////////// + // Inner Classes + /////////////////////////////////////////////////////////////////////////// + + private static class Update { + + boolean added; + ApiObject child; + Update next; + + Update(ApiObject child, boolean added) { + this.child = child; + this.added = added; + } + } + +} diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/PushBinaryTransport.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/PushBinaryTransport.java new file mode 100644 index 00000000..8a0bd074 --- /dev/null +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/PushBinaryTransport.java @@ -0,0 +1,183 @@ +package com.acuity.iot.dsa.dslink.transport; + +import com.acuity.iot.dsa.dslink.io.DSByteBuffer; +import com.acuity.iot.dsa.dslink.io.DSIoException; +import java.io.IOException; +import java.io.InputStream; +import org.iot.dsa.util.DSException; + +/** + * For transports that push values for reading (such as the TestTransport and websockets). + * + * @author Aaron Hansen + */ +public abstract class PushBinaryTransport extends DSBinaryTransport { + + /////////////////////////////////////////////////////////////////////////// + // Fields + /////////////////////////////////////////////////////////////////////////// + + private RuntimeException closeException; + private InputStream input = new MyInputStream(); + private boolean open = false; + private DSByteBuffer readBuffer = new DSByteBuffer(); + + ///////////////////////////////////////////////////////////////// + // Methods - In alphabetical order by method name. + ///////////////////////////////////////////////////////////////// + + @Override + public DSTransport beginMessage() { + return this; + } + + protected void close(Throwable reason) { + closeException = DSException.makeRuntime(reason); + close(); + } + + @Override + public DSTransport close() { + synchronized (this) { + open = false; + notifyAll(); + } + return this; + } + + @Override + public DSTransport endMessage() { + return this; + } + + @Override + public InputStream getInput() { + return input; + } + + @Override + public boolean isOpen() { + return open; + } + + /** + * Call super to set the open state. + */ + public DSTransport open() { + open = true; + return this; + } + + /** + * Call this to push bytes. + */ + protected void push(byte[] bytes, int off, int len) { + if (!testOpen()) { + throw new IllegalStateException("Transport closed"); + } + synchronized (this) { + readBuffer.put(bytes, 0, len); + notifyAll(); + } + } + + /** + * Returns true if open, false if closed, throws and exception if closed with an exception. + */ + protected boolean testOpen() { + if (!open) { + if (closeException != null) { + throw closeException; + } + return false; + } + return true; + } + + ///////////////////////////////////////////////////////////////// + // Inner Classes + ///////////////////////////////////////////////////////////////// + + private class MyInputStream extends InputStream { + + @Override + public int available() { + return readBuffer.available(); + } + + @Override + public void close() { + PushBinaryTransport.this.close(); + } + + @Override + public int read() throws IOException { + synchronized (PushBinaryTransport.this) { + if (testOpen() && readBuffer.available() == 0) { + try { + PushBinaryTransport.this.wait(getReadTimeout()); + } catch (Exception x) { + } + } + if (!testOpen()) { + return -1; + } + if (readBuffer.available() == 0) { + throw new DSIoException("Read timeout"); + } + return readBuffer.read(); + } + } + + @Override + public int read(byte[] buf) throws IOException { + if (buf.length == 0) { + if (!testOpen()) { + return -1; + } + return 0; + } + synchronized (PushBinaryTransport.this) { + if (testOpen() && readBuffer.available() == 0) { + try { + PushBinaryTransport.this.wait(getReadTimeout()); + } catch (Exception x) { + } + } + if (!testOpen()) { + return -1; + } + if (readBuffer.available() == 0) { + throw new DSIoException("Read timeout"); + } + return readBuffer.sendTo(buf, 0, buf.length); + } + } + + @Override + public int read(byte[] buf, int off, int len) throws IOException { + if (len == 0) { + if (!testOpen()) { + return -1; + } + return 0; + } + synchronized (PushBinaryTransport.this) { + if (testOpen() && readBuffer.available() == 0) { + try { + PushBinaryTransport.this.wait(getReadTimeout()); + } catch (Exception x) { + } + } + if (!testOpen()) { + return -1; + } + if (readBuffer.available() == 0) { + throw new DSIoException("Read timeout"); + } + return readBuffer.sendTo(buf, off, len); + } + } + } + +} diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/SocketTransport.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/SocketTransport.java index 09166891..07b2297b 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/SocketTransport.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/transport/SocketTransport.java @@ -4,7 +4,6 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; -import java.nio.ByteBuffer; import org.iot.dsa.util.DSException; /** @@ -91,6 +90,7 @@ public DSTransport open() { } try { socket = new Socket(getConnectionUrl(), 443); + socket.setSoTimeout((int) getReadTimeout()); open = true; fine(fine() ? "SocketTransport open" : null); } catch (Exception x) { From 319145f6771d1c0836366fb8c2356b2c493e5805 Mon Sep 17 00:00:00 2001 From: Aaron Date: Fri, 2 Feb 2018 08:56:01 -0800 Subject: [PATCH 3/3] Use DSByteBuffer instead of java ByteBuffer. --- docs/javadoc/allclasses-frame.html | 367 +- docs/javadoc/allclasses-noframe.html | 343 +- docs/javadoc/constant-values.html | 2363 +-- docs/javadoc/deprecated-list.html | 152 +- docs/javadoc/help-doc.html | 382 +- docs/javadoc/index-all.html | 14624 ++++++++++------ docs/javadoc/index.html | 40 +- docs/javadoc/org/iot/dsa/DSRuntime.Timer.html | 807 +- docs/javadoc/org/iot/dsa/DSRuntime.html | 591 +- .../org/iot/dsa/io/AbstractReader.html | 1614 +- .../org/iot/dsa/io/AbstractWriter.html | 2039 ++- docs/javadoc/org/iot/dsa/io/DSBase64.html | 615 +- .../org/iot/dsa/io/DSIReader.Token.html | 903 +- docs/javadoc/org/iot/dsa/io/DSIReader.html | 872 +- docs/javadoc/org/iot/dsa/io/DSIWriter.html | 1187 +- docs/javadoc/org/iot/dsa/io/NodeDecoder.html | 400 +- docs/javadoc/org/iot/dsa/io/NodeEncoder.html | 422 +- .../javadoc/org/iot/dsa/io/package-frame.html | 58 +- .../org/iot/dsa/io/package-summary.html | 359 +- docs/javadoc/org/iot/dsa/io/package-tree.html | 257 +- docs/javadoc/org/iot/dsa/node/DSBool.html | 1282 +- docs/javadoc/org/iot/dsa/node/DSInfo.html | 1938 +- docs/javadoc/org/iot/dsa/node/DSInt.html | 1404 +- docs/javadoc/org/iot/dsa/node/DSList.html | 2145 ++- docs/javadoc/org/iot/dsa/node/DSLong.html | 1419 +- docs/javadoc/org/iot/dsa/node/DSMap.html | 2653 +-- docs/javadoc/org/iot/dsa/node/DSNode.html | 4242 +++-- docs/javadoc/org/iot/dsa/node/DSNull.html | 930 +- docs/javadoc/org/iot/dsa/package-frame.html | 27 +- docs/javadoc/org/iot/dsa/package-summary.html | 223 +- docs/javadoc/org/iot/dsa/package-tree.html | 181 +- docs/javadoc/overview-frame.html | 62 +- docs/javadoc/overview-summary.html | 322 +- docs/javadoc/overview-tree.html | 952 +- docs/javadoc/serialized-form.html | 269 +- .../dslink/io/DSSynchronizedByteBuffer.java | 366 - .../dslink/protocol/message/CloseMessage.java | 2 - .../protocol/protocol_v1/DS1Session.java | 1 - .../protocol_v1/responder/DS1Responder.java | 1 - .../protocol_v2/DS2MessageReader.java | 8 +- .../protocol/responder/DSResponder.java | 1 + .../main/java/org/iot/dsa/dslink/DSLink.java | 7 - .../main/java/org/iot/dsa/node/DSNode.java | 6 +- .../org/iot/dsa/dslink/DSByteBufferTest.java | 4 +- .../java/org/iot/dsa/dslink/PerfTest.java | 1 - .../iot/dsa/dslink/RequesterInvokeTest.java | 6 - .../dsa/dslink/RequesterSubscribeTest.java | 1 - .../dsa/dslink/websocket/WsTextTransport.java | 4 +- 48 files changed, 27600 insertions(+), 19252 deletions(-) delete mode 100644 dslink-core/src/main/java/com/acuity/iot/dsa/dslink/io/DSSynchronizedByteBuffer.java diff --git a/docs/javadoc/allclasses-frame.html b/docs/javadoc/allclasses-frame.html index ef514b25..444015ef 100644 --- a/docs/javadoc/allclasses-frame.html +++ b/docs/javadoc/allclasses-frame.html @@ -1,126 +1,261 @@ - + - -All Classes (dslink-core 0.15.0 API) - - - + + All Classes (dslink-core 0.15.0 API) + + +

All Classes

- +
diff --git a/docs/javadoc/allclasses-noframe.html b/docs/javadoc/allclasses-noframe.html index 3e0d3f43..2ff5918b 100644 --- a/docs/javadoc/allclasses-noframe.html +++ b/docs/javadoc/allclasses-noframe.html @@ -1,126 +1,237 @@ - + - -All Classes (dslink-core 0.15.0 API) - - - + + All Classes (dslink-core 0.15.0 API) + + +

All Classes

- +
diff --git a/docs/javadoc/constant-values.html b/docs/javadoc/constant-values.html index 74b4f420..c5782d41 100644 --- a/docs/javadoc/constant-values.html +++ b/docs/javadoc/constant-values.html @@ -1,12 +1,13 @@ - + - -Constant Field Values (dslink-core 0.15.0 API) - - - + + Constant Field Values (dslink-core 0.15.0 API) + + + + + + + + +
-

Constant Field Values

-

Contents

- +

Constant Field Values

+

Contents

+
- + -

org.iot.*

- -
    -
  • - - - - - - - - - - - - - - - - - - - - - - - - -
    org.iot.dsa.io.json.JsonConstants 
    Modifier and TypeConstant FieldValue
    - -public static final java.lang.StringDBL_NAN"\u001bNaN"
    - -public static final java.lang.StringDBL_NEG_INF"\u001b-Infinity"
    - -public static final java.lang.StringDBL_POS_INF"\u001bInfinity"
    -
  • -
-
    -
  • - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    org.iot.dsa.io.msgpack.MsgpackReader 
    Modifier and TypeConstant FieldValue
    - -public static final byteBIN16-59
    - -public static final byteBIN32-58
    - -public static final byteBIN8-60
    - -public static final byteFALSE-62
    - -public static final byteFIXLIST_PREFIX-112
    - -public static final byteFIXMAP_PREFIX-128
    - -public static final byteFIXSTR_PREFIX-96
    - -public static final byteFLOAT32-54
    - -public static final byteFLOAT64-53
    - -public static final byteINT16-47
    - -public static final byteINT32-46
    - -public static final byteINT64-45
    - -public static final byteINT8-48
    - -public static final byteLIST16-36
    - -public static final byteLIST32-35
    - -public static final byteMAP16-34
    - -public static final byteMAP32-33
    - -public static final byteNULL-64
    - -public static final byteSTR16-38
    - -public static final byteSTR32-37
    - -public static final byteSTR8-39
    - -public static final byteTRUE-61
    - -public static final byteUINT16-51
    - -public static final byteUINT32-50
    - -public static final byteUINT64-49
    - -public static final byteUINT8-52
    -
  • -
  • - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    org.iot.dsa.io.msgpack.MsgpackWriter 
    Modifier and TypeConstant FieldValue
    - -public static final byteBIN16-59
    - -public static final byteBIN32-58
    - -public static final byteBIN8-60
    - -public static final byteFALSE-62
    - -public static final byteFIXLIST_PREFIX-112
    - -public static final byteFIXMAP_PREFIX-128
    - -public static final byteFIXSTR_PREFIX-96
    - -public static final byteFLOAT32-54
    - -public static final byteFLOAT64-53
    - -public static final byteINT16-47
    - -public static final byteINT32-46
    - -public static final byteINT64-45
    - -public static final byteINT8-48
    - -public static final byteLIST16-36
    - -public static final byteLIST32-35
    - -public static final byteMAP16-34
    - -public static final byteMAP32-33
    - -public static final byteNULL-64
    - -public static final byteSTR16-38
    - -public static final byteSTR32-37
    - -public static final byteSTR8-39
    - -public static final byteTRUE-61
    - -public static final byteUINT16-51
    - -public static final byteUINT32-50
    - -public static final byteUINT64-49
    - -public static final byteUINT8-52
    -
  • -
- - +

org.iot.*

+ +
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + +
    org.iot.dsa.io.json.JsonConstants 
    Modifier and TypeConstant FieldValue
    + + public static final java.lang.StringDBL_NAN"\u001bNaN"
    + + public static final java.lang.StringDBL_NEG_INF"\u001b-Infinity"
    + + public static final java.lang.StringDBL_POS_INF"\u001bInfinity"
    +
  • +
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    org.iot.dsa.io.msgpack.MsgpackReader 
    Modifier and TypeConstant FieldValue
    + + public static final byteBIN16-59
    + + public static final byteBIN32-58
    + + public static final byteBIN8-60
    + + public static final byteFALSE-62
    + + public static final byteFIXLIST_PREFIX-112
    + + public static final byteFIXMAP_PREFIX-128
    + + public static final byteFIXSTR_PREFIX-96
    + + public static final byteFLOAT32-54
    + + public static final byteFLOAT64-53
    + + public static final byteINT16-47
    + + public static final byteINT32-46
    + + public static final byteINT64-45
    + + public static final byteINT8-48
    + + public static final byteLIST16-36
    + + public static final byteLIST32-35
    + + public static final byteMAP16-34
    + + public static final byteMAP32-33
    + + public static final byteNULL-64
    + + public static final byteSTR16-38
    + + public static final byteSTR32-37
    + + public static final byteSTR8-39
    + + public static final byteTRUE-61
    + + public static final byteUINT16-51
    + + public static final byteUINT32-50
    + + public static final byteUINT64-49
    + + public static final byteUINT8-52
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    org.iot.dsa.io.msgpack.MsgpackWriter 
    Modifier and TypeConstant FieldValue
    + + public static final byteBIN16-59
    + + public static final byteBIN32-58
    + + public static final byteBIN8-60
    + + public static final byteFALSE-62
    + + public static final byteFIXLIST_PREFIX-112
    + + public static final byteFIXMAP_PREFIX-128
    + + public static final byteFIXSTR_PREFIX-96
    + + public static final byteFLOAT32-54
    + + public static final byteFLOAT64-53
    + + public static final byteINT16-47
    + + public static final byteINT32-46
    + + public static final byteINT64-45
    + + public static final byteINT8-48
    + + public static final byteLIST16-36
    + + public static final byteLIST32-35
    + + public static final byteMAP16-34
    + + public static final byteMAP32-33
    + + public static final byteNULL-64
    + + public static final byteSTR16-38
    + + public static final byteSTR32-37
    + + public static final byteSTR8-39
    + + public static final byteTRUE-61
    + + public static final byteUINT16-51
    + + public static final byteUINT32-50
    + + public static final byteUINT64-49
    + + public static final byteUINT8-52
    +
  • +
+ +
+ + + + + + diff --git a/docs/javadoc/deprecated-list.html b/docs/javadoc/deprecated-list.html index bf50e5ba..01eb9a19 100644 --- a/docs/javadoc/deprecated-list.html +++ b/docs/javadoc/deprecated-list.html @@ -1,12 +1,13 @@ - + - -Deprecated List (dslink-core 0.15.0 API) - - - + + Deprecated List (dslink-core 0.15.0 API) + + +
- + - - - - - + + + + +
+ + + + + +
-

Deprecated API

-

Contents

+

Deprecated API

+

Contents

- + - - - - - + + + + +
+ + + + + + diff --git a/docs/javadoc/help-doc.html b/docs/javadoc/help-doc.html index 1a1f8b40..b0482021 100644 --- a/docs/javadoc/help-doc.html +++ b/docs/javadoc/help-doc.html @@ -1,12 +1,13 @@ - + - -API Help (dslink-core 0.15.0 API) - - - + + API Help (dslink-core 0.15.0 API) + + +
- + - - - - - + + + + +
+ + + + + +
-

How This API Document Is Organized

-
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages + corresponding to the items in the navigation bar, described as follows. +
-
    -
  • -

    Overview

    -

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    -
  • -
  • -

    Package

    -

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    -
      -
    • Interfaces (italic)
    • -
    • Classes
    • -
    • Enums
    • -
    • Exceptions
    • -
    • Errors
    • -
    • Annotation Types
    • -
    -
  • -
  • -

    Class/Interface

    -

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    -
      -
    • Class inheritance diagram
    • -
    • Direct Subclasses
    • -
    • All Known Subinterfaces
    • -
    • All Known Implementing Classes
    • -
    • Class/interface declaration
    • -
    • Class/interface description
    • -
    -
      -
    • Nested Class Summary
    • -
    • Field Summary
    • -
    • Constructor Summary
    • -
    • Method Summary
    • -
    -
      -
    • Field Detail
    • -
    • Constructor Detail
    • -
    • Method Detail
    • -
    -

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    -
  • -
  • -

    Annotation Type

    -

    Each annotation type has its own separate page with the following sections:

    -
      -
    • Annotation Type declaration
    • -
    • Annotation Type description
    • -
    • Required Element Summary
    • -
    • Optional Element Summary
    • -
    • Element Detail
    • -
    -
  • -
  • -

    Enum

    -

    Each enum has its own separate page with the following sections:

    -
      -
    • Enum declaration
    • -
    • Enum description
    • -
    • Enum Constant Summary
    • -
    • Enum Constant Detail
    • -
    -
  • -
  • -

    Tree (Class Hierarchy)

    -

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    -
      -
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • -
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • -
    -
  • -
  • -

    Deprecated API

    -

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    -
  • -
  • -

    Index

    -

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    -
  • -
  • -

    Prev/Next

    -

    These links take you to the next or previous class, interface, package, or related page.

    -
  • -
  • -

    Frames/No Frames

    -

    These links show and hide the HTML frames. All pages are available with or without frames.

    -
  • -
  • -

    All Classes

    -

    The All Classes link shows all classes and interfaces except non-static nested types.

    -
  • -
  • -

    Serialized Form

    -

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    -
  • -
  • -

    Constant Field Values

    -

    The Constant Field Values page lists the static final fields and their values.

    -
  • -
-This help file applies to API documentation generated using the standard doclet.
+
    +
  • +

    Overview

    +

    The Overview page is the front page of this API + document and provides a list of all packages with a summary for each. This page can also + contain an overall description of the set of packages.

    +
  • +
  • +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary + for each. This page can contain six categories:

    +
      +
    • Interfaces (italic)
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
  • +
  • +

    Class/Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of + these pages has three sections consisting of a class/interface description, summary tables, + and detailed member descriptions:

    +
      +
    • Class inheritance diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class/interface declaration
    • +
    • Class/interface description
    • +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
      +
    • Field Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. + The summary entries are alphabetical, while the detailed descriptions are in the order they + appear in the source code. This preserves the logical groupings established by the + programmer.

    +
  • +
  • +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type declaration
    • +
    • Annotation Type description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
  • +
  • +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum declaration
    • +
    • Enum description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
  • +
  • +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a + hierarchy for each package. Each hierarchy page contains a list of classes and a list of + interfaces. The classes are organized by inheritance structure starting with java.lang.Object. + The interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all + packages. +
    • +
    • When viewing a particular package, class or interface page, clicking "Tree" displays the + hierarchy for only that package. +
    • +
    +
  • +
  • +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have + been deprecated. A deprecated API is not recommended for use, generally due to improvements, + and a replacement API is usually given. Deprecated APIs may be removed in future + implementations.

    +
  • +
  • +

    Index

    +

    The Index contains an alphabetic list of all classes, + interfaces, constructors, methods, and fields.

    +
  • +
  • +

    Prev/Next

    +

    These links take you to the next or previous class, interface, package, or related + page.

    +
  • +
  • +

    Frames/No Frames

    +

    These links show and hide the HTML frames. All pages are available with or without + frames.

    +
  • +
  • +

    All Classes

    +

    The All Classes link shows all classes and interfaces + except non-static nested types.

    +
  • +
  • +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and + methods. This information is of interest to re-implementors, not to developers using the + API. While there is no link in the navigation bar, you can get to this information by going + to any serialized class and clicking "Serialized Form" in the "See also" section of the + class description.

    +
  • +
  • +

    Constant Field Values

    +

    The Constant Field Values page lists the static final + fields and their values.

    +
  • +
+ This help file applies to API documentation generated using the standard doclet. +
- + - - - - - + + + + +
+ + + + + + diff --git a/docs/javadoc/index-all.html b/docs/javadoc/index-all.html index 6a584c73..4827d597 100644 --- a/docs/javadoc/index-all.html +++ b/docs/javadoc/index-all.html @@ -1,12 +1,13 @@ - + - -Index (dslink-core 0.15.0 API) - - - + + Index (dslink-core 0.15.0 API) + + +
- + - - - - - + + + + +
+ + + + + + -
A B C D E F G H I J K L M N O P R S T U V W  - - -

A

-
-
AbstractInvokeHandler - Class in org.iot.dsa.dslink.requester
-
-
Convenience implementation of the callback passed to the invoke method in the requester.
-
-
AbstractInvokeHandler() - Constructor for class org.iot.dsa.dslink.requester.AbstractInvokeHandler
-
 
-
AbstractJsonWriter - Class in org.iot.dsa.io.json
-
 
-
AbstractJsonWriter() - Constructor for class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
AbstractListHandler - Class in org.iot.dsa.dslink.requester
-
-
Convenience implementation of the handler passed to the invoke method in the requester.
-
-
AbstractListHandler() - Constructor for class org.iot.dsa.dslink.requester.AbstractListHandler
-
 
-
AbstractReader - Class in org.iot.dsa.io
-
-
Basic implementation of DSReader.
-
-
AbstractReader() - Constructor for class org.iot.dsa.io.AbstractReader
-
 
-
AbstractSubscribeHandler - Class in org.iot.dsa.dslink.requester
-
-
Convenience implementation of the handler passed to the subscribe method in the requester.
-
-
AbstractSubscribeHandler() - Constructor for class org.iot.dsa.dslink.requester.AbstractSubscribeHandler
-
 
-
AbstractWriter - Class in org.iot.dsa.io
-
-
Basic implementation of DSWriter.
-
-
AbstractWriter() - Constructor for class org.iot.dsa.io.AbstractWriter
-
 
-
ActionInvocation - Interface in org.iot.dsa.node.action
-
-
Encapsulates the details of an action invocation and provides the mechanism for updating and open - stream.
-
-
ActionResult - Interface in org.iot.dsa.node.action
-
-
Super interface for possible results of an action.
-
-
ActionSpec - Interface in org.iot.dsa.node.action
-
-
Defines an invokable node in the DSA model.
-
-
ActionSpec.ResultType - Enum in org.iot.dsa.node.action
-
-
Defines what the action returns.
-
-
ActionTable - Interface in org.iot.dsa.node.action
-
-
Provides access to the columns and rows of a table.
-
-
ActionValues - Interface in org.iot.dsa.node.action
-
-
Simple set of return values from an action.
-
-
add(DSElement) - Method in class org.iot.dsa.node.DSList
-
-
Adds the value and returns this.
-
-
add(boolean) - Method in class org.iot.dsa.node.DSList
-
-
Appends the primitive and returns this.
-
-
add(double) - Method in class org.iot.dsa.node.DSList
-
-
Appends the primitive and returns this.
-
-
add(long) - Method in class org.iot.dsa.node.DSList
-
-
Appends the primitive and returns this.
-
-
add(String) - Method in class org.iot.dsa.node.DSList
-
-
Appends the primitive and returns this.
-
-
add(int) - Method in class org.iot.dsa.node.DSList
-
-
Appends the primitive and returns this.
-
-
add(String, DSIObject) - Method in class org.iot.dsa.node.DSNode
-
-
Adds the named child only if the name is not already in use.
-
-
addAll(DSList) - Method in class org.iot.dsa.node.DSList
-
-
Add all elements of the argument to this list and returns this.
-
-
addDays(int, Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Adds or subtracts the corresponding time field, does not perform any alignment.
-
-
addDays(int, long) - Static method in class org.iot.dsa.time.DSTime
-
-
Adds or subtracts the corresponding time field, does not perform any alignment.
-
-
addDefaultParameter(String, DSIValue, String) - Method in class org.iot.dsa.node.action.DSAction
-
-
A convenience which calls addParameter with the same arguments, and also sets the metadata - for default value.
-
-
addHours(int, Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Adds or subtracts the corresponding time field, does not perform any alignment.
-
-
addHours(int, long) - Static method in class org.iot.dsa.time.DSTime
-
-
Adds or subtracts the corresponding time field, does not perform any alignment.
-
-
addList() - Method in class org.iot.dsa.node.DSList
-
-
Appends a new list and returns it.
-
-
addListener(DSLinkConnection.Listener) - Method in class org.iot.dsa.dslink.DSLinkConnection
-
-
Adds a listener for connection events.
-
-
addMap() - Method in class org.iot.dsa.node.DSList
-
-
Appends a new map and returns it.
-
-
addMinutes(int, Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Adds or subtracts the corresponding time field, does not perform any alignment.
-
-
addMinutes(int, long) - Static method in class org.iot.dsa.time.DSTime
-
-
Adds or subtracts the corresponding time field, does not perform any alignment.
-
-
addMonths(int, Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Adds or subtracts the corresponding time field, does not perform any alignment.
-
-
addMonths(int, long) - Static method in class org.iot.dsa.time.DSTime
-
-
Adds or subtracts the corresponding time field, does not perform any alignment.
-
-
addNull() - Method in class org.iot.dsa.node.DSList
-
-
Appends null and returns this.
-
-
addParameter(DSMap) - Method in class org.iot.dsa.node.action.DSAction
-
-
Fully describes a parameter for method invocation.
-
-
addParameter(String, DSIValue, String) - Method in class org.iot.dsa.node.action.DSAction
-
-
Creates a DSMetadata, calls setName and setType on it, adds the internal map to the parameter - list and returns the metadata instance for further configuration.
-
-
addParameter(String, DSValueType, String) - Method in class org.iot.dsa.node.action.DSAction
-
-
Creates a DSMetadata, calls setName and setType on it, adds the internal map to the parameter - list and returns the metadata instance for further configuration.
-
-
addSeconds(int, Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Adds or subtracts the corresponding time field, does not perform any alignment.
-
-
addSeconds(int, long) - Static method in class org.iot.dsa.time.DSTime
-
-
Adds or subtracts the corresponding time field, does not perform any alignment.
-
-
addValueResult(DSMap) - Method in class org.iot.dsa.node.action.DSAction
-
-
Fully describes a return value when the result type is VALUES.
-
-
addValueResult(String, DSIValue) - Method in class org.iot.dsa.node.action.DSAction
-
-
Creates a DSMetadata, calls setName and setType on it, adds the internal map to the results - list and returns the metadata instance for further configuration.
-
-
addValueResult(String, DSValueType) - Method in class org.iot.dsa.node.action.DSAction
-
-
Creates a DSMetadata, calls setName and setType on it, adds the internal map to the results - list and returns the metadata instance for further configuration.
-
-
addWeeks(int, Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Adds or subtracts the corresponding time field, does not perform any alignment.
-
-
addWeeks(int, long) - Static method in class org.iot.dsa.time.DSTime
-
-
Adds or subtracts the corresponding time field, does not perform any alignment.
-
-
addYears(int, Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Adds or subtracts the corresponding time field, does not perform any alignment.
-
-
addYears(int, long) - Static method in class org.iot.dsa.time.DSTime
-
-
Adds or subtracts the corresponding time field, does not perform any alignment.
-
-
alignDay(Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Aligns the time fields to the start of the day.
-
-
alignDays(int, Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Aligns the time fields to the start of given interval.
-
-
alignHour(Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Aligns the time fields to the start of the hour.
-
-
alignHours(int, Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Aligns the time fields to the start of given interval.
-
-
alignMinute(Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Aligns the time fields to the start of the minute.
-
-
alignMinutes(int, Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Aligns the time fields to the start of given interval.
-
-
alignMonth(Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Aligns the time fields to the start of the month.
-
-
alignSecond(Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Aligns the time fields to the start of the second.
-
-
alignSeconds(int, Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Aligns the time fields to the start of given interval.
-
-
alignWeek(Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Aligns the time fields to the start of the week.
-
-
alignYear(Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Aligns the time fields to the start of the year.
-
-
ApiObject - Interface in org.iot.dsa.dslink.responder
-
-
Can be a node, value or an action.
-
-
append(char[], int, int) - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
-
Append the characters and return this.
-
-
append(char) - Method in class org.iot.dsa.io.json.JsonAppender
-
-
Append the char and return this.
-
-
append(char[], int, int) - Method in class org.iot.dsa.io.json.JsonAppender
-
-
Append the chars and return this.
-
-
append(CharSequence) - Method in class org.iot.dsa.io.json.JsonAppender
-
-
Append the chars and return this.
-
-
append(CharSequence, int, int) - Method in class org.iot.dsa.io.json.JsonAppender
-
-
Append the chars and return this.
-
-
append(CharSequence) - Method in class org.iot.dsa.io.json.JsonWriter
-
 
-
append(char) - Method in class org.iot.dsa.io.json.JsonWriter
-
 
-
append(CharSequence, int, int) - Method in class org.iot.dsa.io.json.JsonWriter
-
-
Append the chars and return this.
-
-
append(char[], int, int) - Method in class org.iot.dsa.io.json.JsonWriter
-
-
Append the chars and return this.
-
-
AsyncLogHandler - Class in org.iot.dsa.logging
-
-
Enqueues logging records which are then processed by separate thread.
-
-
AsyncLogHandler() - Constructor for class org.iot.dsa.logging.AsyncLogHandler
-
 
-
- - - -

B

-
-
beginList() - Method in class org.iot.dsa.io.AbstractWriter
-
 
-
beginList(int) - Method in class org.iot.dsa.io.AbstractWriter
-
 
-
beginList() - Method in interface org.iot.dsa.io.DSIWriter
-
-
Start a new list and return this.
-
-
beginList(int) - Method in interface org.iot.dsa.io.DSIWriter
-
-
Start a new list of the given size and return this.
-
-
beginMap() - Method in class org.iot.dsa.io.AbstractWriter
-
 
-
beginMap(int) - Method in class org.iot.dsa.io.AbstractWriter
-
 
-
beginMap() - Method in interface org.iot.dsa.io.DSIWriter
-
-
Start a new map and return this.
-
-
beginMap(int) - Method in interface org.iot.dsa.io.DSIWriter
-
-
Start a new map of the given size and return this.
-
-
BOOLEAN_RANGE - Static variable in class org.iot.dsa.node.DSMetadata
-
 
-
byteBuffer - Variable in class org.iot.dsa.io.msgpack.MsgpackWriter
-
 
-
- - - -

C

-
-
cancel() - Method in class org.iot.dsa.DSRuntime.Timer
-
-
Cancel execution, will not impact current running tasks and will have no effect if - already cancelled.
-
-
CFG_AUTH_TOKEN - Static variable in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
CFG_BROKER_URL - Static variable in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
CFG_CONNECTION_TYPE - Static variable in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
CFG_IS_REQUESTER - Static variable in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
CFG_IS_RESPONDER - Static variable in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
CFG_KEY_FILE - Static variable in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
CFG_LOG_FILE - Static variable in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
CFG_LOG_LEVEL - Static variable in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
CFG_MAIN_TYPE - Static variable in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
CFG_NODE_FILE - Static variable in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
CFG_PROTOCOL_VERSION - Static variable in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
CFG_READ_TIMEOUT - Static variable in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
CFG_SAVE_INTERVAL - Static variable in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
CFG_STABLE_DELAY - Static variable in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
CFG_WS_TRANSPORT_FACTORY - Static variable in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
childAdded(ApiObject) - Method in interface org.iot.dsa.dslink.responder.InboundListRequest
-
-
The responder should call this whenever a child is added.
-
-
childCount() - Method in class org.iot.dsa.node.DSNode
-
-
The number of children.
-
-
childRemoved(ApiObject) - Method in interface org.iot.dsa.dslink.responder.InboundListRequest
-
-
The responder should call this whenever a child is removed.
-
-
clear() - Method in class org.iot.dsa.node.DSGroup
-
-
Removes all items.
-
-
clear() - Method in class org.iot.dsa.node.DSList
-
 
-
clear() - Method in class org.iot.dsa.node.DSMap
-
 
-
clear() - Method in class org.iot.dsa.node.DSMetadata
-
 
-
clear(String) - Method in class org.iot.dsa.node.DSMetadata
-
 
-
clear() - Method in class org.iot.dsa.node.DSNode
-
-
Removes non-permanent children.
-
-
clearAllRows() - Method in interface org.iot.dsa.node.action.ActionInvocation
-
-
Only use with stream and open tables, instructs the requester to clear all existing rows.
-
-
close() - Method in interface org.iot.dsa.dslink.responder.InboundListRequest
-
-
Allows the responder to forcefully close the list stream.
-
-
close(Exception) - Method in interface org.iot.dsa.dslink.responder.InboundListRequest
-
-
Allows the responder to forcefully close the list stream.
-
-
close() - Method in interface org.iot.dsa.dslink.responder.InboundSubscribeRequest
-
-
Allows the responder to forcefully terminate the subscription.
-
-
close() - Method in interface org.iot.dsa.io.DSIReader
-
-
Close the input.
-
-
close() - Method in interface org.iot.dsa.io.DSIWriter
-
-
Close the stream.
-
-
close() - Method in class org.iot.dsa.io.json.JsonAppender
-
 
-
close() - Method in class org.iot.dsa.io.json.JsonReader
-
 
-
close() - Method in class org.iot.dsa.io.json.JsonWriter
-
 
-
close() - Method in class org.iot.dsa.io.msgpack.MsgpackReader
-
 
-
close() - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
-
Does nothing.
-
-
close() - Method in class org.iot.dsa.logging.AsyncLogHandler
-
-
Closes the PrintStream, terminates the write thread and performs houseKeeping.
-
-
close() - Static method in class org.iot.dsa.logging.DSLogging
-
-
Closes all async log handlers.
-
-
close() - Method in interface org.iot.dsa.node.action.ActionInvocation
-
-
For use with streams and open tables, will have no effect if the stream is already closed.
-
-
close(Exception) - Method in interface org.iot.dsa.node.action.ActionInvocation
-
-
Close and send and error.
-
-
closeStream() - Method in interface org.iot.dsa.dslink.requester.OutboundStream
-
-
Allows the requester to close the stream.
-
-
config() - Method in class org.iot.dsa.logging.DSLogger
-
-
True if the level is loggable.
-
-
config(Object) - Method in class org.iot.dsa.logging.DSLogger
-
 
-
CONFIG_FAULT - Static variable in class org.iot.dsa.node.DSStatus
-
-
Bad, a configuration error has been indentified within DSA.
-
-
CONFIG_FAULT_STR - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
configFault - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
contains(DSElement) - Method in class org.iot.dsa.node.DSList
-
 
-
contains(String) - Method in class org.iot.dsa.node.DSMap
-
 
-
contains(String) - Method in class org.iot.dsa.node.DSNode
-
-
Whether or not this node has a child with the given name.
-
-
copy() - Method in class org.iot.dsa.node.action.DSAction
-
 
-
copy() - Method in class org.iot.dsa.node.DSElement
-
-
If an object is mutable (list or map) then this should clone it, immutable objects can simply - return themselves.
-
-
copy() - Method in class org.iot.dsa.node.DSFlexEnum
-
 
-
copy() - Method in class org.iot.dsa.node.DSInfo
-
 
-
copy() - Method in interface org.iot.dsa.node.DSIObject
-
-
Return a copy if it makes sense, but return this otherwise.
-
-
copy() - Method in class org.iot.dsa.node.DSList
-
 
-
copy() - Method in class org.iot.dsa.node.DSMap
-
 
-
copy() - Method in class org.iot.dsa.node.DSNode
-
-
Returns a clone of this node and its subtree.
-
-
copy() - Method in class org.iot.dsa.node.DSNull
-
-
Returns this.
-
-
copy() - Method in class org.iot.dsa.node.DSValue
-
-
Returns this.
-
-
copy() - Method in class org.iot.dsa.node.event.DSTopic
-
-
Returns this.
-
-
count(long, long) - Method in enum org.iot.dsa.time.DSInterval
-
-
Returns the number of intervals for the given time range, or -1 if indeterminate.
-
-
currentTime() - Static method in class org.iot.dsa.time.DSDateTime
-
-
The current time.
-
-
- - - -

D

-
-
DBL_NAN - Static variable in interface org.iot.dsa.io.json.JsonConstants
-
-
How Double.NaN is encoded: "\\u001BNaN"
-
-
DBL_NEG_INF - Static variable in interface org.iot.dsa.io.json.JsonConstants
-
-
How Double.NEGATIVE_INFINITY is encoded: "\\u001B-Infinity"
-
-
DBL_POS_INF - Static variable in interface org.iot.dsa.io.json.JsonConstants
-
-
How Double.POSITIVE_INFINITY is encoded: "\\u001BInfinity"
-
-
DECIMAL_PLACES - Static variable in class org.iot.dsa.node.DSMetadata
-
 
-
declareDefault(String, DSIObject) - Method in class org.iot.dsa.node.DSNode
-
-
Use this in the declareDefaults method to create a non-removable child.
-
-
declareDefaults() - Method in class org.iot.dsa.dslink.DSLink
-
-
Adds the save action, overrides should call super if they want this action.
-
-
declareDefaults() - Method in class org.iot.dsa.node.DSNode
-
-
The is only called once for each class.
-
-
decode(String) - Static method in class org.iot.dsa.io.DSBase64
-
-
Decodes a base 64 encoded string.
-
-
decode(DSIReader) - Static method in class org.iot.dsa.io.NodeDecoder
-
-
Reads a node tree from the given input.
-
-
decode(String) - Static method in class org.iot.dsa.node.DSBytes
-
 
-
decode() - Method in class org.iot.dsa.security.DSPasswordAes
-
-
Returns the decrypted password.
-
-
decode(String) - Static method in class org.iot.dsa.time.DSTime
-
-
This is a convenience that uses reuses and recycles a calendar instance to get the time in - millis.
-
-
decode(String, Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Converts a DSA encoded timestamp into a Java Calendar.
-
-
decodeKeys(String) - Static method in class org.iot.dsa.security.DSKeys
-
-
Decodes an instance that was encoded with encodeKeys().
-
-
decodePath(String) - Static method in class org.iot.dsa.node.DSPath
-
-
Splits the path and decodes each individual name.
-
-
decodePathName(String) - Static method in class org.iot.dsa.node.DSPath
-
-
Un-escapes a name.
-
-
decodePrivate(byte[]) - Static method in class org.iot.dsa.security.DSKeys
-
-
Decodes the X9.63 encoding of a public key.
-
-
decodePublic(byte[]) - Static method in class org.iot.dsa.security.DSKeys
-
-
Decodes the X9.63 encoding of a public key.
-
-
decodeState(DSElement) - Method in class org.iot.dsa.node.DSInfo
-
 
-
DEFAULT - Static variable in class org.iot.dsa.dslink.requester.SimpleRequestHandler
-
-
An instance that can be used for those requests where the callbacks don't really matter.
-
-
DEFAULT - Static variable in class org.iot.dsa.node.action.DSAction
-
-
Use this when you have no-arg, no-return actions.
-
-
DEFAULT - Static variable in class org.iot.dsa.node.DSMetadata
-
 
-
DEFAULT_BACKUP_THRESHOLD - Static variable in class org.iot.dsa.logging.DSLogging
-
-
This is the threshold, not a hard limit: 10 megs by default.
-
-
DEFAULT_MAX_BACKUPS - Static variable in class org.iot.dsa.logging.DSLogging
-
-
The default number of backups to retain: 10 by default.
-
-
DEFAULT_MAX_QUEUE - Static variable in class org.iot.dsa.logging.DSLogging
-
-
Max async queue size: 2500 by default.
-
-
DESCRIPTION - Static variable in class org.iot.dsa.node.DSMetadata
-
 
-
DISABLED - Static variable in class org.iot.dsa.node.DSStatus
-
-
Bad, the object has been disabled within DSA.
-
-
disabled - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
DISABLED_STR - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
disconnect() - Method in class org.iot.dsa.dslink.DSLinkConnection
-
-
Forcefully closes an open connection.
-
-
DISPLAY_NAME - Static variable in class org.iot.dsa.node.DSMetadata
-
 
-
DOWN - Static variable in class org.iot.dsa.node.DSStatus
-
-
Bad, communications are down within DSA.
-
-
down - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
DOWN_STR - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
DSAction - Class in org.iot.dsa.node.action
-
-
Fully describes an action and routes invocations to DSNode.onInvoke.
-
-
DSAction() - Constructor for class org.iot.dsa.node.action.DSAction
-
 
-
DSBase64 - Class in org.iot.dsa.io
-
-
Thread-safe Base64 encoder and decoder.
-
-
DSBase64() - Constructor for class org.iot.dsa.io.DSBase64
-
 
-
DSBool - Class in org.iot.dsa.node
-
-
Represents a boolean value.
-
-
DSBytes - Class in org.iot.dsa.node
-
-
Byte array that gets encoded as a base64 string.
-
-
DSDateTime - Class in org.iot.dsa.time
-
-
Wrapper for Java time.
-
-
DSDouble - Class in org.iot.dsa.node
-
-
A 64 bit floating point (Java double).
-
-
DSElement - Class in org.iot.dsa.node
-
-
The primitives of the node model.
-
-
DSElement() - Constructor for class org.iot.dsa.node.DSElement
-
 
-
DSElementType - Enum in org.iot.dsa.node
-
-
The core set of elements that translate directly to a JSON type.
-
-
DSException - Exception in org.iot.dsa.util
-
-
An runtime exception that forwards most calls to the inner exception.
-
-
DSException(Throwable) - Constructor for exception org.iot.dsa.util.DSException
-
 
-
DSFlexEnum - Class in org.iot.dsa.node
-
-
An enum where the value and range can be created at runtime, primarily intended for defining - action parameters.
-
-
DSFloat - Class in org.iot.dsa.node
-
-
A Java float.
-
-
DSGroup - Class in org.iot.dsa.node
-
-
An index accessible collection of primitives.
-
-
DSGroup() - Constructor for class org.iot.dsa.node.DSGroup
-
 
-
DSIBoolean - Interface in org.iot.dsa.node
-
-
Indicates something that is/has a boolean value.
-
-
DSIEnum - Interface in org.iot.dsa.node
-
-
DSA Enum mapping.
-
-
DSIEvent - Interface in org.iot.dsa.node.event
-
-
This is an empty interface, DSTopics are allowed to define events however they wish.
-
-
DSIMetadata - Interface in org.iot.dsa.node
-
-
Nodes and values can implement this to provide meta-data about themselves.
-
-
DSInfo - Class in org.iot.dsa.node
-
-
All node children have corresponding DSInfo instances.
-
-
DSInfoTopic - Class in org.iot.dsa.node.event
-
-
This topic is for info related events on DSNodes.
-
-
DSInfoTopic.Event - Enum in org.iot.dsa.node.event
-
-
The possible events for this topic.
-
-
DSInt - Class in org.iot.dsa.node
-
-
A Java int.
-
-
DSInterval - Enum in org.iot.dsa.time
-
-
Enum representing periods of time.
-
-
DSINumber - Interface in org.iot.dsa.node
-
-
Indicates something that is/has a numeric value.
-
-
DSInvalidPathException - Exception in org.iot.dsa.dslink
-
-
Indicates a request path was invalid.
-
-
DSInvalidPathException(String) - Constructor for exception org.iot.dsa.dslink.DSInvalidPathException
-
 
-
DSIObject - Interface in org.iot.dsa.node
-
-
Super class of anything found in the node tree.
-
-
DSIPassword - Interface in org.iot.dsa.security
-
-
Defines the api for verifying passwords.
-
-
DSIReader - Interface in org.iot.dsa.io
-
-
A decoder that can be used to get an entire graph in pieces, or one large group, or somewhere in - between.
-
-
DSIReader.Token - Enum in org.iot.dsa.io
-
-
Represents the state of the reader, and determines which getter should be called next.
-
-
DSIRequester - Interface in org.iot.dsa.dslink
-
-
Interface for submitting outbound requests.
-
-
DSIResponder - Interface in org.iot.dsa.dslink
-
-
Interface for nodes in the node tree to manually handle requests.
-
-
DSIStatus - Interface in org.iot.dsa.node
-
-
Indicates something that is/has a quality.
-
-
DSIStorable - Interface in org.iot.dsa.node
-
-
Enables custom serialization for non-node values in the configuration database.
-
-
DSISubscriber - Interface in org.iot.dsa.node.event
-
-
DSISubscribers subscribe to DSTopics on DSNodes.
-
-
DSIValue - Interface in org.iot.dsa.node
-
-
How data values are represented in the node tree.
-
-
DSIWriter - Interface in org.iot.dsa.io
-
-
An encoder that can be used to encode large graphs with or without object instances.
-
-
DSJavaEnum - Class in org.iot.dsa.node
-
-
Wrapper for Java enums.
-
-
DSKeys - Class in org.iot.dsa.security
-
-
DSA public private key pair.
-
-
DSKeys(File) - Constructor for class org.iot.dsa.security.DSKeys
-
-
Creates a DSKeys object by decoding existing keys from the given file.
-
-
DSKeys(KeyPair) - Constructor for class org.iot.dsa.security.DSKeys
-
-
Creates a DSKeys object for an existing key pair.
-
-
DSKeys.Signer - Class in org.iot.dsa.security
-
-
Signs bytes.
-
-
DSKeys.Verifier - Class in org.iot.dsa.security
-
-
Verifies signatures.
-
-
DSLink - Class in org.iot.dsa.dslink
-
-
Represents an upstream connection, a node tree, and manages the lifecycle of both.
-
-
DSLink() - Constructor for class org.iot.dsa.dslink.DSLink
-
-
Use the load method to create links.
-
-
DSLinkConfig - Class in org.iot.dsa.dslink
-
-
Configuration options for starting a link.
-
-
DSLinkConfig() - Constructor for class org.iot.dsa.dslink.DSLinkConfig
-
-
This will create an empty unvalidated getConfig.
-
-
DSLinkConfig(File) - Constructor for class org.iot.dsa.dslink.DSLinkConfig
-
-
Can be use to change the working dir from the default process working dir.
-
-
DSLinkConfig(String) - Constructor for class org.iot.dsa.dslink.DSLinkConfig
-
-
Constructor for simulating a command line invocation, the argument will be split on the space - character.
-
-
DSLinkConfig(String[]) - Constructor for class org.iot.dsa.dslink.DSLinkConfig
-
-
Constructor for the arguments pass to a main method.
-
-
DSLinkConnection - Class in org.iot.dsa.dslink
-
-
Represents an upstream connection with a broker.
-
-
DSLinkConnection() - Constructor for class org.iot.dsa.dslink.DSLinkConnection
-
 
-
DSLinkConnection.Listener - Interface in org.iot.dsa.dslink
-
-
Intended for requester functionality so that requesters can know when to - start and stop making requests.
-
-
DSList - Class in org.iot.dsa.node
-
-
Indexed collection of elements.
-
-
DSList() - Constructor for class org.iot.dsa.node.DSList
-
 
-
DSLogger - Class in org.iot.dsa.logging
-
-
Adds a convenience layer to Java Util Logging.
-
-
DSLogger() - Constructor for class org.iot.dsa.logging.DSLogger
-
 
-
DSLogging - Class in org.iot.dsa.logging
-
-
Static utilities for configuring the logging subsystem.
-
-
DSLong - Class in org.iot.dsa.node
-
-
A 64 bit integer (a Java long).
-
-
DSMainNode - Class in org.iot.dsa.dslink
-
-
The root DSNode that triggers a link's custom functionality .
-
-
DSMainNode() - Constructor for class org.iot.dsa.dslink.DSMainNode
-
 
-
DSMap - Class in org.iot.dsa.node
-
-
String keyed collection of elements that preserves the order of addition.
-
-
DSMap() - Constructor for class org.iot.dsa.node.DSMap
-
 
-
DSMap.Entry - Class in org.iot.dsa.node
-
-
Allows values to be accessed quickly by index in the list, rather than having to do a key - lookup in the map.
-
-
DSMetadata - Class in org.iot.dsa.node
-
-
Utility fon constructing metadata maps.
-
-
DSMetadata() - Constructor for class org.iot.dsa.node.DSMetadata
-
 
-
DSMetadata(DSMap) - Constructor for class org.iot.dsa.node.DSMetadata
-
 
-
DSNode - Class in org.iot.dsa.node
-
-
The organizational unit of the node tree.
-
-
DSNode() - Constructor for class org.iot.dsa.node.DSNode
-
 
-
DSNull - Class in org.iot.dsa.node
-
-
Try not to use, it is for decoding raw json.
-
-
DSPasswordAes - Class in org.iot.dsa.security
-
-
Stores an encrypted password which can be decrypted.
-
-
DSPasswordSha256 - Class in org.iot.dsa.security
-
-
Stores and verifies passwords using a SHA-256 hash of the text.
-
-
DSPath - Class in org.iot.dsa.node
-
-
Represents a path in the node tree.
-
-
DSPath(String) - Constructor for class org.iot.dsa.node.DSPath
-
 
-
DSPermission - Enum in org.iot.dsa.security
-
-
Used to define the required permissions for various objects.
-
-
DSPermissionException - Exception in org.iot.dsa.dslink
-
-
Indicates a request has insufficient permissions.
-
-
DSPermissionException(String) - Constructor for exception org.iot.dsa.dslink.DSPermissionException
-
 
-
DSRegistry - Class in org.iot.dsa.node
-
-
Static type related meta-data.
-
-
DSRegistry() - Constructor for class org.iot.dsa.node.DSRegistry
-
 
-
DSRequestException - Exception in org.iot.dsa.dslink
-
-
Indicates something was wrong with a request.
-
-
DSRequestException() - Constructor for exception org.iot.dsa.dslink.DSRequestException
-
 
-
DSRequestException(String) - Constructor for exception org.iot.dsa.dslink.DSRequestException
-
 
-
DSRuntime - Class in org.iot.dsa
-
-
DSA thread pool and timers.
-
-
DSRuntime.Timer - Class in org.iot.dsa
-
-
Can be used to inspect and cancel tasks passed to the run methods in DSRuntime.
-
-
DSStatus - Class in org.iot.dsa.node
-
-
Represent the health, quality or condition of an object.
-
-
DSString - Class in org.iot.dsa.node
-
-
String wrapper.
-
-
DSTime - Class in org.iot.dsa.time
-
-
Misc time utility functions.
-
-
DSTopic - Class in org.iot.dsa.node.event
-
-
DSISubscribers subscribe to DSTopics on DSNodes.
-
-
DSTopic() - Constructor for class org.iot.dsa.node.event.DSTopic
-
 
-
DSUtil - Class in org.iot.dsa.util
-
-
Common utilities.
-
-
DSValue - Class in org.iot.dsa.node
-
-
A convenience that provides some common default behavior.
-
-
DSValue() - Constructor for class org.iot.dsa.node.DSValue
-
 
-
DSValueNode - Class in org.iot.dsa.node
-
-
A convenience implementation of a node that is also a value.
-
-
DSValueNode() - Constructor for class org.iot.dsa.node.DSValueNode
-
 
-
DSValueTopic - Class in org.iot.dsa.node.event
-
-
This topic is for change of value events on DSNodes.
-
-
DSValueTopic.Event - Enum in org.iot.dsa.node.event
-
-
The possible events from this topic.
-
-
DSValueType - Enum in org.iot.dsa.node
-
-
These are the primitive types in the DSA protocol.
-
-
- - - -

E

-
-
EDITOR - Static variable in class org.iot.dsa.node.DSMetadata
-
 
-
EMPTY - Static variable in class org.iot.dsa.node.DSString
-
-
The string of length 0.
-
-
encode(byte[]) - Static method in class org.iot.dsa.io.DSBase64
-
-
Encodes the bytes into a single line string with no padding.
-
-
encode(byte[], int) - Static method in class org.iot.dsa.io.DSBase64
-
-
Encodes the buffer into a String with the given line length.
-
-
encode(DSIWriter, DSNode) - Static method in class org.iot.dsa.io.NodeEncoder
-
-
Writes the node tree to the given writer.
-
-
encode(byte[]) - Static method in class org.iot.dsa.node.DSBytes
-
 
-
encode(byte[]) - Static method in class org.iot.dsa.security.DSPasswordAes
-
-
Encrypts the given bytes.
-
-
encode(String) - Static method in class org.iot.dsa.security.DSPasswordAes
-
-
Encrypts the given text.
-
-
encode(byte[]) - Static method in class org.iot.dsa.security.DSPasswordSha256
-
-
SHA-256 hash of the bytes encoded as url safe base 64..
-
-
encode(String) - Static method in class org.iot.dsa.security.DSPasswordSha256
-
-
SHA-256 hash of the UTF-8 bytes, encoded as url safe base 64..
-
-
encode(long, boolean) - Static method in class org.iot.dsa.time.DSTime
-
-
Converts a Java Calendar into a DSA encoded timestamp.
-
-
encode(long, boolean, StringBuilder) - Static method in class org.iot.dsa.time.DSTime
-
-
Converts a Java Calendar into a DSA encoded timestamp.
-
-
encode(Calendar, boolean, StringBuilder) - Static method in class org.iot.dsa.time.DSTime
-
-
Converts a Java Calendar into a DSA encoded timestamp.
-
-
encodeForFiles(Calendar, StringBuilder) - Static method in class org.iot.dsa.time.DSTime
-
-
Converts a Java Calendar into a number safe for file names: YYMMDDHHMMSS.
-
-
encodeForLogs(Calendar, StringBuilder) - Static method in class org.iot.dsa.time.DSTime
-
-
Converts a Java Calendar into a shorter human readable timestamp for use in logging files.
-
-
encodeKeys() - Method in class org.iot.dsa.security.DSKeys
-
-
Encodes the key pair which can be then decoded with decodeKeys().
-
-
encodeName(String) - Static method in class org.iot.dsa.node.DSPath
-
-
Encodes a name for being in a path.
-
-
encodeName(String, StringBuilder) - Static method in class org.iot.dsa.node.DSPath
-
-
Encodes a name for being in a path.
-
-
encodePath(DSNode) - Static method in class org.iot.dsa.node.DSPath
-
-
Ascends the tree and encodes all the node names into a path.
-
-
encodePublic() - Method in class org.iot.dsa.security.DSKeys
-
-
X9.63 encoding of the public key.
-
-
encodePublicHashDsId() - Method in class org.iot.dsa.security.DSKeys
-
-
Base64 encoding (no padding and url safe) of the SHA256 hash of the public key.
-
-
encodeState() - Method in class org.iot.dsa.node.DSInfo
-
 
-
encodeUrl(byte[]) - Static method in class org.iot.dsa.io.DSBase64
-
-
Encodes to a URL safe base64 string.
-
-
endList() - Method in class org.iot.dsa.io.AbstractWriter
-
 
-
endList() - Method in interface org.iot.dsa.io.DSIWriter
-
-
End the current list.
-
-
endMap() - Method in class org.iot.dsa.io.AbstractWriter
-
 
-
endMap() - Method in interface org.iot.dsa.io.DSIWriter
-
-
End the current map.
-
-
ENUM_RANGE - Static variable in class org.iot.dsa.node.DSMetadata
-
 
-
equal(Object, Object) - Static method in class org.iot.dsa.util.DSUtil
-
-
Comparison that takes null into account; null == null.
-
-
equals(Object) - Method in class org.iot.dsa.node.DSBool
-
 
-
equals(Object) - Method in class org.iot.dsa.node.DSBytes
-
-
True if the argument is a DSINumber and the values are equal or they are both isNull.
-
-
equals(Object) - Method in class org.iot.dsa.node.DSDouble
-
-
True if the argument is a DSINumber and the values are equal or they are both isNull.
-
-
equals(Object) - Method in class org.iot.dsa.node.DSFlexEnum
-
-
True if the argument is a DSFlexEnum and the values are equal or they are both isNull.
-
-
equals(Object) - Method in class org.iot.dsa.node.DSFloat
-
-
True if the argument is a DSINumber and the values are equal or they are both isNull.
-
-
equals(Object) - Method in class org.iot.dsa.node.DSGroup
-
 
-
equals(Object) - Method in class org.iot.dsa.node.DSInfo
-
 
-
equals(Object) - Method in class org.iot.dsa.node.DSInt
-
-
True if the argument is a DSINumber and the values are equal or they are both isNull.
-
-
equals(Object) - Method in class org.iot.dsa.node.DSJavaEnum
-
-
True if the argument is a DSDynamicEnum and the values are equal or they are both isNull.
-
-
equals(Object) - Method in class org.iot.dsa.node.DSLong
-
-
True if the argument is a DSINumber and the values are equal or they are both isNull.
-
-
equals(Object) - Method in class org.iot.dsa.node.DSMap.Entry
-
 
-
equals(Object) - Method in class org.iot.dsa.node.DSMap
-
 
-
equals(Object) - Method in class org.iot.dsa.node.DSNull
-
-
True of the arg == this.
-
-
equals(Object) - Method in class org.iot.dsa.node.DSStatus
-
 
-
equals(Object) - Method in class org.iot.dsa.node.DSString
-
 
-
equals(Object) - Method in class org.iot.dsa.security.DSPasswordAes
-
 
-
equals(Object) - Method in class org.iot.dsa.security.DSPasswordSha256
-
 
-
equals(Object) - Method in class org.iot.dsa.time.DSDateTime
-
 
-
equalsDefault() - Method in class org.iot.dsa.node.DSInfo
-
-
True if this proxies a default and the state and value match the default.
-
-
equalsDefaultState() - Method in class org.iot.dsa.node.DSInfo
-
-
True if the state matches the default state.
-
-
equalsDefaultType() - Method in class org.iot.dsa.node.DSInfo
-
-
True if this proxies a default and the value type matches the default.
-
-
equalsDefaultValue() - Method in class org.iot.dsa.node.DSInfo
-
-
True if this proxies a default and the value matches the default.
-
-
- - - -

F

-
-
FALSE - Static variable in class org.iot.dsa.node.DSBool
-
 
-
FAULT - Static variable in class org.iot.dsa.node.DSStatus
-
-
Bad, an operational error (exception) has occurred within DSA.
-
-
fault - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
FAULT_STR - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
FileLogHandler - Class in org.iot.dsa.logging
-
-
Logs records to a file.
-
-
fine() - Method in class org.iot.dsa.logging.DSLogger
-
-
True if the level is loggable.
-
-
fine(Object) - Method in class org.iot.dsa.logging.DSLogger
-
-
Log a frequent event.
-
-
fine(Object, Throwable) - Method in class org.iot.dsa.logging.DSLogger
-
-
Log a frequent event.
-
-
finer() - Method in class org.iot.dsa.logging.DSLogger
-
-
True if the level is loggable.
-
-
finer(Object) - Method in class org.iot.dsa.logging.DSLogger
-
-
Log a debug event.
-
-
finer(Object, Throwable) - Method in class org.iot.dsa.logging.DSLogger
-
-
Log a debug event.
-
-
finest() - Method in class org.iot.dsa.logging.DSLogger
-
-
True if the level is loggable.
-
-
finest(Object) - Method in class org.iot.dsa.logging.DSLogger
-
-
Log a trace or verbose event.
-
-
finest(Object, Throwable) - Method in class org.iot.dsa.logging.DSLogger
-
-
Log a trace or verbose event.
-
-
fire(DSTopic, DSIEvent, DSInfo) - Method in class org.iot.dsa.node.DSNode
-
-
Notifies subscribers of the event.
-
-
fire(DSTopic, DSIEvent, DSInfo, Object...) - Method in class org.iot.dsa.node.DSNode
-
-
Notifies subscribers of the event.
-
-
first() - Method in class org.iot.dsa.node.DSGroup
-
-
Returns the item at index 0.
-
-
flush() - Method in interface org.iot.dsa.io.DSIWriter
-
-
Flush the stream.
-
-
flush() - Method in class org.iot.dsa.io.json.JsonAppender
-
 
-
flush() - Method in class org.iot.dsa.io.json.JsonWriter
-
 
-
flush() - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
-
Does nothing.
-
-
flush() - Method in class org.iot.dsa.logging.AsyncLogHandler
-
 
-
forString(String) - Static method in enum org.iot.dsa.security.DSPermission
-
 
-
- - - -

G

-
-
generateHmacSHA256Signature(byte[], byte[]) - Static method in class org.iot.dsa.security.DSKeys
-
 
-
generateSharedSecret(byte[]) - Method in class org.iot.dsa.security.DSKeys
-
-
Uses the given public key to generate an ECDH shared secret.
-
-
generateSharedSecret(String) - Method in class org.iot.dsa.security.DSKeys
-
-
Uses the given public key to generate an ECDH shared secret.
-
-
get(int) - Method in class org.iot.dsa.node.DSGroup
-
-
Returns the value at the given index.
-
-
get(int, boolean) - Method in class org.iot.dsa.node.DSGroup
-
-
Optional getter.
-
-
get(int, double) - Method in class org.iot.dsa.node.DSGroup
-
-
Optional getter.
-
-
get(int, int) - Method in class org.iot.dsa.node.DSGroup
-
-
Optional getter.
-
-
get(int, long) - Method in class org.iot.dsa.node.DSGroup
-
-
Optional getter.
-
-
get(int, String) - Method in class org.iot.dsa.node.DSGroup
-
-
Optional getter.
-
-
get(int) - Method in class org.iot.dsa.node.DSList
-
 
-
get(int) - Method in class org.iot.dsa.node.DSMap
-
 
-
get(String) - Method in class org.iot.dsa.node.DSMap
-
-
Returns the value for the given key.
-
-
get(String, boolean) - Method in class org.iot.dsa.node.DSMap
-
-
Optional getter, returns the provided default if the value mapped to the key is null or not - convertible.
-
-
get(String, double) - Method in class org.iot.dsa.node.DSMap
-
-
Optional getter, returns the provided default if the value mapped to the key is null.
-
-
get(String, int) - Method in class org.iot.dsa.node.DSMap
-
-
Optional getter, returns the provided default if the value mapped to the key is null or not - convertible.
-
-
get(String, long) - Method in class org.iot.dsa.node.DSMap
-
-
Optional getter, returns the provided default if the value mapped to the key is null or not - convertible.
-
-
get(String, String) - Method in class org.iot.dsa.node.DSMap
-
-
Optional getter, returns the provided default if the value mapped to the key is null.
-
-
get(String) - Method in class org.iot.dsa.node.DSNode
-
-
Returns the child value with the given name, or null.
-
-
getAction() - Method in interface org.iot.dsa.dslink.responder.ApiObject
-
-
The action, should only be called if isAction() returns true.
-
-
getAction() - Method in interface org.iot.dsa.node.action.ActionResult
-
-
The action that was invoked.
-
-
getAction() - Method in class org.iot.dsa.node.DSInfo
-
 
-
getBackups() - Method in class org.iot.dsa.logging.FileLogHandler
-
-
Backup files for this logging, found in the same directory as the active logging.
-
-
getBit(int, int) - Static method in class org.iot.dsa.util.DSUtil
-
-
Returns true if the bit at the given index is set.
-
-
getBoolean() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
getBoolean() - Method in interface org.iot.dsa.io.DSIReader
-
-
Returns the value when last() == BOOLEAN.
-
-
getBoolean(int) - Method in class org.iot.dsa.node.DSGroup
-
-
Primitive getter.
-
-
getBoolean(String) - Method in class org.iot.dsa.node.DSMap
-
-
Primitive getter.
-
-
getBooleanRange() - Method in class org.iot.dsa.node.DSMetadata
-
-
The boolean range, or null.
-
-
getBrokerUri() - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
If not set, will look for the getConfig in dslink.json.
-
-
getBytes() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
getBytes() - Method in interface org.iot.dsa.io.DSIReader
-
-
Returns the value when last() == BYTES.
-
-
getBytes() - Method in class org.iot.dsa.node.DSBytes
-
-
The raw bytes, do not modify.
-
-
getCalendar() - Static method in class org.iot.dsa.time.DSTime
-
-
Attempts to reuse a calendar instance, the timezone will be set to TimeZone.getDefault().
-
-
getCalendar(long) - Static method in class org.iot.dsa.time.DSTime
-
-
Attempts to reuse a calendar instance and sets the time in millis to the argument and the - timezone to TimeZone.getDefault().
-
-
getCause() - Method in exception org.iot.dsa.util.DSException
-
 
-
getChildren() - Method in interface org.iot.dsa.dslink.responder.ApiObject
-
-
Iterator of child objects, should only be called if hasChildren() returns true.
-
-
getChildren() - Method in class org.iot.dsa.node.DSInfo
-
 
-
getColumns() - Method in interface org.iot.dsa.node.action.ActionTable
-
-
Column definitions, optional but highly recommended.
-
-
getConfig() - Method in class org.iot.dsa.dslink.DSLink
-
 
-
getConfig(String, boolean) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Looks for the value in dslink.json and if not found, returns the fallback.
-
-
getConfig(String, double) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Looks for the value in dslink.json and if not found, returns the fallback.
-
-
getConfig(String, int) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Looks for the value in dslink.json and if not found, returns the fallback.
-
-
getConfig(String, long) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Looks for the value in dslink.json and if not found, returns the fallback.
-
-
getConfig(String, String) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Looks for the value in dslink.json and if not found, returns the fallback.
-
-
getConnection() - Method in class org.iot.dsa.dslink.DSLink
-
 
-
getConnectionId() - Method in class org.iot.dsa.dslink.DSLinkConnection
-
-
A unique descriptive tag such as a combination of the link name and the broker host.
-
-
getDecimalPlaces() - Method in class org.iot.dsa.node.DSMetadata
-
-
The decimal precision or null.
-
-
getDecoder(Class) - Static method in class org.iot.dsa.node.DSRegistry
-
-
The instance to use for decoding.
-
-
getDefault() - Method in class org.iot.dsa.node.DSMetadata
-
-
The default value for an action parameter, or null.
-
-
getDefaultLogger() - Static method in class org.iot.dsa.logging.DSLogging
-
-
The default logger.
-
-
getDefaultObject() - Method in class org.iot.dsa.node.DSInfo
-
-
If this represents a dynamic child, this just returns the current value.
-
-
getDepth() - Method in class org.iot.dsa.io.AbstractWriter
-
-
Current depth in the tree, will be needed by writeNewLineIndent.
-
-
getDescription() - Method in class org.iot.dsa.node.DSMetadata
-
-
The description, or null.
-
-
getDetail() - Method in exception org.iot.dsa.dslink.DSRequestException
-
-
Additional information to supply to the remote endpoint.
-
-
getDisplayName() - Method in class org.iot.dsa.node.DSMetadata
-
-
The alternate display name, or null.
-
-
getDouble() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
getDouble() - Method in interface org.iot.dsa.io.DSIReader
-
-
Returns the value when last() == DOUBLE.
-
-
getDouble(int) - Method in class org.iot.dsa.node.DSGroup
-
-
Primitive getter.
-
-
getDouble(String) - Method in class org.iot.dsa.node.DSMap
-
-
Primitive getter.
-
-
getDsId() - Method in class org.iot.dsa.dslink.DSLink
-
-
Returns the unique id of the connection.
-
-
getDslinkJson() - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
If not set, this will attempt to open dslink.json in the working the process directory.
-
-
getEditor() - Method in class org.iot.dsa.node.DSMetadata
-
-
The editor, or null.
-
-
getElement() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
getElement() - Method in interface org.iot.dsa.io.DSIReader
-
-
Returns the DSElement when last() == raw type or ROOT.
-
-
getElement() - Method in class org.iot.dsa.node.DSInfo
-
-
A convenience that casts getObject().
-
-
getElement(String) - Method in class org.iot.dsa.node.DSNode
-
-
A convenience for (DSElement) get(name).
-
-
getElementType() - Method in class org.iot.dsa.node.DSBool
-
 
-
getElementType() - Method in class org.iot.dsa.node.DSBytes
-
 
-
getElementType() - Method in class org.iot.dsa.node.DSDouble
-
 
-
getElementType() - Method in class org.iot.dsa.node.DSElement
-
-
For switch statements.
-
-
getElementType() - Method in class org.iot.dsa.node.DSList
-
 
-
getElementType() - Method in class org.iot.dsa.node.DSLong
-
 
-
getElementType() - Method in class org.iot.dsa.node.DSMap
-
 
-
getElementType() - Method in class org.iot.dsa.node.DSNull
-
 
-
getElementType() - Method in class org.iot.dsa.node.DSString
-
 
-
getEntry(int) - Method in class org.iot.dsa.node.DSMap
-
 
-
getEntry(String) - Method in class org.iot.dsa.node.DSMap
-
 
-
getEnumRange() - Method in class org.iot.dsa.node.DSMetadata
-
-
The editor, or null.
-
-
getEnums(DSList) - Method in class org.iot.dsa.node.DSFlexEnum
-
 
-
getEnums(DSList) - Method in interface org.iot.dsa.node.DSIEnum
-
-
Adds the range of possible values to the given bucket.
-
-
getEnums(DSList) - Method in class org.iot.dsa.node.DSJavaEnum
-
 
-
getFirst() - Method in class org.iot.dsa.node.DSNode
-
-
The first child, or null.
-
-
getFirstInfo() - Method in class org.iot.dsa.node.DSNode
-
-
The first child info, or null.
-
-
getFirstNodeInfo() - Method in class org.iot.dsa.node.DSNode
-
-
The info for the first child node, or null.
-
-
getFloat(int) - Method in class org.iot.dsa.node.DSGroup
-
-
Primitive getter.
-
-
getHandler(File) - Static method in class org.iot.dsa.logging.FileLogHandler
-
-
Will return an existing handler for the given file, or create a new one.
-
-
getHelpText() - Static method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Help text for command line options.
-
-
getHouseKeepingIntervalMillis() - Method in class org.iot.dsa.logging.AsyncLogHandler
-
-
Ten seconds by default, this is a guideline more than anything else.
-
-
getInfo() - Method in class org.iot.dsa.node.DSNode
-
-
DSInfo for this node in its parent, or null if un-parented.
-
-
getInfo(String) - Method in class org.iot.dsa.node.DSNode
-
-
Returns the info for the child with the given name, or null.
-
-
getInt(int) - Method in class org.iot.dsa.node.DSGroup
-
-
Primitive getter.
-
-
getInt(String) - Method in class org.iot.dsa.node.DSMap
-
-
Primitive getter.
-
-
getInterval() - Method in class org.iot.dsa.DSRuntime.Timer
-
-
The interval between runs, zero or less for no interval.
-
-
getKey() - Method in class org.iot.dsa.node.DSMap.Entry
-
 
-
getKey(int) - Method in class org.iot.dsa.node.DSMap
-
-
Returns the key at the given index.
-
-
getKeys() - Method in class org.iot.dsa.dslink.DSLink
-
-
Public / private keys of the link, used to prove identity with brokers.
-
-
getKeys() - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
If not set, will attempt to use the getConfig in dslink.json and fall back to '.key' in the - process directory if necessary.
-
-
getKeys() - Method in class org.iot.dsa.security.DSKeys
-
-
The public and private keys.
-
-
getLast() - Method in class org.iot.dsa.node.DSNode
-
-
The last child, or null.
-
-
getLastInfo() - Method in class org.iot.dsa.node.DSNode
-
-
The last child info, or null.
-
-
getLastPathElement() - Method in class org.iot.dsa.node.DSPath
-
 
-
getLevel() - Method in enum org.iot.dsa.security.DSPermission
-
 
-
getLink() - Method in class org.iot.dsa.dslink.DSLinkConnection
-
-
The link using this connection.
-
-
getLink() - Method in class org.iot.dsa.dslink.DSMainNode
-
-
The parent link or null.
-
-
getLinkName() - Method in class org.iot.dsa.dslink.DSLink
-
-
As defined in dslink.json.
-
-
getLinkName() - Method in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
getList() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
getList() - Method in interface org.iot.dsa.io.DSIReader
-
-
This should only be called when last() == BEGIN_LIST and it will decodeKeys the entire - list.
-
-
getList(int) - Method in class org.iot.dsa.node.DSGroup
-
-
Primitive getter.
-
-
getList(String) - Method in class org.iot.dsa.node.DSMap
-
-
Return the list, or null.
-
-
getLocalizedMessage() - Method in exception org.iot.dsa.util.DSException
-
 
-
getLogFile() - Method in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
getLogger() - Method in class org.iot.dsa.dslink.DSLink
-
-
The logger as defined in dslink.json.
-
-
getLogger() - Method in class org.iot.dsa.dslink.DSLinkConnection
-
 
-
getLogger(String) - Method in class org.iot.dsa.dslink.DSMainNode
-
-
Creates a child logger of the link.
-
-
getLogger() - Method in class org.iot.dsa.logging.DSLogger
-
-
Override point, returns the console logger by default.
-
-
getLogger(String, File) - Static method in class org.iot.dsa.logging.DSLogging
-
-
Adds a FileLogHandler to the named logger, if there isn't one already.
-
-
getLogger() - Method in class org.iot.dsa.node.DSNode
-
-
Ascends the tree until a logger is found.
-
-
getLogLevel() - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
If not set, will attempt to use the getConfig in dslink.json but fall back to 'info' if - necessary.
-
-
getLong() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
getLong() - Method in interface org.iot.dsa.io.DSIReader
-
-
Returns the value when last() == LONG.
-
-
getLong(int) - Method in class org.iot.dsa.node.DSGroup
-
-
Primitive getter.
-
-
getLong(String) - Method in class org.iot.dsa.node.DSMap
-
-
Primitive getter.
-
-
getMain() - Method in class org.iot.dsa.dslink.DSLink
-
-
Returns the root of the node tree.
-
-
getMainType() - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
The type of the root node.
-
-
getMap() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
getMap() - Method in interface org.iot.dsa.io.DSIReader
-
-
This should only be called when last() == BEGIN_MAP and it will decodeKeys the entire map.
-
-
getMap(int) - Method in class org.iot.dsa.node.DSGroup
-
-
Primitive getter.
-
-
getMap(String) - Method in class org.iot.dsa.node.DSMap
-
-
Returns the map value for the given key, or null.
-
-
getMap() - Method in class org.iot.dsa.node.DSMetadata
-
 
-
getMaxBackups() - Method in class org.iot.dsa.logging.FileLogHandler
-
-
The number of backup files to retain.
-
-
getMaxValue() - Method in class org.iot.dsa.node.DSMetadata
-
-
The max value, or null.
-
-
getMessage() - Method in exception org.iot.dsa.util.DSException
-
 
-
getMetadata(DSMap) - Method in interface org.iot.dsa.dslink.responder.ApiObject
-
 
-
getMetadata(DSMap) - Method in class org.iot.dsa.node.DSFlexEnum
-
 
-
getMetadata(DSMap) - Method in interface org.iot.dsa.node.DSIMetadata
-
-
The entity should add any metadata about itself to the given map.
-
-
getMetadata(DSMap) - Method in class org.iot.dsa.node.DSInfo
-
 
-
getMetadata(DSMap) - Method in class org.iot.dsa.node.DSJavaEnum
-
 
-
getMetadata(DSInfo, DSMap) - Static method in class org.iot.dsa.node.DSMetadata
-
-
Fully acquires metadata about the info.
-
-
getMetadata(DSInfo, DSMap) - Method in class org.iot.dsa.node.DSNode
-
-
Override point, add any meta data for the given info to the provided bucket.
-
-
getMinValue() - Method in class org.iot.dsa.node.DSMetadata
-
-
The min value, or null.
-
-
getName() - Method in interface org.iot.dsa.dslink.responder.ApiObject
-
-
The display name.
-
-
getName() - Method in class org.iot.dsa.node.DSInfo
-
 
-
getName() - Method in class org.iot.dsa.node.DSMetadata
-
-
The name, or null.
-
-
getName() - Method in class org.iot.dsa.node.DSNode
-
-
Returns the name of this node in its parent, or null if un-parented.
-
-
getNode() - Method in class org.iot.dsa.node.DSInfo
-
-
A convenience that casts getObject().
-
-
getNode(String) - Method in class org.iot.dsa.node.DSNode
-
-
A convenience for (DSNode) get(name).
-
-
getNodesFile() - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
If not set, will attempt to use the getConfig in dslink.json but fall back to 'nodes.zip' in - the process directory if necessary.
-
-
getObject() - Method in class org.iot.dsa.node.DSInfo
-
 
-
getOut() - Method in class org.iot.dsa.logging.AsyncLogHandler
-
-
The sink for formatted messages.
-
-
getParameters() - Method in interface org.iot.dsa.node.action.ActionInvocation
-
-
The parameters supplied by the requester, or null.
-
-
getParameters() - Method in interface org.iot.dsa.node.action.ActionSpec
-
-
Returns an iterator for each parameter.
-
-
getParameters() - Method in class org.iot.dsa.node.action.DSAction
-
 
-
getParameters() - Static method in class org.iot.dsa.security.DSKeys
-
-
The AlgorithmParameterSpec for the predefined elliptic curve secp256r1.
-
-
getParams() - Method in class org.iot.dsa.dslink.requester.AbstractInvokeHandler
-
-
Returns the value passed to onInit.
-
-
getParent() - Method in class org.iot.dsa.node.DSInfo
-
 
-
getParent() - Method in class org.iot.dsa.node.DSNode
-
-
Returns the parent node, or null.
-
-
getPath() - Method in class org.iot.dsa.dslink.requester.AbstractInvokeHandler
-
-
Returns the value passed to onInit.
-
-
getPath() - Method in class org.iot.dsa.dslink.requester.AbstractListHandler
-
-
Returns the value passed to onInit.
-
-
getPath() - Method in class org.iot.dsa.dslink.requester.AbstractSubscribeHandler
-
-
Returns the value passed to onInit.
-
-
getPath() - Method in interface org.iot.dsa.dslink.responder.InboundRequest
-
-
The target of the request.
-
-
getPath() - Method in class org.iot.dsa.node.DSNode
-
-
The DSA path, properly encoded.
-
-
getPath() - Method in class org.iot.dsa.node.DSPath
-
-
The raw fully encoded path.
-
-
getPathElements() - Method in class org.iot.dsa.node.DSPath
-
-
The individual, decoded path elements.
-
-
getPermission() - Method in interface org.iot.dsa.dslink.responder.InboundSetRequest
-
-
The permission to set with.
-
-
getPermission() - Method in interface org.iot.dsa.node.action.ActionInvocation
-
-
The permission level of the invoker, should be verified against the permission level required - by the action.
-
-
getPermission() - Method in interface org.iot.dsa.node.action.ActionSpec
-
-
Minimum permission level required to invoke.
-
-
getPermission() - Method in class org.iot.dsa.node.action.DSAction
-
 
-
getPlaceHolder() - Method in class org.iot.dsa.node.DSMetadata
-
-
Placeholder text for text fields, or null.
-
-
getPrivateKey() - Method in class org.iot.dsa.security.DSKeys
-
-
A convenience that casts the private key.
-
-
getPublicKey() - Method in class org.iot.dsa.security.DSKeys
-
-
A convenience that casts the public key.
-
-
getQos() - Method in class org.iot.dsa.dslink.requester.AbstractSubscribeHandler
-
-
Returns the value passed to onInit.
-
-
getRequester() - Method in class org.iot.dsa.dslink.DSLinkConnection
-
 
-
getRequestId() - Method in interface org.iot.dsa.dslink.responder.InboundRequest
-
-
Unique ID of the request, or 0 for subscriptions.
-
-
getResultType() - Method in interface org.iot.dsa.node.action.ActionSpec
-
-
What the action returns.
-
-
getResultType() - Method in class org.iot.dsa.node.action.DSAction
-
 
-
getRows() - Method in interface org.iot.dsa.node.action.ActionTable
-
-
This should return an iterator for the initial set of rows, or null if there aren't any.
-
-
getRunnable() - Method in class org.iot.dsa.DSRuntime.Timer
-
-
The runnable being managed by this timer.
-
-
getSignature() - Method in class org.iot.dsa.security.DSKeys.Signer
-
-
The signature for all bytes passed to the update method.
-
-
getSignatureBase64() - Method in class org.iot.dsa.security.DSKeys.Signer
-
-
The base 64 encoding of the signature for all bytes passed to the update method.
-
-
getStackTrace() - Method in exception org.iot.dsa.util.DSException
-
 
-
getStream() - Method in class org.iot.dsa.dslink.requester.AbstractInvokeHandler
-
-
Returns the value passed to onInit.
-
-
getStream() - Method in class org.iot.dsa.dslink.requester.AbstractListHandler
-
-
Returns the value passed to onInit.
-
-
getStream() - Method in class org.iot.dsa.dslink.requester.AbstractSubscribeHandler
-
-
Returns the value passed to onInit.
-
-
getString() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
getString() - Method in interface org.iot.dsa.io.DSIReader
-
-
Returns the value when last() == STRING.
-
-
getString(int) - Method in class org.iot.dsa.node.DSGroup
-
-
Primitive getter.
-
-
getString(String) - Method in class org.iot.dsa.node.DSMap
-
-
Returns the String value for the given key, or null.
-
-
getSubscriptionId() - Method in interface org.iot.dsa.dslink.responder.InboundSubscribeRequest
-
-
Unique subscription id for this path.
-
-
getTarget() - Method in interface org.iot.dsa.dslink.responder.OutboundListResponse
-
-
The object that represents the path of the request.
-
-
getThreadName() - Method in class org.iot.dsa.logging.AsyncLogHandler
-
-
Used to name the thread that processes logging records.
-
-
getThreadName() - Method in class org.iot.dsa.logging.FileLogHandler
-
 
-
getThreadName() - Method in class org.iot.dsa.logging.PrintStreamLogHandler
-
 
-
getToken() - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Authentication token for the broker, this can return null.
-
-
getTransport() - Method in class org.iot.dsa.dslink.DSLinkConnection
-
 
-
getType() - Method in class org.iot.dsa.node.DSMetadata
-
-
The type for action parameters, can be used to override types in the responder api.
-
-
getUnit() - Method in class org.iot.dsa.node.DSMetadata
-
-
Value if defined, otherwise null.
-
-
getValue() - Method in interface org.iot.dsa.dslink.responder.ApiObject
-
-
Value of the object, should only be called if isValue() returns true.
-
-
getValue() - Method in interface org.iot.dsa.dslink.responder.InboundSetRequest
-
-
The value to set.
-
-
getValue() - Method in class org.iot.dsa.node.DSInfo
-
-
A convenience that casts getObject().
-
-
getValue() - Method in class org.iot.dsa.node.DSMap.Entry
-
 
-
getValue(String) - Method in class org.iot.dsa.node.DSNode
-
-
A convenience for (DSIValue) get(name).
-
-
getValueChild() - Method in class org.iot.dsa.node.DSValueNode
-
-
Subclasses must store the node value in a child value and provide the info for that child - here.
-
-
getValueResults() - Method in interface org.iot.dsa.node.action.ActionSpec
-
-
This is only called for the VALUES result type.
-
-
getValueResults() - Method in class org.iot.dsa.node.action.DSAction
-
 
-
getValues() - Method in interface org.iot.dsa.node.action.ActionValues
-
 
-
getValueType() - Method in class org.iot.dsa.node.DSBool
-
 
-
getValueType() - Method in class org.iot.dsa.node.DSBytes
-
 
-
getValueType() - Method in class org.iot.dsa.node.DSDouble
-
 
-
getValueType() - Method in class org.iot.dsa.node.DSElement
-
-
The DSA value type mapping.
-
-
getValueType() - Method in class org.iot.dsa.node.DSFlexEnum
-
 
-
getValueType() - Method in class org.iot.dsa.node.DSFloat
-
 
-
getValueType() - Method in class org.iot.dsa.node.DSInt
-
 
-
getValueType() - Method in interface org.iot.dsa.node.DSIValue
-
-
The DSA type mapping.
-
-
getValueType() - Method in class org.iot.dsa.node.DSJavaEnum
-
 
-
getValueType() - Method in class org.iot.dsa.node.DSList
-
 
-
getValueType() - Method in class org.iot.dsa.node.DSLong
-
 
-
getValueType() - Method in class org.iot.dsa.node.DSMap
-
 
-
getValueType() - Method in class org.iot.dsa.node.DSNull
-
 
-
getValueType() - Method in class org.iot.dsa.node.DSStatus
-
-
String.
-
-
getValueType() - Method in class org.iot.dsa.node.DSString
-
 
-
getValueType() - Method in class org.iot.dsa.node.DSValueNode
-
 
-
getValueType() - Method in class org.iot.dsa.security.DSPasswordAes
-
 
-
getValueType() - Method in class org.iot.dsa.security.DSPasswordSha256
-
 
-
getValueType() - Method in class org.iot.dsa.time.DSDateTime
-
-
String.
-
-
- - - -

H

-
-
hasChildren() - Method in interface org.iot.dsa.dslink.responder.ApiObject
-
-
True if getChildren() can be called.
-
-
hasChildren() - Method in class org.iot.dsa.node.DSInfo
-
 
-
hashCode() - Method in class org.iot.dsa.node.DSBool
-
 
-
hashCode() - Method in class org.iot.dsa.node.DSBytes
-
 
-
hashCode() - Method in class org.iot.dsa.node.DSDouble
-
 
-
hashCode() - Method in class org.iot.dsa.node.DSFlexEnum
-
 
-
hashCode() - Method in class org.iot.dsa.node.DSFloat
-
 
-
hashCode() - Method in class org.iot.dsa.node.DSGroup
-
 
-
hashCode() - Method in class org.iot.dsa.node.DSInfo
-
 
-
hashCode() - Method in class org.iot.dsa.node.DSInt
-
 
-
hashCode() - Method in class org.iot.dsa.node.DSJavaEnum
-
 
-
hashCode() - Method in class org.iot.dsa.node.DSLong
-
 
-
hashCode() - Method in class org.iot.dsa.node.DSMap.Entry
-
 
-
hashCode() - Method in class org.iot.dsa.node.DSMap
-
 
-
hashCode() - Method in class org.iot.dsa.node.DSStatus
-
 
-
hashCode() - Method in class org.iot.dsa.node.DSString
-
 
-
hashCode() - Method in class org.iot.dsa.security.DSPasswordAes
-
 
-
hashCode() - Method in class org.iot.dsa.security.DSPasswordSha256
-
 
-
hashCode() - Method in class org.iot.dsa.time.DSDateTime
-
 
-
hasNext() - Method in class org.iot.dsa.node.DSInfo
-
-
True if there is another info after this one.
-
-
houseKeeping() - Method in class org.iot.dsa.logging.AsyncLogHandler
-
-
Subclass hook for activities such as rolling files and cleaning up old garbage.
-
-
houseKeeping() - Method in class org.iot.dsa.logging.FileLogHandler
-
 
-
- - - -

I

-
-
InboundInvokeRequest - Interface in org.iot.dsa.dslink.responder
-
-
See ActionInvocation for the real meat.
-
-
InboundListRequest - Interface in org.iot.dsa.dslink.responder
-
-
The details about an incoming list request passed to the responder.
-
-
InboundRequest - Interface in org.iot.dsa.dslink.responder
-
-
Common to all incoming requests.
-
-
InboundSetRequest - Interface in org.iot.dsa.dslink.responder
-
 
-
InboundSubscribeRequest - Interface in org.iot.dsa.dslink.responder
-
-
The details about an incoming subscribe request passed to the responder.
-
-
indexOf(DSElement) - Method in class org.iot.dsa.node.DSGroup
-
-
Scans the collection and returns the first index that equal the arg.
-
-
indexOf(String) - Method in class org.iot.dsa.node.DSMap
-
-
Index of the given key, or -1.
-
-
info() - Method in class org.iot.dsa.logging.DSLogger
-
-
True if the level is loggable.
-
-
info(Object) - Method in class org.iot.dsa.logging.DSLogger
-
-
Log an infrequent major lifecycle event.
-
-
info(Object, Throwable) - Method in class org.iot.dsa.logging.DSLogger
-
-
Log an infrequent major lifecycle event.
-
-
INFO_TOPIC - Static variable in class org.iot.dsa.node.DSNode
-
 
-
init(DSLinkConfig) - Method in class org.iot.dsa.dslink.DSLink
-
-
Configures a link instance including creating the appropriate connection.
-
-
initCause(Throwable) - Method in exception org.iot.dsa.util.DSException
-
 
-
insert(int, DSList...) - Method in interface org.iot.dsa.node.action.ActionInvocation
-
-
Only use with open tables, insert the rows at the given index.
-
-
INSTANCE - Static variable in class org.iot.dsa.node.event.DSInfoTopic
-
-
The only instance of this topic.
-
-
INSTANCE - Static variable in class org.iot.dsa.node.event.DSValueTopic
-
-
The only instance of this topic.
-
-
invoke(String, DSMap, OutboundInvokeHandler) - Method in interface org.iot.dsa.dslink.DSIRequester
-
-
Submits an invoke request.
-
-
invoke(DSInfo, ActionInvocation) - Method in class org.iot.dsa.node.action.DSAction
-
-
Calls onInvoke on the proper node.
-
-
isAction() - Method in interface org.iot.dsa.dslink.responder.ApiObject
-
-
True if the object is an action.
-
-
isAction() - Method in class org.iot.dsa.node.DSInfo
-
 
-
isAdmin() - Method in interface org.iot.dsa.dslink.responder.ApiObject
-
-
Whether or not this object requires configuration permission to read/write.
-
-
isAdmin() - Method in class org.iot.dsa.node.DSInfo
-
 
-
isBad() - Method in class org.iot.dsa.node.DSStatus
-
-
If any of the bad flags are set, or is null.
-
-
isBoolean() - Method in class org.iot.dsa.node.DSBool
-
 
-
isBoolean() - Method in class org.iot.dsa.node.DSElement
-
-
Whether or not the object represents a boolean.
-
-
isBytes() - Method in class org.iot.dsa.node.DSBytes
-
 
-
isBytes(String) - Static method in class org.iot.dsa.node.DSBytes
-
-
True if the string starts with the DSA escape sequence for a base 64 encoded string.
-
-
isBytes() - Method in class org.iot.dsa.node.DSElement
-
-
Whether or not the object represents a byte array.
-
-
isCancelled() - Method in class org.iot.dsa.DSRuntime.Timer
-
 
-
isClosed() - Method in enum org.iot.dsa.node.action.ActionSpec.ResultType
-
-
True if CLOSED_TABLE, VOID, or VALUES.
-
-
isConfig() - Method in enum org.iot.dsa.security.DSPermission
-
 
-
isConfigFault() - Method in class org.iot.dsa.node.DSStatus
-
-
True if the associate bit is set.
-
-
isConnected() - Method in class org.iot.dsa.dslink.DSLinkConnection
-
-
True when a connection is established with the remote endpoint.
-
-
isDefaultInstance() - Method in class org.iot.dsa.node.DSNode
-
-
True if this is the default instance for the type.
-
-
isDefaultOnCopy() - Method in class org.iot.dsa.node.DSInfo
-
-
Whether or not the current value, or the default value is copied.
-
-
isDisabled() - Method in class org.iot.dsa.node.DSStatus
-
-
True if the associate bit is set.
-
-
isDouble() - Method in class org.iot.dsa.node.DSDouble
-
 
-
isDouble() - Method in class org.iot.dsa.node.DSElement
-
-
Whether or not the object represents a double.
-
-
isDouble() - Method in class org.iot.dsa.node.DSFloat
-
 
-
isDouble() - Method in class org.iot.dsa.node.DSInt
-
 
-
isDouble() - Method in interface org.iot.dsa.node.DSINumber
-
-
Whether or not the object represents a double.
-
-
isDown() - Method in class org.iot.dsa.node.DSStatus
-
-
True if the associate bit is set.
-
-
isDynamic() - Method in class org.iot.dsa.node.DSInfo
-
-
Whether or not this info represents a declared default.
-
-
isEmpty() - Method in class org.iot.dsa.node.DSGroup
-
-
Returns true when childCount() == 0.
-
-
isEmpty() - Method in class org.iot.dsa.node.DSMetadata
-
 
-
isEqual(Object) - Method in class org.iot.dsa.node.action.DSAction
-
-
Defaults to the equals method.
-
-
isEqual(Object) - Method in class org.iot.dsa.node.DSElement
-
 
-
isEqual(Object) - Method in class org.iot.dsa.node.DSFlexEnum
-
 
-
isEqual(Object) - Method in class org.iot.dsa.node.DSFloat
-
 
-
isEqual(DSInfo) - Method in class org.iot.dsa.node.DSInfo
-
-
True if the flags and target object are equal (not identical if the target is a node).
-
-
isEqual(Object) - Method in class org.iot.dsa.node.DSInt
-
 
-
isEqual(Object) - Method in interface org.iot.dsa.node.DSIObject
-
-
Equals implementation that doesn't require hashCodes to equal, primarily intended - so for comparing nodes.
-
-
isEqual(Object) - Method in class org.iot.dsa.node.DSJavaEnum
-
 
-
isEqual(Object) - Method in class org.iot.dsa.node.DSNode
-
-
True if the argument is a node with the same children, although their order can be - different.
-
-
isEqual(Object) - Method in class org.iot.dsa.node.DSStatus
-
 
-
isEqual(Object) - Method in class org.iot.dsa.node.event.DSTopic
-
-
Only test instance equality.
-
-
isEqual(Object) - Method in class org.iot.dsa.security.DSPasswordAes
-
 
-
isEqual(Object) - Method in class org.iot.dsa.security.DSPasswordSha256
-
 
-
isEqual(Object) - Method in class org.iot.dsa.time.DSDateTime
-
-
Defaults to the equals method.
-
-
isFault() - Method in class org.iot.dsa.node.DSStatus
-
-
True if the associate bit is set.
-
-
isFinished() - Method in class org.iot.dsa.DSRuntime.Timer
-
-
True if cancelled or was a one time execution and that has finished.
-
-
isFixedList(byte) - Static method in class org.iot.dsa.io.msgpack.MsgpackReader
-
 
-
isFixedMap(byte) - Static method in class org.iot.dsa.io.msgpack.MsgpackReader
-
 
-
isFixInt(byte) - Static method in class org.iot.dsa.io.msgpack.MsgpackReader
-
 
-
isFixStr(byte) - Static method in class org.iot.dsa.io.msgpack.MsgpackReader
-
 
-
isFloat() - Method in class org.iot.dsa.node.DSElement
-
-
Whether or not the object represents a float.
-
-
isFloat() - Method in class org.iot.dsa.node.DSFloat
-
 
-
isFloat() - Method in class org.iot.dsa.node.DSInt
-
 
-
isFloat() - Method in interface org.iot.dsa.node.DSINumber
-
-
Whether or not the object represents a double.
-
-
isGood() - Method in class org.iot.dsa.node.DSStatus
-
-
If true, any associate object / value can be trusted.
-
-
isGroup() - Method in class org.iot.dsa.node.DSElement
-
-
Whether or not the object represents a list or map.
-
-
isGroup() - Method in class org.iot.dsa.node.DSGroup
-
 
-
isHidden() - Method in interface org.iot.dsa.dslink.responder.ApiObject
-
-
True if the object should ignored (not be exposed through the api).
-
-
isHidden() - Method in class org.iot.dsa.node.DSInfo
-
-
Whether or not an object is visible to clients.
-
-
isIdentical(DSInfo) - Method in class org.iot.dsa.node.DSInfo
-
-
True if the flags and target object are identical.
-
-
isIdentical(Object) - Method in class org.iot.dsa.node.DSNode
-
-
True if the argument is a node with the same children in the exact same order.
-
-
isInfinite() - Method in class org.iot.dsa.node.DSDouble
-
 
-
isInt() - Method in class org.iot.dsa.node.DSElement
-
-
Whether or not the object represents an int.
-
-
isInt() - Method in class org.iot.dsa.node.DSFloat
-
 
-
isInt() - Method in class org.iot.dsa.node.DSInt
-
 
-
isInt() - Method in interface org.iot.dsa.node.DSINumber
-
-
Whether or not the object represents an int.
-
-
isList() - Method in class org.iot.dsa.node.DSElement
-
-
Whether or not the object represents a list.
-
-
isList() - Method in class org.iot.dsa.node.DSList
-
-
Returns true.
-
-
isList() - Method in enum org.iot.dsa.security.DSPermission
-
 
-
isLong() - Method in class org.iot.dsa.node.DSElement
-
-
Whether or not the object represents a long.
-
-
isLong() - Method in class org.iot.dsa.node.DSFloat
-
 
-
isLong() - Method in class org.iot.dsa.node.DSInt
-
 
-
isLong() - Method in interface org.iot.dsa.node.DSINumber
-
-
Whether or not the object represents a long.
-
-
isLong() - Method in class org.iot.dsa.node.DSLong
-
 
-
isMap() - Method in class org.iot.dsa.node.DSElement
-
-
Whether or not the object represents a amp.
-
-
isMap() - Method in class org.iot.dsa.node.DSMap
-
-
Returns true.
-
-
isNaN() - Method in class org.iot.dsa.node.DSDouble
-
 
-
isNode() - Method in class org.iot.dsa.node.DSInfo
-
-
Whether or not the object is a DSNode.
-
-
isNode(Object) - Static method in class org.iot.dsa.node.DSNode
-
-
Convenience for instanceof DSNode.
-
-
isNull() - Method in class org.iot.dsa.node.action.DSAction
-
-
False
-
-
isNull() - Method in class org.iot.dsa.node.DSBool
-
 
-
isNull() - Method in class org.iot.dsa.node.DSBytes
-
 
-
isNull() - Method in class org.iot.dsa.node.DSDouble
-
 
-
isNull() - Method in class org.iot.dsa.node.DSElement
-
-
Whether or not the object represents null.
-
-
isNull() - Method in class org.iot.dsa.node.DSFlexEnum
-
 
-
isNull() - Method in class org.iot.dsa.node.DSFloat
-
 
-
isNull(int) - Method in class org.iot.dsa.node.DSGroup
-
-
Whether or not the object at the given index is null.
-
-
isNull() - Method in class org.iot.dsa.node.DSInt
-
 
-
isNull() - Method in interface org.iot.dsa.node.DSIObject
-
 
-
isNull() - Method in interface org.iot.dsa.node.DSIValue
-
-
Values should have an instance representing null.
-
-
isNull() - Method in class org.iot.dsa.node.DSJavaEnum
-
 
-
isNull() - Method in class org.iot.dsa.node.DSList
-
-
Returns false.
-
-
isNull() - Method in class org.iot.dsa.node.DSLong
-
 
-
isNull() - Method in class org.iot.dsa.node.DSMap
-
-
Returns false.
-
-
isNull(String) - Method in class org.iot.dsa.node.DSMap
-
-
Returns true if the key isn't in the map, or it's value is null.
-
-
isNull() - Method in class org.iot.dsa.node.DSNode
-
-
Returns false.
-
-
isNull() - Method in class org.iot.dsa.node.DSNull
-
-
True
-
-
isNull() - Method in class org.iot.dsa.node.DSStatus
-
 
-
isNull() - Method in class org.iot.dsa.node.event.DSTopic
-
-
False
-
-
isNull() - Method in class org.iot.dsa.security.DSPasswordAes
-
 
-
isNull() - Method in class org.iot.dsa.security.DSPasswordSha256
-
 
-
isNull() - Method in class org.iot.dsa.time.DSDateTime
-
 
-
isNumber() - Method in class org.iot.dsa.node.DSDouble
-
 
-
isNumber() - Method in class org.iot.dsa.node.DSElement
-
-
Whether or not the object represents a number.
-
-
isNumber() - Method in class org.iot.dsa.node.DSLong
-
 
-
isOk() - Method in class org.iot.dsa.node.DSStatus
-
 
-
isOpen() - Method in interface org.iot.dsa.dslink.responder.InboundListRequest
-
-
Whether or not the list stream is still open.
-
-
isOpen() - Method in interface org.iot.dsa.node.action.ActionInvocation
-
-
Whether or not response is still open.
-
-
isOpen() - Method in enum org.iot.dsa.node.action.ActionSpec.ResultType
-
-
True if OPEN_TABLE or STREAM_TABLE
-
-
isOverride() - Method in class org.iot.dsa.node.DSStatus
-
-
True if the associate bit is set.
-
-
isRead() - Method in enum org.iot.dsa.security.DSPermission
-
 
-
isReadOnly() - Method in interface org.iot.dsa.dslink.responder.ApiObject
-
-
True if the object is a value and cannot be written.
-
-
isReadOnly() - Method in class org.iot.dsa.node.DSInfo
-
-
Whether or not an object can be written by a client.
-
-
isRemoteConfigFault() - Method in class org.iot.dsa.node.DSStatus
-
 
-
isRemoteDisabled() - Method in class org.iot.dsa.node.DSStatus
-
 
-
isRemoteDown() - Method in class org.iot.dsa.node.DSStatus
-
 
-
isRemoteFault() - Method in class org.iot.dsa.node.DSStatus
-
 
-
isRemoteOverride() - Method in class org.iot.dsa.node.DSStatus
-
 
-
isRemoteStale() - Method in class org.iot.dsa.node.DSStatus
-
 
-
isRemoteUnknown() - Method in class org.iot.dsa.node.DSStatus
-
 
-
isRequester() - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Looks for the isRequester config, false by default.
-
-
isResponder() - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Looks for the isResponder config, true by default.
-
-
isRunning() - Method in class org.iot.dsa.DSRuntime.Timer
-
-
True when the runnable is being actually being executed.
-
-
isRunning() - Method in class org.iot.dsa.node.DSNode
-
-
A convenience for !isStopped().
-
-
isStable() - Method in class org.iot.dsa.node.DSNode
-
-
True after stable is called, children are stable before their parents.
-
-
isStale() - Method in class org.iot.dsa.node.DSStatus
-
 
-
isStarted() - Method in class org.iot.dsa.node.DSNode
-
-
True after start is called, children are started before their parents.
-
-
isStopped() - Method in class org.iot.dsa.node.DSNode
-
-
True after stop is called, children are stopped before their parents.
-
-
isStream() - Method in enum org.iot.dsa.node.action.ActionSpec.ResultType
-
-
True if this is the STREAM_TABLE.
-
-
isStreamOpen() - Method in interface org.iot.dsa.dslink.requester.OutboundStream
-
-
Whether or not the request is open.
-
-
isString() - Method in class org.iot.dsa.node.DSElement
-
-
Whether or not the object represents a string.
-
-
isString() - Method in class org.iot.dsa.node.DSString
-
 
-
isSubscribed() - Method in class org.iot.dsa.node.DSNode
-
-
True if there are any subscribers.
-
-
isSubscribed(DSInfo, DSTopic) - Method in class org.iot.dsa.node.DSNode
-
-
True if there are any subscriptions with the matching child and topic.
-
-
isSubscribed(DSTopic) - Method in class org.iot.dsa.node.DSNode
-
-
True if there any subscriptions for the given topic.
-
-
isTransient() - Method in class org.iot.dsa.node.DSInfo
-
-
Whether or not an object is persistent.
-
-
isUnknown() - Method in class org.iot.dsa.node.DSStatus
-
 
-
isValid(DSElement) - Method in interface org.iot.dsa.security.DSIPassword
-
-
Returns true if the give element is valid according to the backing implementation.
-
-
isValid(DSElement) - Method in class org.iot.dsa.security.DSPasswordAes
-
-
Encrypts the string value of the given element and compares against the value stored in this - object.
-
-
isValid(String) - Method in class org.iot.dsa.security.DSPasswordAes
-
-
Encrypts the given string and compares against the value stored in this object.
-
-
isValid(DSElement) - Method in class org.iot.dsa.security.DSPasswordSha256
-
-
Hashes the string value of the given element and compares against the hash stored in this - object.
-
-
isValid(String) - Method in class org.iot.dsa.security.DSPasswordSha256
-
-
Hashes the given string and compares against the value stored in this object.
-
-
isValue() - Method in interface org.iot.dsa.dslink.responder.ApiObject
-
-
True if getValue() can be called.
-
-
isValue() - Method in class org.iot.dsa.node.DSInfo
-
 
-
isValues() - Method in enum org.iot.dsa.node.action.ActionSpec.ResultType
-
 
-
isVoid() - Method in enum org.iot.dsa.node.action.ActionSpec.ResultType
-
 
-
isWrite() - Method in enum org.iot.dsa.security.DSPermission
-
 
-
isZip() - Method in class org.iot.dsa.io.json.JsonAppender
-
-
Whether or not this is zipping the output.
-
-
iterateNodes() - Method in class org.iot.dsa.node.DSNode
-
-
Returns an info iterator of child DSNodes.
-
-
iterateValues() - Method in class org.iot.dsa.node.DSNode
-
-
Returns an info iterator of child DSIValues.
-
-
iterator() - Method in class org.iot.dsa.node.DSList
-
-
Returns an iterator that does not implement remove.
-
-
iterator() - Method in class org.iot.dsa.node.DSNode
-
-
Returns an info iterator of all children.
-
-
- - - -

J

-
-
JsonAppender - Class in org.iot.dsa.io.json
-
-
Json implementation of DSWriter intended for Appendables such as StringBuilders.
-
-
JsonAppender() - Constructor for class org.iot.dsa.io.json.JsonAppender
-
-
Be sure to call one of the setOutput methods.
-
-
JsonAppender(Appendable) - Constructor for class org.iot.dsa.io.json.JsonAppender
-
-
Will write directly to the given appendable.
-
-
JsonAppender(File) - Constructor for class org.iot.dsa.io.json.JsonAppender
-
-
Creates an underlying FileWriter.
-
-
JsonAppender(File, String) - Constructor for class org.iot.dsa.io.json.JsonAppender
-
-
Will create a zip file using the zipFileName as file name inside the zip.
-
-
JsonAppender(OutputStream) - Constructor for class org.iot.dsa.io.json.JsonAppender
-
-
Creates an underlying OutputStreamWriter.
-
-
JsonAppender(OutputStream, String) - Constructor for class org.iot.dsa.io.json.JsonAppender
-
-
Will write a zip file to the given stream.
-
-
JsonConstants - Interface in org.iot.dsa.io.json
-
-
Useful constants.
-
-
JsonReader - Class in org.iot.dsa.io.json
-
-
Json implementation of DSReader.
-
-
JsonReader() - Constructor for class org.iot.dsa.io.json.JsonReader
-
 
-
JsonReader(CharSequence) - Constructor for class org.iot.dsa.io.json.JsonReader
-
 
-
JsonReader(File) - Constructor for class org.iot.dsa.io.json.JsonReader
-
 
-
JsonReader(InputStream, String) - Constructor for class org.iot.dsa.io.json.JsonReader
-
 
-
JsonReader(Reader) - Constructor for class org.iot.dsa.io.json.JsonReader
-
 
-
JsonWriter - Class in org.iot.dsa.io.json
-
-
Json implementation of DSWriter intended for OutputStreams and Writers.
-
-
JsonWriter() - Constructor for class org.iot.dsa.io.json.JsonWriter
-
-
Be sure to call one of the setOutput methods.
-
-
JsonWriter(File) - Constructor for class org.iot.dsa.io.json.JsonWriter
-
-
Creates an underlying FileWriter.
-
-
JsonWriter(File, String) - Constructor for class org.iot.dsa.io.json.JsonWriter
-
-
Will create a zip file using the zipFileName as file name inside the zip.
-
-
JsonWriter(OutputStream) - Constructor for class org.iot.dsa.io.json.JsonWriter
-
-
Creates an underlying OutputStreamWriter.
-
-
JsonWriter(OutputStream, String) - Constructor for class org.iot.dsa.io.json.JsonWriter
-
-
Will write a zip file to the given stream.
-
-
JsonWriter(Writer) - Constructor for class org.iot.dsa.io.json.JsonWriter
-
 
-
- - - -

K

-
-
key(CharSequence) - Method in class org.iot.dsa.io.AbstractWriter
-
 
-
key(CharSequence) - Method in interface org.iot.dsa.io.DSIWriter
-
-
Write a key in the current map.
-
-
keys - Variable in class org.iot.dsa.node.DSMap
-
-
For preserving order.
-
-
- - +
A B C D E F G H I J K L M N O P R S T U V W  + -

L

-
-
last() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
last() - Method in interface org.iot.dsa.io.DSIReader
-
-
The last value returned from next().
-
-
last() - Method in class org.iot.dsa.node.DSGroup
-
-
Returns the item at the highest index.
-
-
lastIndexOf(DSElement) - Method in class org.iot.dsa.node.DSGroup
-
-
Scans the collection and returns the first index that equal the arg.
-
-
lastRun() - Method in class org.iot.dsa.DSRuntime.Timer
-
-
The lastRun run or -1 if it hasn't run yet.
-
-
length() - Method in class org.iot.dsa.io.AbstractWriter
-
-
Returns 0 by default.
-
-
length() - Method in interface org.iot.dsa.io.DSIWriter
-
-
If the writer is buffering output, this returns the size of that buffer.
-
-
length() - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
-
Returns the number of bytes in the outgoing byte buffer.
-
-
length() - Method in class org.iot.dsa.node.DSBytes
-
-
The number of bytes in the array.
-
-
list(String, OutboundListHandler) - Method in interface org.iot.dsa.dslink.DSIRequester
-
-
Submits a list request.
-
-
list - Variable in class org.iot.dsa.node.DSList
-
 
-
load(DSLinkConfig) - Static method in class org.iot.dsa.dslink.DSLink
-
-
Creates a link by first testing for an existing serialized database.
-
-
- - - -

M

-
-
main(String[]) - Static method in class org.iot.dsa.dslink.DSLink
-
-
This is a convenience for DSLink.load(new DSLinkConfig(args)).run() and can be used as the - the main class for any link.
-
-
make(boolean) - Static method in class org.iot.dsa.node.DSElement
-
-
Creates an DSIObject representation of the primitive.
-
-
make(byte[]) - Static method in class org.iot.dsa.node.DSElement
-
-
Creates an DSIObject representation of the primitive.
-
-
make(double) - Static method in class org.iot.dsa.node.DSElement
-
-
Creates an DSIObject representation of the primitive.
-
-
make(int) - Static method in class org.iot.dsa.node.DSElement
-
-
Creates an DSIObject representation of the primitive.
-
-
make(long) - Static method in class org.iot.dsa.node.DSElement
-
-
Creates an DSIObject representation of the primitive.
-
-
make(String) - Static method in class org.iot.dsa.node.DSElement
-
-
Creates an DSIObject representation of the primitive.
-
-
makeBackup() - Method in class org.iot.dsa.logging.FileLogHandler
-
-
Only public for testing, do not call.
-
-
makeMessage(Throwable) - Static method in exception org.iot.dsa.util.DSException
-
-
Attempts come up with the best description of the argument.
-
-
makeNull() - Static method in class org.iot.dsa.node.DSElement
-
-
Creates an DSIObject representation of null.
-
-
makeRuntime(Throwable) - Static method in exception org.iot.dsa.util.DSException
-
-
If the given exception is already a runtime exception, it is cast and returned, - otherwise it will be returned wrapped by an instance of this class.
-
-
map - Variable in class org.iot.dsa.node.DSMap
-
 
-
MAX_VALUE - Static variable in class org.iot.dsa.node.DSMetadata
-
 
-
millis() - Method in enum org.iot.dsa.time.DSInterval
-
-
The approximate number of ms in the interval.
-
-
MILLIS_DAY - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_FIFTEEN_MINUTES - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_FIFTEEN_SECONDS - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_FIVE_MINUTES - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_FIVE_SECONDS - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_FOUR_HOURS - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_HOUR - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_MINUTE - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_MONTH - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_QUARTER - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_SECOND - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_SIX_HOURS - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_TEN_MINUTES - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_TEN_SECONDS - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_THIRTY_MINUTES - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_THIRTY_SECONDS - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_THREE_HOURS - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_TWELVE_HOURS - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_TWENTY_MINUTES - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_TWO_HOURS - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_WEEK - Static variable in class org.iot.dsa.time.DSTime
-
 
-
MILLIS_YEAR - Static variable in class org.iot.dsa.time.DSTime
-
 
-
millisToNanos(long) - Static method in class org.iot.dsa.time.DSTime
-
 
-
MIN_VALUE - Static variable in class org.iot.dsa.node.DSMetadata
-
 
-
MsgpackReader - Class in org.iot.dsa.io.msgpack
-
-
MsgPack implementation of DSReader.
-
-
MsgpackReader() - Constructor for class org.iot.dsa.io.msgpack.MsgpackReader
-
 
-
MsgpackReader(InputStream) - Constructor for class org.iot.dsa.io.msgpack.MsgpackReader
-
 
-
MsgpackWriter - Class in org.iot.dsa.io.msgpack
-
 
-
MsgpackWriter() - Constructor for class org.iot.dsa.io.msgpack.MsgpackWriter
-
 
-
MsgpackWriter(ByteBuffer) - Constructor for class org.iot.dsa.io.msgpack.MsgpackWriter
-
 
-
- - - -

N

-
-
NAME - Static variable in class org.iot.dsa.node.DSMetadata
-
 
-
NANOS_IN_MS - Static variable in class org.iot.dsa.time.DSTime
-
 
-
NANOS_IN_SEC - Static variable in class org.iot.dsa.time.DSTime
-
 
-
nanosToMillis(long) - Static method in class org.iot.dsa.time.DSTime
-
 
-
newKeyPair() - Static method in class org.iot.dsa.security.DSKeys
-
-
Creates a key pair for the predefined elliptic curve secp256r1.
-
-
newSignature() - Static method in class org.iot.dsa.security.DSKeys
-
-
Returns a SHA256withECDSA signature.
-
-
newSigner() - Method in class org.iot.dsa.security.DSKeys
-
-
Creates a signer for this private key.
-
-
newVerifier() - Method in class org.iot.dsa.security.DSKeys
-
-
Creates a verifier for this public key.
-
-
next() - Method in class org.iot.dsa.io.AbstractReader
-
-
Subclasses must override this, read the next item from the stream, then call one of the - setXxx methods.
-
-
next() - Method in interface org.iot.dsa.io.DSIReader
-
-
Advances the reader to the next item and returns the token representing it's current state.
-
-
next() - Method in class org.iot.dsa.io.json.JsonReader
-
 
-
next() - Method in class org.iot.dsa.io.msgpack.MsgpackReader
-
 
-
next() - Method in class org.iot.dsa.node.DSInfo
-
-
The next info in the parent node.
-
-
next(long) - Method in enum org.iot.dsa.time.DSInterval
-
-
Returns the nextRun interval for the previously aligned timestamp.
-
-
nextAction() - Method in class org.iot.dsa.node.DSInfo
-
-
The next DSInfo in the parent that is an action, or null.
-
-
nextNode() - Method in class org.iot.dsa.node.DSInfo
-
-
The next DSInfo in the parent that is a node, or null.
-
-
nextRun() - Method in class org.iot.dsa.DSRuntime.Timer
-
-
The next scheduled time to run.
-
-
nextValue() - Method in class org.iot.dsa.node.DSInfo
-
-
The next DSInfo in the parent that is a value, or null.
-
-
NodeDecoder - Class in org.iot.dsa.io
-
-
Decodes a node (tree) that was encoded with NodeEncoder.
-
-
NodeEncoder - Class in org.iot.dsa.io
-
-
Encodes a node tree using a compact JSON schema.
-
-
NULL - Static variable in class org.iot.dsa.node.DSBool
-
 
-
NULL - Static variable in class org.iot.dsa.node.DSBytes
-
 
-
NULL - Static variable in class org.iot.dsa.node.DSDouble
-
 
-
NULL - Static variable in class org.iot.dsa.node.DSFlexEnum
-
 
-
NULL - Static variable in class org.iot.dsa.node.DSFloat
-
 
-
NULL - Static variable in class org.iot.dsa.node.DSInt
-
 
-
NULL - Static variable in class org.iot.dsa.node.DSJavaEnum
-
 
-
NULL - Static variable in class org.iot.dsa.node.DSLong
-
 
-
NULL - Static variable in class org.iot.dsa.node.DSNull
-
 
-
NULL - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
NULL - Static variable in class org.iot.dsa.node.DSString
-
 
-
NULL - Static variable in class org.iot.dsa.security.DSPasswordAes
-
 
-
NULL - Static variable in class org.iot.dsa.security.DSPasswordSha256
-
 
-
NULL - Static variable in class org.iot.dsa.time.DSDateTime
-
 
-
- - - -

O

-
-
OK - Static variable in class org.iot.dsa.node.DSStatus
-
-
Good, no other status applies.
-
-
ok - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
OK_OVERRIDE - Static variable in class org.iot.dsa.node.DSStatus
-
-
Good, the value is overridden within DSA.
-
-
OK_OVERRIDE_STR - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
OK_REMOTE_OVERRIDE - Static variable in class org.iot.dsa.node.DSStatus
-
-
Good, the value is overridden outside of DSA.
-
-
OK_REMOTE_OVERRIDE_STR - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
OK_STR - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
okOverride - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
okRemoteOverride - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
onChildAdded(DSInfo) - Method in class org.iot.dsa.node.DSNode
-
-
Called when the given child is added and in the stable state.
-
-
onChildChanged(DSInfo) - Method in class org.iot.dsa.node.DSNode
-
-
Called when the given child is changed and in the stable state.
-
-
onChildChanged(DSInfo) - Method in class org.iot.dsa.node.DSValueNode
-
-
This fires the NODE_CHANGED topic when the value child changes.
-
-
onChildRemoved(DSInfo) - Method in class org.iot.dsa.node.DSNode
-
-
Called when the given child is removed and in the stable state.
-
-
onClose() - Method in interface org.iot.dsa.dslink.requester.OutboundRequestHandler
-
-
Callback for when the request stream is closed, no matter how or by who.
-
-
onClose() - Method in class org.iot.dsa.dslink.requester.SimpleRequestHandler
-
-
Does nothing by default.
-
-
onClose() - Method in interface org.iot.dsa.dslink.responder.OutboundListResponse
-
-
Will be called no matter how the stream is closed.
-
-
onClose(Integer) - Method in interface org.iot.dsa.dslink.responder.SubscriptionCloseHandler
-
-
Will be called no matter how the subscription is terminated.
-
-
onClose() - Method in interface org.iot.dsa.node.action.ActionResult
-
-
Always called, whether or not the result is a stream, and no matter who closes it.
-
-
onColumns(DSList) - Method in interface org.iot.dsa.dslink.requester.OutboundInvokeHandler
-
-
Called whenever columns are received.
-
-
onComplete() - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
-
Callback, for when the top level container is finished.
-
-
onConnect(DSLinkConnection) - Method in interface org.iot.dsa.dslink.DSLinkConnection.Listener
-
-
Called asynchronously after the connection with the endpoint is opened.
-
-
onConnect() - Method in class org.iot.dsa.dslink.DSLinkConnection
-
-
Called after onInitialize and before onRun.
-
-
onDisconnect(DSLinkConnection) - Method in interface org.iot.dsa.dslink.DSLinkConnection.Listener
-
-
Called synchronously after the connection with the endpoint is closed.
-
-
onDisconnect() - Method in class org.iot.dsa.dslink.DSLinkConnection
-
-
Called when this network connection has been closed.
-
-
onError(String, String, String) - Method in interface org.iot.dsa.dslink.requester.OutboundRequestHandler
-
-
Callback for when an error is received.
-
-
onError(String, String, String) - Method in class org.iot.dsa.dslink.requester.SimpleRequestHandler
-
-
Does nothing by default.
-
-
onEvent(DSTopic, DSIEvent, DSNode, DSInfo, Object...) - Method in interface org.iot.dsa.node.event.DSISubscriber
-
-
Subscription callback.
-
-
onInfoChanged(DSInfo) - Method in class org.iot.dsa.node.DSNode
-
-
Called when the given info is modified and in the stable state.
-
-
onInit(String, DSMap, OutboundStream) - Method in class org.iot.dsa.dslink.requester.AbstractInvokeHandler
-
-
Sets the fields so they can be access via the corresponding getters.
-
-
onInit(String, OutboundStream) - Method in class org.iot.dsa.dslink.requester.AbstractListHandler
-
-
Sets the fields so they can be accessed with the corresponding getters.
-
-
onInit(String, int, OutboundStream) - Method in class org.iot.dsa.dslink.requester.AbstractSubscribeHandler
-
-
Sets the fields so they can be accessed via the corresponding getters.
-
-
onInit(String, DSMap, OutboundStream) - Method in interface org.iot.dsa.dslink.requester.OutboundInvokeHandler
-
-
Called by the requester before returning from the invoke method.
-
-
onInit(String, OutboundStream) - Method in interface org.iot.dsa.dslink.requester.OutboundListHandler
-
-
Called by the requester before returning from the list method.
-
-
onInit(String, int, OutboundStream) - Method in interface org.iot.dsa.dslink.requester.OutboundSubscribeHandler
-
-
Called by the requester before returning from the subscribe method.
-
-
onInitialize() - Method in class org.iot.dsa.dslink.DSLinkConnection
-
-
Always called before onConnect.
-
-
onInitialized() - Method in interface org.iot.dsa.dslink.requester.OutboundListHandler
-
-
Called once the initial state of the target has been transmitted.
-
-
onInsert(int, DSList) - Method in interface org.iot.dsa.dslink.requester.OutboundInvokeHandler
-
-
Called when the given rows should be inserted at the given index.
-
-
onInvoke(InboundInvokeRequest) - Method in interface org.iot.dsa.dslink.DSIResponder
-
-
The implementation should quickly create an object for responding to the request, but do no - processing of it on the calling thread.
-
-
onInvoke(DSInfo, ActionInvocation) - Method in class org.iot.dsa.dslink.DSLink
-
-
Handles the save action.
-
-
onInvoke(DSInfo, ActionInvocation) - Method in class org.iot.dsa.node.DSNode
-
-
Override point, called by the default implementation of DSAction.invoke.
-
-
onList(InboundListRequest) - Method in interface org.iot.dsa.dslink.DSIResponder
-
-
The implementation should quickly create an object for responding to the request, but do no - processing of it on the calling thread.
-
-
onMode(OutboundInvokeHandler.Mode) - Method in interface org.iot.dsa.dslink.requester.OutboundInvokeHandler
-
-
Called whenever a mode is received.
-
-
onRemove(String) - Method in interface org.iot.dsa.dslink.requester.OutboundListHandler
-
-
Only called after onOpen(), indicates something about the target of the request has been - removed.
-
-
onReplace(int, int, DSList) - Method in interface org.iot.dsa.dslink.requester.OutboundInvokeHandler
-
-
The rows starting and ending with the given indexes should be removed and the given rows - inserted at the start index.
-
-
onRun() - Method in class org.iot.dsa.dslink.DSLinkConnection
-
-
The long term management of the connection (reading and writing).
-
-
onSet(InboundSetRequest) - Method in interface org.iot.dsa.dslink.DSIResponder
-
-
The implementation should do no processing of it on the calling thread.
-
-
onSet(DSInfo, DSIValue) - Method in class org.iot.dsa.node.DSNode
-
-
Override point, called when a value being set.
-
-
onSet(DSIValue) - Method in class org.iot.dsa.node.DSNode
-
-
Override point, called only when a DSNode subclass implements DSIValue is being set.
-
-
onSet(DSIValue) - Method in class org.iot.dsa.node.DSValueNode
-
 
-
onStable() - Method in class org.iot.dsa.dslink.DSLinkConnection
-
-
Starts the connection.
-
-
onStable() - Method in class org.iot.dsa.node.DSNode
-
-
Called once this node is stable, but before stable is called on children.
-
-
onStarted() - Method in class org.iot.dsa.node.DSNode
-
-
Called once this node and its entire subtree is started.
-
-
onStopped() - Method in class org.iot.dsa.dslink.DSLink
-
 
-
onStopped() - Method in class org.iot.dsa.node.DSNode
-
-
Called once this node and its entire subtree is stopped.
-
-
onSubscribe(InboundSubscribeRequest) - Method in interface org.iot.dsa.dslink.DSIResponder
-
-
The implementation should quickly create an object for responding to the request, but do no - processing of it on the calling thread.
-
-
onSubscribe(DSTopic, DSInfo, DSISubscriber) - Method in class org.iot.dsa.node.DSNode
-
-
Called for every subscription.
-
-
onSubscribed() - Method in class org.iot.dsa.node.DSNode
-
-
Called when this node transitions from having no subscriptions to having a subscription of - any kind.
-
-
onSubscribed(DSTopic, DSInfo) - Method in class org.iot.dsa.node.DSNode
-
-
Called when the child and topic pair transitions from having no subscriptions to have a - subscription.
-
-
onTableMeta(DSMap) - Method in interface org.iot.dsa.dslink.requester.OutboundInvokeHandler
-
-
Called whenever metadata for the entire table is received.
-
-
onUnsubscribe(DSTopic, DSInfo, DSISubscriber) - Method in class org.iot.dsa.node.DSNode
-
-
Called for every unsubscribe.
-
-
onUnsubscribed() - Method in class org.iot.dsa.node.DSNode
-
-
Called when this node transitions to having no subscriptions of any kind.
-
-
onUnsubscribed(DSTopic, DSInfo) - Method in class org.iot.dsa.node.DSNode
-
-
Called when the child and topic pair transitions to having no subscriptions.
-
-
onUnsubscribed(DSTopic, DSNode, DSInfo) - Method in interface org.iot.dsa.node.event.DSISubscriber
-
-
Called no matter how the unsubscribe happens, whether explicitly or if the node - unsubscribes itself.
-
-
onUpdate(DSList) - Method in interface org.iot.dsa.dslink.requester.OutboundInvokeHandler
-
-
Called for every row.
-
-
onUpdate(String, DSElement) - Method in interface org.iot.dsa.dslink.requester.OutboundListHandler
-
-
Called to provide a value for node metadata, attribute or child.
-
-
onUpdate(DSDateTime, DSElement, DSStatus) - Method in interface org.iot.dsa.dslink.requester.OutboundSubscribeHandler
-
-
Subscription update mechanism.
-
-
org.iot.dsa - package org.iot.dsa
-
-
Use the DSRuntime thread pool and timers.
-
-
org.iot.dsa.dslink - package org.iot.dsa.dslink
-
-
DSLink is the main entry point for an application.
-
-
org.iot.dsa.dslink.requester - package org.iot.dsa.dslink.requester
-
-
API for implementing requesters without having to modeling everything in the node tree.
-
-
org.iot.dsa.dslink.responder - package org.iot.dsa.dslink.responder
-
-
API for implementing responders without having modeling everything in the node tree.
-
-
org.iot.dsa.io - package org.iot.dsa.io
-
-
Node serialization and streaming abstraction for JSON and MsgPack.
-
-
org.iot.dsa.io.json - package org.iot.dsa.io.json
-
 
-
org.iot.dsa.io.msgpack - package org.iot.dsa.io.msgpack
-
 
-
org.iot.dsa.logging - package org.iot.dsa.logging
-
-
Async handler for Java Util Logging that also manages log backups.
-
-
org.iot.dsa.node - package org.iot.dsa.node
-
-
Persistent data model used to build the node tree of a link.
-
-
org.iot.dsa.node.action - package org.iot.dsa.node.action
-
 
-
org.iot.dsa.node.event - package org.iot.dsa.node.event
-
 
-
org.iot.dsa.security - package org.iot.dsa.security
-
 
-
org.iot.dsa.time - package org.iot.dsa.time
-
 
-
org.iot.dsa.util - package org.iot.dsa.util
-
 
-
OutboundInvokeHandler - Interface in org.iot.dsa.dslink.requester
-
-
Callback mechanism passed to the invoke method on DSIRequester.
-
-
OutboundInvokeHandler.Mode - Enum in org.iot.dsa.dslink.requester
-
 
-
OutboundListHandler - Interface in org.iot.dsa.dslink.requester
-
-
Callback mechanism passed to the list method on DSIRequester.
-
-
OutboundListResponse - Interface in org.iot.dsa.dslink.responder
-
-
The responder is responsible for returning this upon notification of a list request.
-
-
OutboundRequestHandler - Interface in org.iot.dsa.dslink.requester
-
-
Callbacks common to all outbound requests.
-
-
OutboundStream - Interface in org.iot.dsa.dslink.requester
-
-
Mechanism for the requester to close outbound requests.
-
-
OutboundSubscribeHandler - Interface in org.iot.dsa.dslink.requester
-
-
Callback mechanism passed to the subscribe method in the requester.
-
-
- - - -

P

-
-
parse(String[]) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Parses command line args to set the internal state of this object.
-
-
PLACEHOLDER - Static variable in class org.iot.dsa.node.DSMetadata
-
 
-
prepareParameter(DSInfo, DSMap) - Method in class org.iot.dsa.node.action.DSAction
-
-
Override point, called for each parameter as it is being sent to the requester.
-
-
prettyPrint - Variable in class org.iot.dsa.io.AbstractWriter
-
-
Subclasses can use this if applicable.
-
-
printStackTrace() - Method in exception org.iot.dsa.util.DSException
-
 
-
printStackTrace(PrintStream) - Method in exception org.iot.dsa.util.DSException
-
 
-
printStackTrace(PrintWriter) - Method in exception org.iot.dsa.util.DSException
-
 
-
PrintStreamLogHandler - Class in org.iot.dsa.logging
-
-
Async logging handler for writing to streams such as System.out.
-
-
PrintStreamLogHandler(String, PrintStream) - Constructor for class org.iot.dsa.logging.PrintStreamLogHandler
-
 
-
publish(LogRecord) - Method in class org.iot.dsa.logging.AsyncLogHandler
-
-
Enqueues the record for the write thread.
-
-
put(int, DSElement) - Method in class org.iot.dsa.node.DSList
-
-
Replaces a value and returns this.
-
-
put(int, boolean) - Method in class org.iot.dsa.node.DSList
-
-
Primitive setter, returns this.
-
-
put(int, double) - Method in class org.iot.dsa.node.DSList
-
-
Primitive setter, returns this.
-
-
put(int, int) - Method in class org.iot.dsa.node.DSList
-
-
Primitive setter, returns this.
-
-
put(int, long) - Method in class org.iot.dsa.node.DSList
-
-
Primitive setter, returns this.
-
-
put(int, String) - Method in class org.iot.dsa.node.DSList
-
-
Primitive setter, returns this.
-
-
put(String, DSElement) - Method in class org.iot.dsa.node.DSMap
-
-
Adds or replaces the value for the given key and returns this.
-
-
put(String, boolean) - Method in class org.iot.dsa.node.DSMap
-
-
Primitive setter, returns this.
-
-
put(String, double) - Method in class org.iot.dsa.node.DSMap
-
-
Primitive setter, returns this.
-
-
put(String, int) - Method in class org.iot.dsa.node.DSMap
-
-
Primitive setter, returns this.
-
-
put(String, long) - Method in class org.iot.dsa.node.DSMap
-
-
Primitive setter, returns this.
-
-
put(String, String) - Method in class org.iot.dsa.node.DSMap
-
-
Primitive setter, returns this.
-
-
put(String, Throwable) - Method in class org.iot.dsa.node.DSMap
-
-
Puts a String representing the stack trace into the map.
-
-
put(String, DSIObject) - Method in class org.iot.dsa.node.DSNode
-
-
Adds or replaces the named child.
-
-
put(String, boolean) - Method in class org.iot.dsa.node.DSNode
-
-
A convenience for put(String, DSIObject)
-
-
put(String, double) - Method in class org.iot.dsa.node.DSNode
-
-
A convenience for put(String, DSIObject)
-
-
put(String, float) - Method in class org.iot.dsa.node.DSNode
-
-
A convenience for put(String, DSIObject)
-
-
put(String, int) - Method in class org.iot.dsa.node.DSNode
-
-
A convenience for put(String, DSIObject)
-
-
put(String, long) - Method in class org.iot.dsa.node.DSNode
-
-
A convenience for put(String, DSIObject)
-
-
put(String, String) - Method in class org.iot.dsa.node.DSNode
-
-
A convenience for put(String, DSIObject)
-
-
put(DSInfo, DSIObject) - Method in class org.iot.dsa.node.DSNode
-
-
Replaces the child.
-
-
putAll(DSMap) - Method in class org.iot.dsa.node.DSMap
-
-
Adds / overwrites entries in this map with those from the given.
-
-
putList(String) - Method in class org.iot.dsa.node.DSMap
-
-
Puts a new list for given key and returns it.
-
-
putMap(String) - Method in class org.iot.dsa.node.DSMap
-
-
Puts a new map for given key and returns it.
-
-
putNull(String) - Method in class org.iot.dsa.node.DSMap
-
-
Puts a null value for given key and returns this.
-
-
- - - -

R

-
-
readDouble(byte[], int, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Reads the primitive from a byte array.
-
-
readDouble(InputStream, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Reads the primitive from a stream.
-
-
readFloat(byte[], int, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Reads the primitive from a byte array.
-
-
readFloat(InputStream, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Reads the primitive a stream
-
-
readInt(byte[], int, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Reads the primitive from a byte array.
-
-
readInt(InputStream, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Reads the primitive from a stream.
-
-
readLong(byte[], int, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Reads the primitive from a byte array.
-
-
readLong(InputStream, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Reads the primitive from a stream.
-
-
readShort(byte[], int, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Reads the primitive from a byte array.
-
-
readShort(InputStream, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Reads the primitive from a stream.
-
-
recycle(Calendar) - Static method in class org.iot.dsa.time.DSTime
-
-
Return a calendar instance for reuse.
-
-
registerDecoder(Class, DSIValue) - Static method in class org.iot.dsa.node.DSRegistry
-
-
DSIValues must provide an instance for decoding.
-
-
REMOTE_CONFIG_FAULT - Static variable in class org.iot.dsa.node.DSStatus
-
-
Bad, a configuration error is being reported by the foreign system.
-
-
REMOTE_CONFIG_FAULT_STR - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
REMOTE_DISABLED - Static variable in class org.iot.dsa.node.DSStatus
-
-
Bad, the foreign system is reporting the object is disabled.
-
-
REMOTE_DISABLED_STR - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
REMOTE_DOWN - Static variable in class org.iot.dsa.node.DSStatus
-
-
Bad, down communications are being reported by the foreign system.
-
-
REMOTE_DOWN_STR - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
REMOTE_FAULT - Static variable in class org.iot.dsa.node.DSStatus
-
-
Bad, an operational error is being reported by the foreign system.
-
-
REMOTE_FAULT_STR - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
REMOTE_STALE - Static variable in class org.iot.dsa.node.DSStatus
-
-
Bad, a stale value is being reported by the foreign system.
-
-
REMOTE_STALE_STR - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
REMOTE_UNKNOWN - Static variable in class org.iot.dsa.node.DSStatus
-
-
Bad, the foreign system is reporting the status is unknown.
-
-
REMOTE_UNKNOWN_STR - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
remoteConfigFault - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
remoteDisabled - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
remoteDown - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
remoteFault - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
remoteStale - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
remoteUnknown - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
remove(String, OutboundRequestHandler) - Method in interface org.iot.dsa.dslink.DSIRequester
-
-
Submits request to remove an attribute.
-
-
remove(int) - Method in class org.iot.dsa.node.DSGroup
-
-
Removes the value at the given index and returns it.
-
-
remove(int) - Method in class org.iot.dsa.node.DSList
-
 
-
remove(int) - Method in class org.iot.dsa.node.DSMap
-
 
-
remove(String) - Method in class org.iot.dsa.node.DSMap
-
-
Removes the key-value pair and returns the removed value.
-
-
remove(DSInfo) - Method in class org.iot.dsa.node.DSNode
-
-
Removes the child.
-
-
remove(String) - Method in class org.iot.dsa.node.DSNode
-
-
Remove the named child if it is contained.
-
-
removeFirst() - Method in class org.iot.dsa.node.DSGroup
-
-
Remove and return the item at index 0.
-
-
removeLast() - Method in class org.iot.dsa.node.DSGroup
-
-
Remove and return the item at the highest index.
-
-
removeListener(DSLinkConnection.Listener) - Method in class org.iot.dsa.dslink.DSLinkConnection
-
-
Removes a listener for connection events.
-
-
replace(int, int, DSList...) - Method in interface org.iot.dsa.node.action.ActionInvocation
-
-
Only use with open tables, deletes len rows starting at the given index, then inserts the - given rows in their place.
-
-
reset() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
reset() - Method in class org.iot.dsa.io.AbstractWriter
-
 
-
reset() - Method in interface org.iot.dsa.io.DSIReader
-
-
Sets last() == ROOT.
-
-
reset() - Method in interface org.iot.dsa.io.DSIWriter
-
-
Clears the state of the writer.
-
-
reset() - Method in class org.iot.dsa.io.json.JsonAppender
-
 
-
reset() - Method in class org.iot.dsa.io.json.JsonReader
-
 
-
reset() - Method in class org.iot.dsa.io.json.JsonWriter
-
 
-
reset() - Method in class org.iot.dsa.io.msgpack.MsgpackReader
-
 
-
reset() - Method in class org.iot.dsa.security.DSKeys.Signer
-
-
Call to begin a new signature.
-
-
reset() - Method in class org.iot.dsa.security.DSKeys.Verifier
-
-
Call to begin a new signature.
-
-
restore(DSElement) - Method in class org.iot.dsa.node.DSFlexEnum
-
 
-
restore(DSElement) - Method in interface org.iot.dsa.node.DSIStorable
-
-
Deserialize a value from the configuration database, these will be values returned from the - store() method.
-
-
restore(DSElement) - Method in class org.iot.dsa.node.DSJavaEnum
-
 
-
restore(DSElement) - Method in class org.iot.dsa.node.DSStatus
-
 
-
restore(File) - Static method in class org.iot.dsa.security.DSKeys
-
-
Decodes a key pair that was encoded by the store method.
-
-
restore(InputStream) - Static method in class org.iot.dsa.security.DSKeys
-
-
Decodes a key pair that was encoded by the store method, does not onClose the given stream.
-
-
restore(DSElement) - Method in class org.iot.dsa.security.DSPasswordAes
-
 
-
restore(DSElement) - Method in class org.iot.dsa.security.DSPasswordSha256
-
 
-
run() - Method in class org.iot.dsa.dslink.DSLink
-
-
Calls starts, waits the stableDelay, then calls stable.
-
-
run(Runnable) - Static method in class org.iot.dsa.DSRuntime
-
-
Run as soon as possible on the application's thread pool and run only once.
-
-
run(Runnable, long, long) - Static method in class org.iot.dsa.DSRuntime
-
-
Run periodically starting at the given time and repeat at the given millisecond interval.
-
-
run() - Method in class org.iot.dsa.DSRuntime.Timer
-
-
Do not call.
-
-
runAt(Runnable, long) - Static method in class org.iot.dsa.DSRuntime
-
-
Run once at the given time.
-
-
runCount() - Method in class org.iot.dsa.DSRuntime.Timer
-
-
The number of completed runs.
-
-
runDelayed(Runnable, long) - Static method in class org.iot.dsa.DSRuntime
-
-
Run once after the given delay.
-
-
- - - -

S

-
-
save() - Method in class org.iot.dsa.dslink.DSLink
-
-
Serializes the configuration database.
-
-
send(DSList) - Method in interface org.iot.dsa.node.action.ActionInvocation
-
-
Only use with stream and open tables.
-
-
set(String, DSIValue, OutboundRequestHandler) - Method in interface org.iot.dsa.dslink.DSIRequester
-
-
Submits a set request.
-
-
set(String, DSElement) - Method in class org.iot.dsa.node.DSMetadata
-
-
Set arbitrary keys.
-
-
setAdmin(boolean) - Method in class org.iot.dsa.node.DSInfo
-
 
-
setBackupThreshold(int) - Method in class org.iot.dsa.logging.FileLogHandler
-
-
The file size threshold after which a logging file will be backed up and cleared.
-
-
setBeginList() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
setBeginMap() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
setBit(int, int, boolean) - Static method in class org.iot.dsa.util.DSUtil
-
-
Set or unset a bit at the given index.
-
-
setBooleanRange(DSList) - Method in class org.iot.dsa.node.DSMetadata
-
-
The list must be size 2 and the entries must not be null.
-
-
setBooleanRange(String, String) - Method in class org.iot.dsa.node.DSMetadata
-
-
The parameters can be null, which will result in the default text (false/true).
-
-
setBrokerUri(String) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
 
-
setConfig(String, boolean) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Modifies the in-memory representation of dslink.json, but it will not be saved back to disk.
-
-
setConfig(String, double) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Modifies the in-memory representation of dslink.json, but it will not be saved back to disk.
-
-
setConfig(String, int) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Modifies the in-memory representation of dslink.json, but it will not be saved back to disk.
-
-
setConfig(String, long) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Modifies the in-memory representation of dslink.json, but it will not be saved back to disk.
-
-
setConfig(String, String) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Modifies the in-memory representation of dslink.json, but it will not be saved back to disk.
-
-
setDecimalPlaces(DSLong) - Method in class org.iot.dsa.node.DSMetadata
-
 
-
setDefault(DSIValue) - Method in class org.iot.dsa.node.DSMetadata
-
-
Sets the default value only, does not set type information.
-
-
setDefaultLevel(Level) - Static method in class org.iot.dsa.logging.DSLogging
-
 
-
setDescription(String) - Method in class org.iot.dsa.node.DSMetadata
-
 
-
setDetail(String) - Method in exception org.iot.dsa.dslink.DSRequestException
-
-
Overrides the default detail which is the stack trace of this exception.
-
-
setDetail(Throwable) - Method in exception org.iot.dsa.dslink.DSRequestException
-
-
Overrides the default detail which is the stack trace of this exception.
-
-
setDisplayName(String) - Method in class org.iot.dsa.node.DSMetadata
-
 
-
setDslinkJson(DSMap) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Directly set the map without using file io.
-
-
setDslinkJson(File) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Sets the link map by file path.
-
-
setEditor(String) - Method in class org.iot.dsa.node.DSMetadata
-
-
See the EDITOR_ constants.
-
-
setEndInput() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
setEndList() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
setEndMap() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
setEnumRange(DSList) - Method in class org.iot.dsa.node.DSMetadata
-
-
List of string values for an enum or string.
-
-
setEnumRange(String...) - Method in class org.iot.dsa.node.DSMetadata
-
-
List of string values for an enum or string.
-
-
setHidden(boolean) - Method in class org.iot.dsa.node.DSInfo
-
 
-
setInput(CharSequence) - Method in class org.iot.dsa.io.json.JsonReader
-
-
Sets the input source, resets to ROOT, and returns this.
-
-
setInput(File) - Method in class org.iot.dsa.io.json.JsonReader
-
-
Sets the input source, resets to ROOT, and returns this.
-
-
setInput(InputStream, String) - Method in class org.iot.dsa.io.json.JsonReader
-
-
Sets the input source, resets to ROOT, and returns this.
-
-
setInput(Reader) - Method in class org.iot.dsa.io.json.JsonReader
-
-
Sets the input source, resets to ROOT, and returns this.
-
-
setInput(InputStream) - Method in class org.iot.dsa.io.msgpack.MsgpackReader
-
-
Sets the input source, resets to ROOT, and returns this.
-
-
setKeys(DSKeys) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Directly set the keys without using file io.
-
-
setKeys(File) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Sets the link keys by file path.
-
-
setLinkName(String) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Overrides dslink.json.
-
-
setLogFile(File) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Overrides dslink.json.
-
-
setLogLevel(String) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Should be one of the following (case insensitive): all, finest, finer, fine, config, info, - warning, severe, off.
-
-
setLogLevel(Level) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Overrides dslink.json.
-
-
setMainType(Class) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
The type of the root node.
-
-
setMap(DSMap) - Method in class org.iot.dsa.node.DSMetadata
-
-
Change the underlying map so the metadata instance can be reused.
-
-
setMaxBackups(int) - Method in class org.iot.dsa.logging.FileLogHandler
-
-
The default is 10.
-
-
setMaxQueueSize(int) - Method in class org.iot.dsa.logging.AsyncLogHandler
-
 
-
setMaxValue(DSElement) - Method in class org.iot.dsa.node.DSMetadata
-
-
The arg should be a number.
-
-
setMinValue(DSElement) - Method in class org.iot.dsa.node.DSMetadata
-
-
The arg should be a number.
-
-
setName(String) - Method in class org.iot.dsa.node.DSMetadata
-
 
-
setNextValue(boolean) - Method in class org.iot.dsa.io.AbstractReader
-
 
-
setNextValue(byte[]) - Method in class org.iot.dsa.io.AbstractReader
-
 
-
setNextValue(double) - Method in class org.iot.dsa.io.AbstractReader
-
 
-
setNextValue(long) - Method in class org.iot.dsa.io.AbstractReader
-
 
-
setNextValue(String) - Method in class org.iot.dsa.io.AbstractReader
-
 
-
setNextValueNull() - Method in class org.iot.dsa.io.AbstractReader
-
 
-
setNodes(DSMainNode) - Method in class org.iot.dsa.dslink.DSLink
-
 
-
setNodesFile(File) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Overrides dslink.json.
-
-
setOut(PrintStream) - Method in class org.iot.dsa.logging.AsyncLogHandler
-
-
Sets the sink for formatted messages.
-
-
setOutput(Appendable) - Method in class org.iot.dsa.io.json.JsonAppender
-
-
Sets the sink, resets the state and returns this.
-
-
setOutput(File) - Method in class org.iot.dsa.io.json.JsonAppender
-
-
Sets the sink, resets the state and returns this.
-
-
setOutput(File, String) - Method in class org.iot.dsa.io.json.JsonAppender
-
-
Will create a zip file using the zipFileName as file name inside the zip.
-
-
setOutput(OutputStream) - Method in class org.iot.dsa.io.json.JsonAppender
-
-
Sets the sink, resets the state and returns this.
-
-
setOutput(OutputStream, String) - Method in class org.iot.dsa.io.json.JsonAppender
-
-
Will write a zip file to the given stream.
-
-
setOutput(File) - Method in class org.iot.dsa.io.json.JsonWriter
-
-
Sets the sink, resets the state and returns this.
-
-
setOutput(File, String) - Method in class org.iot.dsa.io.json.JsonWriter
-
-
Will create a zip file using the zipFileName as file name inside the zip.
-
-
setOutput(OutputStream) - Method in class org.iot.dsa.io.json.JsonWriter
-
-
Sets the sink, resets the state and returns this.
-
-
setOutput(OutputStream, String) - Method in class org.iot.dsa.io.json.JsonWriter
-
-
Will write a zip file to the given stream.
-
-
setOutput(Writer) - Method in class org.iot.dsa.io.json.JsonWriter
-
-
Sets the sink, resets the state and returns this.
-
-
setPermission(DSPermission) - Method in class org.iot.dsa.node.action.DSAction
-
-
Returns this, it is not necessary to set the permission to read.
-
-
setPlaceHolder(String) - Method in class org.iot.dsa.node.DSMetadata
-
-
Place holder text for text fields.
-
-
setPrettyPrint(boolean) - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
setReadOnly(boolean) - Method in class org.iot.dsa.node.DSInfo
-
 
-
setRequester(boolean) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Overrides dslink.json.
-
-
setResponder(boolean) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Overrides dslink.json.
-
-
setResultType(ActionSpec.ResultType) - Method in class org.iot.dsa.node.action.DSAction
-
-
Returns this, it is not necessary to set the result to void.
-
-
setSaveEnabled(boolean) - Method in class org.iot.dsa.dslink.DSLink
-
-
This is a transient option intended for unit tests.
-
-
setSkipMissedIntervals(boolean) - Method in class org.iot.dsa.DSRuntime.Timer
-
-
The default is true, set this to false if all intervals should be run, even if they run - later than scheduled.
-
-
setToken(String) - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Overrides dslink.json.
-
-
setTransient(boolean) - Method in class org.iot.dsa.node.DSInfo
-
 
-
setType(DSIValue) - Method in class org.iot.dsa.node.DSMetadata
-
-
Sets the type and if the given is an enum, sets the enum range as well.
-
-
setType(DSValueType) - Method in class org.iot.dsa.node.DSMetadata
-
-
The type for action parameters, can be used to override types in the responder api.
-
-
setUnit(String) - Method in class org.iot.dsa.node.DSMetadata
-
-
The unit identifier.
-
-
severe() - Method in class org.iot.dsa.logging.DSLogger
-
-
True if the level is loggable.
-
-
severe(Object) - Method in class org.iot.dsa.logging.DSLogger
-
 
-
severe(Object, Throwable) - Method in class org.iot.dsa.logging.DSLogger
-
 
-
shouldEncode(int) - Static method in class org.iot.dsa.node.DSPath
-
-
Returns true for characters that should be encoded.
-
-
shutdown() - Method in class org.iot.dsa.dslink.DSLink
-
-
Properly shuts down the link when a thread is executing the run method.
-
-
sign(byte[], int, int) - Method in class org.iot.dsa.security.DSKeys
-
-
A convenience that creates a signer and signs the given bytes.
-
-
Signer(PrivateKey) - Constructor for class org.iot.dsa.security.DSKeys.Signer
-
 
-
SimpleRequestHandler - Class in org.iot.dsa.dslink.requester
-
-
Empty callback implementations.
-
-
SimpleRequestHandler() - Constructor for class org.iot.dsa.dslink.requester.SimpleRequestHandler
-
 
-
size() - Method in class org.iot.dsa.node.DSGroup
-
-
The number of items is the group.
-
-
size() - Method in class org.iot.dsa.node.DSList
-
 
-
size() - Method in class org.iot.dsa.node.DSMap
-
 
-
splitPath(String) - Static method in class org.iot.dsa.node.DSPath
-
-
Splits the path, but does not decode any names.
-
-
stable() - Method in class org.iot.dsa.node.DSNode
-
-
Called after the entire subtree is started.
-
-
STALE - Static variable in class org.iot.dsa.node.DSStatus
-
-
Bad, the value hasn't updated in a reasonable amount of time (user configurable on a per - point basis) within DSA.
-
-
stale - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
STALE_STR - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
start() - Method in class org.iot.dsa.logging.AsyncLogHandler
-
-
This must be called for the handler to actually do anything.
-
-
start() - Method in class org.iot.dsa.node.DSNode
-
-
Sets the state to starting.
-
-
stop() - Method in class org.iot.dsa.node.DSNode
-
-
Sets the state to stopped.
-
-
store() - Method in class org.iot.dsa.node.DSFlexEnum
-
 
-
store() - Method in interface org.iot.dsa.node.DSIStorable
-
-
Serialize the value for the configuration database.
-
-
store() - Method in class org.iot.dsa.node.DSJavaEnum
-
 
-
store() - Method in class org.iot.dsa.node.DSStatus
-
 
-
store(File) - Method in class org.iot.dsa.security.DSKeys
-
-
Write the bytes from the string encoding to the given file.
-
-
store(OutputStream) - Method in class org.iot.dsa.security.DSKeys
-
-
Writes the bytes from the string encoding to the given stream, does not onClose the stream.
-
-
store() - Method in class org.iot.dsa.security.DSPasswordAes
-
 
-
store() - Method in class org.iot.dsa.security.DSPasswordSha256
-
 
-
subscribe(String, int, OutboundSubscribeHandler) - Method in interface org.iot.dsa.dslink.DSIRequester
-
-
Submits a subscribe request.
-
-
subscribe(DSTopic, DSInfo, DSISubscriber) - Method in class org.iot.dsa.node.DSNode
-
-
Subscribes the child and topic.
-
-
SubscriptionCloseHandler - Interface in org.iot.dsa.dslink.responder
-
-
The responder returns this from the subscription request notification method so the link can - notify the responder whenever a subscription is terminated.
-
-
- - - -

T

-
-
throwRuntime(Throwable) - Static method in exception org.iot.dsa.util.DSException
-
-
If the given exception is already a runtime exception, it is rethrown, otherwise - it will be thrown wrapped by an instance of this class.
-
-
timeInMillis() - Method in class org.iot.dsa.time.DSDateTime
-
-
The Java time represented by this object.
-
-
toBoolean() - Method in class org.iot.dsa.node.DSBool
-
 
-
toBoolean() - Method in class org.iot.dsa.node.DSDouble
-
 
-
toBoolean() - Method in class org.iot.dsa.node.DSElement
-
-
Attempts to return a boolean value.
-
-
toBoolean() - Method in interface org.iot.dsa.node.DSIBoolean
-
 
-
toBoolean() - Method in class org.iot.dsa.node.DSLong
-
 
-
toBoolean() - Method in class org.iot.dsa.node.DSString
-
 
-
toBytes() - Method in class org.iot.dsa.node.DSBytes
-
 
-
toBytes() - Method in class org.iot.dsa.node.DSElement
-
-
Returns the raw byte array for DSBytes only, which should not be modified.
-
-
toDouble() - Method in class org.iot.dsa.node.DSBool
-
-
0 or 1.
-
-
toDouble() - Method in class org.iot.dsa.node.DSDouble
-
 
-
toDouble() - Method in class org.iot.dsa.node.DSElement
-
-
Attempts to return a double value.
-
-
toDouble() - Method in class org.iot.dsa.node.DSFloat
-
 
-
toDouble() - Method in class org.iot.dsa.node.DSInt
-
 
-
toDouble() - Method in interface org.iot.dsa.node.DSINumber
-
-
If not a double, will cast the underlying value.
-
-
toDouble() - Method in class org.iot.dsa.node.DSLong
-
 
-
toElement() - Method in class org.iot.dsa.node.DSElement
-
-
Returns this.
-
-
toElement() - Method in class org.iot.dsa.node.DSFlexEnum
-
 
-
toElement() - Method in class org.iot.dsa.node.DSFloat
-
 
-
toElement() - Method in class org.iot.dsa.node.DSInt
-
 
-
toElement() - Method in interface org.iot.dsa.node.DSIValue
-
-
The current value should convert itself to an element for DSA interop such as subscription - updates, and setting requests.
-
-
toElement() - Method in class org.iot.dsa.node.DSJavaEnum
-
 
-
toElement() - Method in class org.iot.dsa.node.DSList
-
 
-
toElement() - Method in class org.iot.dsa.node.DSMap
-
 
-
toElement() - Method in class org.iot.dsa.node.DSNull
-
-
Returns this.
-
-
toElement() - Method in class org.iot.dsa.node.DSStatus
-
 
-
toElement() - Method in class org.iot.dsa.node.DSValueNode
-
 
-
toElement() - Method in class org.iot.dsa.security.DSPasswordAes
-
-
Returns a string representing the url safe base64 encoding of the hash.
-
-
toElement() - Method in class org.iot.dsa.security.DSPasswordSha256
-
-
Returns a string representing the url safe base64 encoding of the hash.
-
-
toElement() - Method in class org.iot.dsa.time.DSDateTime
-
 
-
toEnum() - Method in class org.iot.dsa.node.DSJavaEnum
-
-
The Java enum.
-
-
toFloat() - Method in class org.iot.dsa.node.DSBool
-
-
0 or 1.
-
-
toFloat() - Method in class org.iot.dsa.node.DSDouble
-
 
-
toFloat() - Method in class org.iot.dsa.node.DSElement
-
-
Attempts to return a float value.
-
-
toFloat() - Method in class org.iot.dsa.node.DSFloat
-
 
-
toFloat() - Method in class org.iot.dsa.node.DSInt
-
 
-
toFloat() - Method in interface org.iot.dsa.node.DSINumber
-
-
If not a float, will cast the underlying value.
-
-
toFloat() - Method in class org.iot.dsa.node.DSLong
-
 
-
toGroup() - Method in class org.iot.dsa.node.DSElement
-
-
Lists and maps return themselves, everything else results in an exception.
-
-
toGroup() - Method in class org.iot.dsa.node.DSGroup
-
 
-
toInt() - Method in class org.iot.dsa.node.DSBool
-
-
0 or 1.
-
-
toInt() - Method in class org.iot.dsa.node.DSDouble
-
 
-
toInt() - Method in class org.iot.dsa.node.DSElement
-
-
Attempts to return an int value.
-
-
toInt() - Method in class org.iot.dsa.node.DSFloat
-
 
-
toInt() - Method in class org.iot.dsa.node.DSInt
-
 
-
toInt() - Method in interface org.iot.dsa.node.DSINumber
-
-
If not an int, will cast the underlying value.
-
-
toInt() - Method in class org.iot.dsa.node.DSLong
-
 
-
toList() - Method in class org.iot.dsa.node.DSElement
-
-
Lists return themselves, everything else results in an exception.
-
-
toList() - Method in class org.iot.dsa.node.DSList
-
 
-
toLong() - Method in class org.iot.dsa.node.DSBool
-
-
0 or 1.
-
-
toLong() - Method in class org.iot.dsa.node.DSDouble
-
 
-
toLong() - Method in class org.iot.dsa.node.DSElement
-
-
Attempts to return a long value.
-
-
toLong() - Method in class org.iot.dsa.node.DSFloat
-
 
-
toLong() - Method in class org.iot.dsa.node.DSInt
-
 
-
toLong() - Method in interface org.iot.dsa.node.DSINumber
-
-
If not a long, will cast the underlying value.
-
-
toLong() - Method in class org.iot.dsa.node.DSLong
-
 
-
toMap() - Method in class org.iot.dsa.node.DSElement
-
-
Maps return themselves, everything else results in an exception.
-
-
toMap() - Method in class org.iot.dsa.node.DSMap
-
 
-
toNode(Object) - Static method in class org.iot.dsa.node.DSNode
-
-
A convenience that casts the argument to a node.
-
-
toNumber() - Method in class org.iot.dsa.node.DSDouble
-
 
-
toNumber() - Method in class org.iot.dsa.node.DSFloat
-
 
-
toNumber() - Method in class org.iot.dsa.node.DSInt
-
 
-
toNumber() - Method in interface org.iot.dsa.node.DSINumber
-
-
Returns the Java primitive wrapper.
-
-
toNumber() - Method in class org.iot.dsa.node.DSLong
-
 
-
toStatus() - Method in interface org.iot.dsa.node.DSIStatus
-
 
-
toStatus() - Method in class org.iot.dsa.node.DSStatus
-
 
-
toString() - Method in class org.iot.dsa.DSRuntime.Timer
-
 
-
toString() - Method in enum org.iot.dsa.node.action.ActionSpec.ResultType
-
 
-
toString() - Method in class org.iot.dsa.node.DSBool
-
 
-
toString() - Method in class org.iot.dsa.node.DSBytes
-
 
-
toString() - Method in class org.iot.dsa.node.DSDouble
-
 
-
toString() - Method in enum org.iot.dsa.node.DSElementType
-
 
-
toString() - Method in class org.iot.dsa.node.DSFlexEnum
-
 
-
toString() - Method in class org.iot.dsa.node.DSFloat
-
 
-
toString() - Method in class org.iot.dsa.node.DSGroup
-
-
Json encodes the graph, be careful.
-
-
toString() - Method in interface org.iot.dsa.node.DSIEnum
-
-
The string representation of the the enum value.
-
-
toString() - Method in class org.iot.dsa.node.DSInt
-
 
-
toString() - Method in class org.iot.dsa.node.DSJavaEnum
-
 
-
toString() - Method in class org.iot.dsa.node.DSLong
-
 
-
toString() - Method in class org.iot.dsa.node.DSNull
-
 
-
toString() - Method in class org.iot.dsa.node.DSStatus
-
 
-
toString() - Method in class org.iot.dsa.node.DSString
-
 
-
toString() - Method in class org.iot.dsa.node.DSValue
-
-
If isNull(), returns "null", otherwise returns toElement().toString()
-
-
toString() - Method in enum org.iot.dsa.node.DSValueType
-
 
-
toString() - Method in class org.iot.dsa.security.DSPasswordAes
-
 
-
toString() - Method in class org.iot.dsa.security.DSPasswordSha256
-
 
-
toString() - Method in enum org.iot.dsa.security.DSPermission
-
 
-
toString() - Method in class org.iot.dsa.time.DSDateTime
-
-
ISO 8601 standard format of "yyyy-mm-ddThh:mm:ss.mmm[+/-]hh:mm".
-
-
toString() - Method in exception org.iot.dsa.util.DSException
-
 
-
trimBackups() - Method in class org.iot.dsa.logging.FileLogHandler
-
-
Only public for testing, do not call.
-
-
TRUE - Static variable in class org.iot.dsa.node.DSBool
-
 
-
TYPE - Static variable in class org.iot.dsa.node.DSMetadata
-
 
-
- - - -

U

-
-
UNIT - Static variable in class org.iot.dsa.node.DSMetadata
-
 
-
UNKNOWN - Static variable in class org.iot.dsa.node.DSStatus
-
-
Bad, the status is unknown within DSA, typically the initial state at boot.
-
-
unknown - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
UNKNOWN_STR - Static variable in class org.iot.dsa.node.DSStatus
-
 
-
unsubscribe(DSTopic, DSInfo, DSISubscriber) - Method in class org.iot.dsa.node.DSNode
-
-
Unsubscribes the tuple.
-
-
update(long, DSIValue, DSStatus) - Method in interface org.iot.dsa.dslink.responder.InboundSubscribeRequest
-
-
The responder should call this when first received and then whenever the value or status - changes.
-
-
update(byte[]) - Method in class org.iot.dsa.security.DSKeys.Signer
-
-
Update the signature with the given bytes.
-
-
update(byte[], int, int) - Method in class org.iot.dsa.security.DSKeys.Signer
-
-
Update the signature with the given bytes.
-
-
update(byte[]) - Method in class org.iot.dsa.security.DSKeys.Verifier
-
-
Update the signature with the given bytes.
-
-
update(byte[], int, int) - Method in class org.iot.dsa.security.DSKeys.Verifier
-
-
Update the signature with the given bytes.
-
-
UTF8 - Static variable in class org.iot.dsa.node.DSString
-
-
The standard UTF8 charset, can be used with string.getBytes(Charset).
-
-
- - - -

V

-
-
valBoolean - Variable in class org.iot.dsa.io.AbstractReader
-
 
-
valBytes - Variable in class org.iot.dsa.io.AbstractReader
-
 
-
validate(byte[]) - Method in class org.iot.dsa.security.DSKeys.Verifier
-
-
Returns true if the given signature is valid for the bytes passed to update.
-
-
validate(String) - Method in class org.iot.dsa.security.DSKeys.Verifier
-
-
Returns true if the given base 64 encoded signature is valid for the bytes passed to - update.
-
-
validateChild(DSIObject) - Method in class org.iot.dsa.node.DSNode
-
-
Override point, throw a meaningful IllegalArgumentException if the child is not allowed
-
-
validateParent(DSNode) - Method in class org.iot.dsa.dslink.DSMainNode
-
-
The parent must be a DSLink instance.
-
-
validateParent(DSNode) - Method in class org.iot.dsa.node.DSNode
-
-
Override point, throw a meaningful IllegalArgumentException if the parent is not allowed
-
-
valLong - Variable in class org.iot.dsa.io.AbstractReader
-
 
-
valReal - Variable in class org.iot.dsa.io.AbstractReader
-
 
-
valString - Variable in class org.iot.dsa.io.AbstractReader
-
 
-
value(DSElement) - Method in class org.iot.dsa.io.AbstractWriter
-
 
-
value(boolean) - Method in class org.iot.dsa.io.AbstractWriter
-
 
-
value(byte[]) - Method in class org.iot.dsa.io.AbstractWriter
-
 
-
value(double) - Method in class org.iot.dsa.io.AbstractWriter
-
 
-
value(int) - Method in class org.iot.dsa.io.AbstractWriter
-
 
-
value(long) - Method in class org.iot.dsa.io.AbstractWriter
-
 
-
value(String) - Method in class org.iot.dsa.io.AbstractWriter
-
 
-
value(DSElement) - Method in interface org.iot.dsa.io.DSIWriter
-
-
Write a value to the map or list.
-
-
value(boolean) - Method in interface org.iot.dsa.io.DSIWriter
-
-
Write a value to the map or list.
-
-
value(byte[]) - Method in interface org.iot.dsa.io.DSIWriter
-
-
Write a value to the map or list.
-
-
value(double) - Method in interface org.iot.dsa.io.DSIWriter
-
-
Write a value to the map or list.
-
-
value(int) - Method in interface org.iot.dsa.io.DSIWriter
-
-
Write a value to the map or list.
-
-
value(long) - Method in interface org.iot.dsa.io.DSIWriter
-
-
Write a value to the map or list.
-
-
value(String) - Method in interface org.iot.dsa.io.DSIWriter
-
-
Write a value to the map or list.
-
-
value(DSElement) - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
VALUE_TOPIC - Static variable in class org.iot.dsa.node.DSNode
-
 
-
valueOf(String) - Static method in enum org.iot.dsa.dslink.requester.OutboundInvokeHandler.Mode
-
-
Returns the enum constant of this type with the specified name.
-
-
valueOf(String) - Static method in enum org.iot.dsa.io.DSIReader.Token
-
-
Returns the enum constant of this type with the specified name.
-
-
valueOf(String) - Static method in enum org.iot.dsa.node.action.ActionSpec.ResultType
-
-
Returns the enum constant of this type with the specified name.
-
-
valueOf(boolean) - Static method in class org.iot.dsa.node.DSBool
-
-
Will return either TRUE or FALSE.
-
-
valueOf(DSElement) - Method in class org.iot.dsa.node.DSBool
-
 
-
valueOf(String) - Static method in class org.iot.dsa.node.DSBool
-
-
Will return NULL, TRUE or FALSE.
-
-
valueOf(byte[]) - Static method in class org.iot.dsa.node.DSBytes
-
 
-
valueOf(DSElement) - Method in class org.iot.dsa.node.DSBytes
-
 
-
valueOf(String) - Static method in class org.iot.dsa.node.DSBytes
-
-
Decodes a base64 encoded byte array.
-
-
valueOf(double) - Static method in class org.iot.dsa.node.DSDouble
-
-
Attempts to reuse some common values before creating a new instance.
-
-
valueOf(DSElement) - Method in class org.iot.dsa.node.DSDouble
-
 
-
valueOf(String) - Static method in class org.iot.dsa.node.DSDouble
-
-
Checks for null, then uses Double.parseDouble()
-
-
valueOf(DSElement) - Method in class org.iot.dsa.node.DSElement
-
-
Returns the argument.
-
-
valueOf(String) - Static method in enum org.iot.dsa.node.DSElementType
-
-
Returns the enum constant of this type with the specified name.
-
-
valueOf(DSElement) - Method in class org.iot.dsa.node.DSFlexEnum
-
 
-
valueOf(String, DSList) - Static method in class org.iot.dsa.node.DSFlexEnum
-
-
Creates a enum representing the given value and range.
-
-
valueOf(String) - Method in class org.iot.dsa.node.DSFlexEnum
-
-
Creates a new enum for the given value using the range from this instance.
-
-
valueOf(DSElement) - Method in class org.iot.dsa.node.DSFloat
-
 
-
valueOf(float) - Static method in class org.iot.dsa.node.DSFloat
-
-
Attempts to reuse some common values before creating a new instance.
-
-
valueOf(String) - Static method in class org.iot.dsa.node.DSFloat
-
-
Checks for null, then uses Float.parseFloat()
-
-
valueOf(DSElement) - Method in class org.iot.dsa.node.DSInt
-
 
-
valueOf(int) - Static method in class org.iot.dsa.node.DSInt
-
-
Attempts to reuse some common values before creating a new instance.
-
-
valueOf(String) - Static method in class org.iot.dsa.node.DSInt
-
-
Checks for null, then uses Float.parseFloat()
-
-
valueOf(DSElement) - Method in interface org.iot.dsa.node.DSIValue
-
-
This should convert an element transmitted over DSA, such as subscription updates or set - requests.
-
-
valueOf(DSElement) - Method in class org.iot.dsa.node.DSJavaEnum
-
 
-
valueOf(Enum) - Static method in class org.iot.dsa.node.DSJavaEnum
-
-
Creates an enum for the given value (and it's range).
-
-
valueOf(String) - Method in class org.iot.dsa.node.DSJavaEnum
-
 
-
valueOf(DSElement) - Method in class org.iot.dsa.node.DSList
-
 
-
valueOf(DSElement...) - Static method in class org.iot.dsa.node.DSList
-
 
-
valueOf(Double...) - Static method in class org.iot.dsa.node.DSList
-
 
-
valueOf(Long...) - Static method in class org.iot.dsa.node.DSList
-
 
-
valueOf(String...) - Static method in class org.iot.dsa.node.DSList
-
 
-
valueOf(DSElement) - Method in class org.iot.dsa.node.DSLong
-
-
Returns this.
-
-
valueOf(long) - Static method in class org.iot.dsa.node.DSLong
-
-
Attempts to reuse some common values before creating a new instance.
-
-
valueOf(String) - Static method in class org.iot.dsa.node.DSLong
-
-
Checks for null, then uses Float.parseFloat()
-
-
valueOf(DSElement) - Method in class org.iot.dsa.node.DSMap
-
 
-
valueOf(DSElement) - Method in class org.iot.dsa.node.DSNull
-
-
Returns this.
-
-
valueOf(DSElement) - Method in class org.iot.dsa.node.DSStatus
-
 
-
valueOf(String) - Static method in class org.iot.dsa.node.DSStatus
-
 
-
valueOf(DSElement) - Method in class org.iot.dsa.node.DSString
-
 
-
valueOf(Object) - Static method in class org.iot.dsa.node.DSString
-
 
-
valueOf(DSElement) - Method in class org.iot.dsa.node.DSValueNode
-
 
-
valueOf(String) - Static method in enum org.iot.dsa.node.DSValueType
-
-
Returns the enum constant of this type with the specified name.
-
-
valueOf(String) - Static method in enum org.iot.dsa.node.event.DSInfoTopic.Event
-
-
Returns the enum constant of this type with the specified name.
-
-
valueOf(String) - Static method in enum org.iot.dsa.node.event.DSValueTopic.Event
-
-
Returns the enum constant of this type with the specified name.
-
-
valueOf(DSElement) - Method in class org.iot.dsa.security.DSPasswordAes
-
-
Creates a encrypted password for the given clear text.
-
-
valueOf(String) - Static method in class org.iot.dsa.security.DSPasswordAes
-
-
Creates a encrypted password for the given clear text.
-
-
valueOf(DSElement) - Method in class org.iot.dsa.security.DSPasswordSha256
-
-
Creates a digest password for the given clear text.
-
-
valueOf(String) - Static method in class org.iot.dsa.security.DSPasswordSha256
-
-
Creates a digest password for the given clear text.
-
-
valueOf(String) - Static method in enum org.iot.dsa.security.DSPermission
-
-
Returns the enum constant of this type with the specified name.
-
-
valueOf(DSElement) - Method in class org.iot.dsa.time.DSDateTime
-
 
-
valueOf(long) - Static method in class org.iot.dsa.time.DSDateTime
-
 
-
valueOf(String) - Static method in class org.iot.dsa.time.DSDateTime
-
-
Decodes an ISO 8601 standard format of "yyyy-mm-ddThh:mm:ss.mmm[+/-]hh:mm".
-
-
valueOf(String) - Static method in enum org.iot.dsa.time.DSInterval
-
-
Returns the enum constant of this type with the specified name.
-
-
values() - Static method in enum org.iot.dsa.dslink.requester.OutboundInvokeHandler.Mode
-
-
Returns an array containing the constants of this enum type, in -the order they are declared.
-
-
values() - Static method in enum org.iot.dsa.io.DSIReader.Token
-
-
Returns an array containing the constants of this enum type, in -the order they are declared.
-
-
values() - Static method in enum org.iot.dsa.node.action.ActionSpec.ResultType
-
-
Returns an array containing the constants of this enum type, in -the order they are declared.
-
-
values() - Static method in enum org.iot.dsa.node.DSElementType
-
-
Returns an array containing the constants of this enum type, in -the order they are declared.
-
-
values() - Static method in enum org.iot.dsa.node.DSValueType
-
-
Returns an array containing the constants of this enum type, in -the order they are declared.
-
-
values() - Static method in enum org.iot.dsa.node.event.DSInfoTopic.Event
-
-
Returns an array containing the constants of this enum type, in -the order they are declared.
-
-
values() - Static method in enum org.iot.dsa.node.event.DSValueTopic.Event
-
-
Returns an array containing the constants of this enum type, in -the order they are declared.
-
-
values() - Static method in enum org.iot.dsa.security.DSPermission
-
-
Returns an array containing the constants of this enum type, in -the order they are declared.
-
-
values() - Static method in enum org.iot.dsa.time.DSInterval
-
-
Returns an array containing the constants of this enum type, in -the order they are declared.
-
-
Verifier(PublicKey) - Constructor for class org.iot.dsa.security.DSKeys.Verifier
-
 
-
verify(byte[], int, int, String) - Method in class org.iot.dsa.security.DSKeys
-
-
A convenience that creates a verifier and validates the signature for the given bytes.
-
-
- - - -

W

-
-
warn() - Method in class org.iot.dsa.logging.DSLogger
-
-
True if the level is loggable.
-
-
warn(Object) - Method in class org.iot.dsa.logging.DSLogger
-
-
Log an unusual but not critical event.
-
-
warn(Object, Throwable) - Method in class org.iot.dsa.logging.DSLogger
-
-
Log an unusual but not critical event.
-
-
wasHelpRequested() - Method in class org.iot.dsa.dslink.DSLinkConfig
-
-
Whether or not -h or --help was provided.
-
-
write(boolean) - Method in class org.iot.dsa.io.AbstractWriter
-
-
Write the value.
-
-
write(byte[]) - Method in class org.iot.dsa.io.AbstractWriter
-
-
Write the value.
-
-
write(double) - Method in class org.iot.dsa.io.AbstractWriter
-
-
Write the value.
-
-
write(long) - Method in class org.iot.dsa.io.AbstractWriter
-
-
Write the value.
-
-
write(boolean) - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
write(byte[]) - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
write(double) - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
write(long) - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
write(boolean) - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
 
-
write(byte[]) - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
 
-
write(double) - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
 
-
write(long) - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
 
-
write(LogRecord) - Method in class org.iot.dsa.logging.AsyncLogHandler
-
-
Formats and writes the logging record the underlying stream.
-
-
writeDouble(double, byte[], int, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Encodes the primitive into a byte array.
-
-
writeDouble(double, OutputStream, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Encodes the primitive into a stream.
-
-
writeFloat(float, byte[], int, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Encodes the primitive into a byte array.
-
-
writeFloat(float, OutputStream, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Encodes the primitive into a stream
-
-
writeInt(int, byte[], int, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Encodes the primitive into a byte array.
-
-
writeInt(int, OutputStream, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Encodes the primitive into a stream.
-
-
writeKey(CharSequence) - Method in class org.iot.dsa.io.AbstractWriter
-
-
Write string key of a map entry.
-
-
writeKey(CharSequence) - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
writeKey(CharSequence) - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
 
-
writeKeyValueSeparator() - Method in class org.iot.dsa.io.AbstractWriter
-
-
Separate the key from the value in a map.
-
-
writeKeyValueSeparator() - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
writeKeyValueSeparator() - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
 
-
writeListEnd() - Method in class org.iot.dsa.io.AbstractWriter
-
-
End the current list.
-
-
writeListEnd() - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
writeListEnd() - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
 
-
writeListStart(int) - Method in class org.iot.dsa.io.AbstractWriter
-
-
Start a new list.
-
-
writeListStart(int) - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
writeListStart(int) - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
-
A negative size implies dynamic and will be written when the list is closed.
-
-
writeLong(long, byte[], int, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Encodes the primitive into a byte array.
-
-
writeLong(long, OutputStream, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Encodes the primitive into a stream.
-
-
writeMapEnd() - Method in class org.iot.dsa.io.AbstractWriter
-
-
End the current map.
-
-
writeMapEnd() - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
writeMapEnd() - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
 
-
writeMapStart(int) - Method in class org.iot.dsa.io.AbstractWriter
-
-
Start a new map.
-
-
writeMapStart(int) - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
writeMapStart(int) - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
-
A negative size implies dynamic and will be written when the map is closed.
-
-
writeNewLineIndent() - Method in class org.iot.dsa.io.AbstractWriter
-
-
Override point for subclasses which perform use pretty printing, such as json.
-
-
writeNewLineIndent() - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
-
Two spaces per level.
-
-
writeNewLineIndent() - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
 
-
writeNull() - Method in class org.iot.dsa.io.AbstractWriter
-
-
Write a null value.
-
-
writeNull() - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
writeNull() - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
 
-
writeSeparator() - Method in class org.iot.dsa.io.AbstractWriter
-
-
Write a value separator, such as the comma in json.
-
-
writeSeparator() - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
writeSeparator() - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
 
-
writeShort(short, byte[], int, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Encodes the primitive into a byte array.
-
-
writeShort(short, OutputStream, boolean) - Static method in class org.iot.dsa.node.DSBytes
-
-
Encodes the primitive into a stream.
-
-
writeTo(ByteBuffer) - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
-
Writes the internal buffer to the parameter.
-
-
writeTo(OutputStream) - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
-
Writes the internal buffer to the parameter.
-
-
writeValue(CharSequence) - Method in class org.iot.dsa.io.AbstractWriter
-
-
Write the value, which will never be null.
-
-
writeValue(CharSequence) - Method in class org.iot.dsa.io.json.AbstractJsonWriter
-
 
-
writeValue(CharSequence) - Method in class org.iot.dsa.io.msgpack.MsgpackWriter
-
 
-
-A B C D E F G H I J K L M N O P R S T U V W 
+

A

+
+
AbstractInvokeHandler + - Class in org.iot.dsa.dslink.requester +
+
+
Convenience implementation of the callback passed to the invoke method in + the requester. +
+
+
AbstractInvokeHandler() + - Constructor for class org.iot.dsa.dslink.requester.AbstractInvokeHandler
+
 
+
AbstractJsonWriter + - Class in org.iot.dsa.io.json
+
 
+
AbstractJsonWriter() + - Constructor for class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
AbstractListHandler + - Class in org.iot.dsa.dslink.requester +
+
+
Convenience implementation of the handler passed to the invoke method in + the requester. +
+
+
AbstractListHandler() + - Constructor for class org.iot.dsa.dslink.requester.AbstractListHandler
+
 
+
AbstractReader - Class in org.iot.dsa.io
+
+
Basic implementation of DSReader.
+
+
AbstractReader() + - Constructor for class org.iot.dsa.io.AbstractReader +
+
 
+
AbstractSubscribeHandler + - Class in org.iot.dsa.dslink.requester +
+
+
Convenience implementation of the handler passed to the subscribe method in + the requester. +
+
+
AbstractSubscribeHandler() + - Constructor for class org.iot.dsa.dslink.requester.AbstractSubscribeHandler
+
 
+
AbstractWriter - Class in org.iot.dsa.io
+
+
Basic implementation of DSWriter.
+
+
AbstractWriter() + - Constructor for class org.iot.dsa.io.AbstractWriter +
+
 
+
ActionInvocation - Interface in org.iot.dsa.node.action
+
+
Encapsulates the details of an action invocation and provides the mechanism + for updating and open + stream. +
+
+
ActionResult - Interface in org.iot.dsa.node.action
+
+
Super interface for possible results of an action.
+
+
ActionSpec + - Interface in org.iot.dsa.node.action
+
+
Defines an invokable node in the DSA model.
+
+
ActionSpec.ResultType - Enum in org.iot.dsa.node.action
+
+
Defines what the action returns.
+
+
ActionTable - Interface in org.iot.dsa.node.action
+
+
Provides access to the columns and rows of a table.
+
+
ActionValues - Interface in org.iot.dsa.node.action
+
+
Simple set of return values from an action.
+
+
add(DSElement) + - Method in class org.iot.dsa.node.DSList
+
+
Adds the value and returns this.
+
+
add(boolean) + - Method in class org.iot.dsa.node.DSList
+
+
Appends the primitive and returns this.
+
+
add(double) - Method in class + org.iot.dsa.node.DSList +
+
+
Appends the primitive and returns this.
+
+
add(long) + - Method in class org.iot.dsa.node.DSList
+
+
Appends the primitive and returns this.
+
+
add(String) + - Method in class org.iot.dsa.node.DSList
+
+
Appends the primitive and returns this.
+
+
add(int) - Method in class + org.iot.dsa.node.DSList +
+
+
Appends the primitive and returns this.
+
+
add(String, DSIObject) + - Method in class org.iot.dsa.node.DSNode
+
+
Adds the named child only if the name is not already in use.
+
+
addAll(DSList) + - Method in class org.iot.dsa.node.DSList
+
+
Add all elements of the argument to this list and returns this.
+
+
addDays(int, Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Adds or subtracts the corresponding time field, does not perform any + alignment. +
+
+
addDays(int, long) + - Static method in class org.iot.dsa.time.DSTime
+
+
Adds or subtracts the corresponding time field, does not perform any + alignment. +
+
+
addDefaultParameter(String, DSIValue, String) + - Method in class org.iot.dsa.node.action.DSAction +
+
+
A convenience which calls addParameter with the same arguments, and also + sets the metadata + for default value. +
+
+
addHours(int, Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Adds or subtracts the corresponding time field, does not perform any + alignment. +
+
+
addHours(int, long) + - Static method in class org.iot.dsa.time.DSTime
+
+
Adds or subtracts the corresponding time field, does not perform any + alignment. +
+
+
addList() + - Method in class org.iot.dsa.node.DSList
+
+
Appends a new list and returns it.
+
+
addListener(DSLinkConnection.Listener) + - Method in class org.iot.dsa.dslink.DSLinkConnection +
+
+
Adds a listener for connection events.
+
+
addMap() - Method in class + org.iot.dsa.node.DSList +
+
+
Appends a new map and returns it.
+
+
addMinutes(int, Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Adds or subtracts the corresponding time field, does not perform any + alignment. +
+
+
addMinutes(int, long) + - Static method in class org.iot.dsa.time.DSTime
+
+
Adds or subtracts the corresponding time field, does not perform any + alignment. +
+
+
addMonths(int, Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Adds or subtracts the corresponding time field, does not perform any + alignment. +
+
+
addMonths(int, long) + - Static method in class org.iot.dsa.time.DSTime
+
+
Adds or subtracts the corresponding time field, does not perform any + alignment. +
+
+
addNull() + - Method in class org.iot.dsa.node.DSList
+
+
Appends null and returns this.
+
+
addParameter(DSMap) + - Method in class org.iot.dsa.node.action.DSAction +
+
+
Fully describes a parameter for method invocation.
+
+
addParameter(String, DSIValue, String) + - Method in class org.iot.dsa.node.action.DSAction +
+
+
Creates a DSMetadata, calls setName and setType on it, adds the internal + map to the parameter + list and returns the metadata instance for further configuration. +
+
+
addParameter(String, DSValueType, String) + - Method in class org.iot.dsa.node.action.DSAction +
+
+
Creates a DSMetadata, calls setName and setType on it, adds the internal + map to the parameter + list and returns the metadata instance for further configuration. +
+
+
addSeconds(int, Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Adds or subtracts the corresponding time field, does not perform any + alignment. +
+
+
addSeconds(int, long) + - Static method in class org.iot.dsa.time.DSTime
+
+
Adds or subtracts the corresponding time field, does not perform any + alignment. +
+
+
addValueResult(DSMap) + - Method in class org.iot.dsa.node.action.DSAction +
+
+
Fully describes a return value when the result type is VALUES.
+
+
addValueResult(String, DSIValue) + - Method in class org.iot.dsa.node.action.DSAction +
+
+
Creates a DSMetadata, calls setName and setType on it, adds the internal + map to the results + list and returns the metadata instance for further configuration. +
+
+
addValueResult(String, DSValueType) + - Method in class org.iot.dsa.node.action.DSAction +
+
+
Creates a DSMetadata, calls setName and setType on it, adds the internal + map to the results + list and returns the metadata instance for further configuration. +
+
+
addWeeks(int, Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Adds or subtracts the corresponding time field, does not perform any + alignment. +
+
+
addWeeks(int, long) + - Static method in class org.iot.dsa.time.DSTime
+
+
Adds or subtracts the corresponding time field, does not perform any + alignment. +
+
+
addYears(int, Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Adds or subtracts the corresponding time field, does not perform any + alignment. +
+
+
addYears(int, long) + - Static method in class org.iot.dsa.time.DSTime
+
+
Adds or subtracts the corresponding time field, does not perform any + alignment. +
+
+
alignDay(Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Aligns the time fields to the start of the day.
+
+
alignDays(int, Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Aligns the time fields to the start of given interval.
+
+
alignHour(Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Aligns the time fields to the start of the hour.
+
+
alignHours(int, Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Aligns the time fields to the start of given interval.
+
+
alignMinute(Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Aligns the time fields to the start of the minute.
+
+
alignMinutes(int, Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Aligns the time fields to the start of given interval.
+
+
alignMonth(Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Aligns the time fields to the start of the month.
+
+
alignSecond(Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Aligns the time fields to the start of the second.
+
+
alignSeconds(int, Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Aligns the time fields to the start of given interval.
+
+
alignWeek(Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Aligns the time fields to the start of the week.
+
+
alignYear(Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Aligns the time fields to the start of the year.
+
+
ApiObject - Interface in org.iot.dsa.dslink.responder +
+
+
Can be a node, value or an action.
+
+
append(char[], int, int) + - Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
+
Append the characters and return this.
+
+
append(char) + - Method in class org.iot.dsa.io.json.JsonAppender +
+
+
Append the char and return this.
+
+
append(char[], int, int) + - Method in class org.iot.dsa.io.json.JsonAppender +
+
+
Append the chars and return this.
+
+
append(CharSequence) + - Method in class org.iot.dsa.io.json.JsonAppender +
+
+
Append the chars and return this.
+
+
append(CharSequence, int, int) + - Method in class org.iot.dsa.io.json.JsonAppender +
+
+
Append the chars and return this.
+
+
append(CharSequence) + - Method in class org.iot.dsa.io.json.JsonWriter +
+
 
+
append(char) + - Method in class org.iot.dsa.io.json.JsonWriter +
+
 
+
append(CharSequence, int, int) + - Method in class org.iot.dsa.io.json.JsonWriter +
+
+
Append the chars and return this.
+
+
append(char[], int, int) + - Method in class org.iot.dsa.io.json.JsonWriter +
+
+
Append the chars and return this.
+
+
AsyncLogHandler - Class in org.iot.dsa.logging
+
+
Enqueues logging records which are then processed by separate thread.
+
+
AsyncLogHandler() + - Constructor for class org.iot.dsa.logging.AsyncLogHandler +
+
 
+
+ + + +

B

+
+
beginList() + - Method in class org.iot.dsa.io.AbstractWriter
+
 
+
beginList(int) + - Method in class org.iot.dsa.io.AbstractWriter
+
 
+
beginList() - Method in + interface org.iot.dsa.io.DSIWriter
+
+
Start a new list and return this.
+
+
beginList(int) + - Method in interface org.iot.dsa.io.DSIWriter
+
+
Start a new list of the given size and return this.
+
+
beginMap() + - Method in class org.iot.dsa.io.AbstractWriter
+
 
+
beginMap(int) + - Method in class org.iot.dsa.io.AbstractWriter
+
 
+
beginMap() - Method in interface + org.iot.dsa.io.DSIWriter +
+
+
Start a new map and return this.
+
+
beginMap(int) + - Method in interface org.iot.dsa.io.DSIWriter
+
+
Start a new map of the given size and return this.
+
+
BOOLEAN_RANGE + - Static variable in class org.iot.dsa.node.DSMetadata +
+
 
+
byteBuffer + - Variable in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
 
+
+ + + +

C

+
+
cancel() - Method in class + org.iot.dsa.DSRuntime.Timer +
+
+
Cancel execution, will not impact current running tasks and will have no + effect if + already cancelled. +
+
+
CFG_AUTH_TOKEN + - Static variable in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
CFG_BROKER_URL + - Static variable in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
CFG_CONNECTION_TYPE + - Static variable in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
CFG_IS_REQUESTER - + Static variable in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
CFG_IS_RESPONDER - + Static variable in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
CFG_KEY_FILE + - Static variable in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
CFG_LOG_FILE + - Static variable in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
CFG_LOG_LEVEL + - Static variable in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
CFG_MAIN_TYPE + - Static variable in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
CFG_NODE_FILE + - Static variable in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
CFG_PROTOCOL_VERSION + - Static variable in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
CFG_READ_TIMEOUT - + Static variable in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
CFG_SAVE_INTERVAL - + Static variable in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
CFG_STABLE_DELAY - + Static variable in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
CFG_WS_TRANSPORT_FACTORY + - Static variable in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
childAdded(ApiObject) + - Method in interface org.iot.dsa.dslink.responder.InboundListRequest
+
+
The responder should call this whenever a child is added.
+
+
childCount() + - Method in class org.iot.dsa.node.DSNode
+
+
The number of children.
+
+
childRemoved(ApiObject) + - Method in interface org.iot.dsa.dslink.responder.InboundListRequest
+
+
The responder should call this whenever a child is removed.
+
+
clear() - Method in class + org.iot.dsa.node.DSGroup +
+
+
Removes all items.
+
+
clear() - Method in class + org.iot.dsa.node.DSList +
+
 
+
clear() - Method in class + org.iot.dsa.node.DSMap
+
 
+
clear() + - Method in class org.iot.dsa.node.DSMetadata
+
 
+
clear(String) - + Method in class org.iot.dsa.node.DSMetadata
+
 
+
clear() - Method in class + org.iot.dsa.node.DSNode +
+
+
Removes non-permanent children.
+
+
clearAllRows() + - Method in interface org.iot.dsa.node.action.ActionInvocation
+
+
Only use with stream and open tables, instructs the requester to clear all + existing rows. +
+
+
close() - + Method in interface org.iot.dsa.dslink.responder.InboundListRequest
+
+
Allows the responder to forcefully close the list stream.
+
+
close(Exception) + - Method in interface org.iot.dsa.dslink.responder.InboundListRequest
+
+
Allows the responder to forcefully close the list stream.
+
+
close() + - Method in interface org.iot.dsa.dslink.responder.InboundSubscribeRequest
+
+
Allows the responder to forcefully terminate the subscription.
+
+
close() - Method in interface + org.iot.dsa.io.DSIReader +
+
+
Close the input.
+
+
close() - Method in interface + org.iot.dsa.io.DSIWriter +
+
+
Close the stream.
+
+
close() - Method in class + org.iot.dsa.io.json.JsonAppender
+
 
+
close() - Method in class + org.iot.dsa.io.json.JsonReader
+
 
+
close() - Method in class + org.iot.dsa.io.json.JsonWriter
+
 
+
close() + - Method in class org.iot.dsa.io.msgpack.MsgpackReader +
+
 
+
close() + - Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
+
Does nothing.
+
+
close() + - Method in class org.iot.dsa.logging.AsyncLogHandler +
+
+
Closes the PrintStream, terminates the write thread and performs + houseKeeping. +
+
+
close() - Static method in + class org.iot.dsa.logging.DSLogging
+
+
Closes all async log handlers.
+
+
close() - Method in + interface org.iot.dsa.node.action.ActionInvocation +
+
+
For use with streams and open tables, will have no effect if the stream is + already closed. +
+
+
close(Exception) + - Method in interface org.iot.dsa.node.action.ActionInvocation
+
+
Close and send and error.
+
+
closeStream() + - Method in interface org.iot.dsa.dslink.requester.OutboundStream
+
+
Allows the requester to close the stream.
+
+
config() - Method in class + org.iot.dsa.logging.DSLogger
+
+
True if the level is loggable.
+
+
config(Object) + - Method in class org.iot.dsa.logging.DSLogger +
+
 
+
CONFIG_FAULT + - Static variable in class org.iot.dsa.node.DSStatus +
+
+
Bad, a configuration error has been indentified within DSA.
+
+
CONFIG_FAULT_STR + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
configFault + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
contains(DSElement) + - Method in class org.iot.dsa.node.DSList
+
 
+
contains(String) - + Method in class org.iot.dsa.node.DSMap
+
 
+
contains(String) - + Method in class org.iot.dsa.node.DSNode
+
+
Whether or not this node has a child with the given name.
+
+
copy() - Method in class + org.iot.dsa.node.action.DSAction
+
 
+
copy() - Method in class + org.iot.dsa.node.DSElement +
+
+
If an object is mutable (list or map) then this should clone it, immutable + objects can simply + return themselves. +
+
+
copy() - Method in class + org.iot.dsa.node.DSFlexEnum +
+
 
+
copy() + - Method in class org.iot.dsa.node.DSInfo
+
 
+
copy() - Method in interface + org.iot.dsa.node.DSIObject
+
+
Return a copy if it makes sense, but return this otherwise.
+
+
copy() + - Method in class org.iot.dsa.node.DSList
+
 
+
copy() + - Method in class org.iot.dsa.node.DSMap
+
 
+
copy() + - Method in class org.iot.dsa.node.DSNode
+
+
Returns a clone of this node and its subtree.
+
+
copy() + - Method in class org.iot.dsa.node.DSNull
+
+
Returns this.
+
+
copy() - Method in class + org.iot.dsa.node.DSValue +
+
+
Returns this.
+
+
copy() + - Method in class org.iot.dsa.node.event.DSTopic +
+
+
Returns this.
+
+
count(long, long) + - Method in enum org.iot.dsa.time.DSInterval
+
+
Returns the number of intervals for the given time range, or -1 if + indeterminate. +
+
+
currentTime() + - Static method in class org.iot.dsa.time.DSDateTime +
+
+
The current time.
+
+
+ + + +

D

+
+
DBL_NAN + - Static variable in interface org.iot.dsa.io.json.JsonConstants +
+
+
How Double.NaN is encoded: "\\u001BNaN"
+
+
DBL_NEG_INF + - Static variable in interface org.iot.dsa.io.json.JsonConstants +
+
+
How Double.NEGATIVE_INFINITY is encoded: "\\u001B-Infinity"
+
+
DBL_POS_INF + - Static variable in interface org.iot.dsa.io.json.JsonConstants +
+
+
How Double.POSITIVE_INFINITY is encoded: "\\u001BInfinity"
+
+
DECIMAL_PLACES + - Static variable in class org.iot.dsa.node.DSMetadata +
+
 
+
declareDefault(String, DSIObject) + - Method in class org.iot.dsa.node.DSNode
+
+
Use this in the declareDefaults method to create a non-removable child. +
+
+
declareDefaults() + - Method in class org.iot.dsa.dslink.DSLink
+
+
Adds the save action, overrides should call super if they want this + action. +
+
+
declareDefaults() + - Method in class org.iot.dsa.node.DSNode
+
+
The is only called once for each class.
+
+
decode(String) - + Static method in class org.iot.dsa.io.DSBase64
+
+
Decodes a base 64 encoded string.
+
+
decode(DSIReader) + - Static method in class org.iot.dsa.io.NodeDecoder +
+
+
Reads a node tree from the given input.
+
+
decode(String) - + Static method in class org.iot.dsa.node.DSBytes
+
 
+
decode() + - Method in class org.iot.dsa.security.DSPasswordAes +
+
+
Returns the decrypted password.
+
+
decode(String) - + Static method in class org.iot.dsa.time.DSTime
+
+
This is a convenience that uses reuses and recycles a calendar instance to + get the time in + millis. +
+
+
decode(String, Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Converts a DSA encoded timestamp into a Java Calendar.
+
+
decodeKeys(String) + - Static method in class org.iot.dsa.security.DSKeys +
+
+
Decodes an instance that was encoded with encodeKeys().
+
+
decodePath(String) + - Static method in class org.iot.dsa.node.DSPath
+
+
Splits the path and decodes each individual name.
+
+
decodePathName(String) + - Static method in class org.iot.dsa.node.DSPath
+
+
Un-escapes a name.
+
+
decodePrivate(byte[]) + - Static method in class org.iot.dsa.security.DSKeys +
+
+
Decodes the X9.63 encoding of a public key.
+
+
decodePublic(byte[]) + - Static method in class org.iot.dsa.security.DSKeys +
+
+
Decodes the X9.63 encoding of a public key.
+
+
decodeState(DSElement) + - Method in class org.iot.dsa.node.DSInfo
+
 
+
DEFAULT - + Static variable in class org.iot.dsa.dslink.requester.SimpleRequestHandler
+
+
An instance that can be used for those requests where the callbacks don't + really matter. +
+
+
DEFAULT - Static variable in + class org.iot.dsa.node.action.DSAction
+
+
Use this when you have no-arg, no-return actions.
+
+
DEFAULT + - Static variable in class org.iot.dsa.node.DSMetadata +
+
 
+
DEFAULT_BACKUP_THRESHOLD + - Static variable in class org.iot.dsa.logging.DSLogging +
+
+
This is the threshold, not a hard limit: 10 megs by default.
+
+
DEFAULT_MAX_BACKUPS + - Static variable in class org.iot.dsa.logging.DSLogging +
+
+
The default number of backups to retain: 10 by default.
+
+
DEFAULT_MAX_QUEUE + - Static variable in class org.iot.dsa.logging.DSLogging +
+
+
Max async queue size: 2500 by default.
+
+
DESCRIPTION + - Static variable in class org.iot.dsa.node.DSMetadata +
+
 
+
DISABLED + - Static variable in class org.iot.dsa.node.DSStatus +
+
+
Bad, the object has been disabled within DSA.
+
+
disabled + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
DISABLED_STR + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
disconnect() - + Method in class org.iot.dsa.dslink.DSLinkConnection +
+
+
Forcefully closes an open connection.
+
+
DISPLAY_NAME + - Static variable in class org.iot.dsa.node.DSMetadata +
+
 
+
DOWN - + Static variable in class org.iot.dsa.node.DSStatus +
+
+
Bad, communications are down within DSA.
+
+
down - + Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
DOWN_STR + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
DSAction - + Class in org.iot.dsa.node.action +
+
+
Fully describes an action and routes invocations to DSNode.onInvoke.
+
+
DSAction() + - Constructor for class org.iot.dsa.node.action.DSAction +
+
 
+
DSBase64 - Class in org.iot.dsa.io
+
+
Thread-safe Base64 encoder and decoder.
+
+
DSBase64() - Constructor for class + org.iot.dsa.io.DSBase64
+
 
+
DSBool - Class in org.iot.dsa.node
+
+
Represents a boolean value.
+
+
DSBytes - Class in org.iot.dsa.node
+
+
Byte array that gets encoded as a base64 string.
+
+
DSDateTime - Class in org.iot.dsa.time
+
+
Wrapper for Java time.
+
+
DSDouble - Class in org.iot.dsa.node
+
+
A 64 bit floating point (Java double).
+
+
DSElement - Class in org.iot.dsa.node
+
+
The primitives of the node model.
+
+
DSElement() + - Constructor for class org.iot.dsa.node.DSElement +
+
 
+
DSElementType - Enum in org.iot.dsa.node
+
+
The core set of elements that translate directly to a JSON type.
+
+
DSException - Exception in org.iot.dsa.util
+
+
An runtime exception that forwards most calls to the inner exception.
+
+
DSException(Throwable) + - Constructor for exception org.iot.dsa.util.DSException +
+
 
+
DSFlexEnum - Class in org.iot.dsa.node
+
+
An enum where the value and range can be created at runtime, primarily + intended for defining + action parameters. +
+
+
DSFloat - Class in org.iot.dsa.node
+
+
A Java float.
+
+
DSGroup - Class in org.iot.dsa.node
+
+
An index accessible collection of primitives.
+
+
DSGroup() + - Constructor for class org.iot.dsa.node.DSGroup
+
 
+
DSIBoolean - Interface in org.iot.dsa.node
+
+
Indicates something that is/has a boolean value.
+
+
DSIEnum - Interface in org.iot.dsa.node
+
+
DSA Enum mapping.
+
+
DSIEvent - Interface in org.iot.dsa.node.event
+
+
This is an empty interface, DSTopics are allowed to define events however + they wish. +
+
+
DSIMetadata - Interface in org.iot.dsa.node
+
+
Nodes and values can implement this to provide meta-data about + themselves. +
+
+
DSInfo - Class in org.iot.dsa.node
+
+
All node children have corresponding DSInfo instances.
+
+
DSInfoTopic + - Class in org.iot.dsa.node.event +
+
+
This topic is for info related events on DSNodes.
+
+
DSInfoTopic.Event - Enum in org.iot.dsa.node.event
+
+
The possible events for this topic.
+
+
DSInt - Class in org.iot.dsa.node
+
+
A Java int.
+
+
DSInterval - Enum in org.iot.dsa.time
+
+
Enum representing periods of time.
+
+
DSINumber - Interface in org.iot.dsa.node
+
+
Indicates something that is/has a numeric value.
+
+
DSInvalidPathException - Exception in org.iot.dsa.dslink
+
+
Indicates a request path was invalid.
+
+
DSInvalidPathException(String) + - Constructor for exception org.iot.dsa.dslink.DSInvalidPathException +
+
 
+
DSIObject - Interface in org.iot.dsa.node
+
+
Super class of anything found in the node tree.
+
+
DSIPassword - Interface in org.iot.dsa.security
+
+
Defines the api for verifying passwords.
+
+
DSIReader - Interface in org.iot.dsa.io
+
+
A decoder that can be used to get an entire graph in pieces, or one large + group, or somewhere in + between. +
+
+
DSIReader.Token - Enum in org.iot.dsa.io
+
+
Represents the state of the reader, and determines which getter should be + called next. +
+
+
DSIRequester - Interface in org.iot.dsa.dslink
+
+
Interface for submitting outbound requests.
+
+
DSIResponder - Interface in org.iot.dsa.dslink
+
+
Interface for nodes in the node tree to manually handle requests.
+
+
DSIStatus - Interface in org.iot.dsa.node
+
+
Indicates something that is/has a quality.
+
+
DSIStorable - Interface in org.iot.dsa.node
+
+
Enables custom serialization for non-node values in the configuration + database. +
+
+
DSISubscriber - Interface in org.iot.dsa.node.event
+
+
DSISubscribers subscribe to DSTopics on DSNodes.
+
+
DSIValue - Interface in org.iot.dsa.node
+
+
How data values are represented in the node tree.
+
+
DSIWriter - Interface in org.iot.dsa.io
+
+
An encoder that can be used to encode large graphs with or without object + instances. +
+
+
DSJavaEnum - Class in org.iot.dsa.node
+
+
Wrapper for Java enums.
+
+
DSKeys - Class in org.iot.dsa.security
+
+
DSA public private key pair.
+
+
DSKeys(File) - + Constructor for class org.iot.dsa.security.DSKeys +
+
+
Creates a DSKeys object by decoding existing keys from the given file. +
+
+
DSKeys(KeyPair) + - Constructor for class org.iot.dsa.security.DSKeys +
+
+
Creates a DSKeys object for an existing key pair.
+
+
DSKeys.Signer + - Class in org.iot.dsa.security
+
+
Signs bytes.
+
+
DSKeys.Verifier - Class in org.iot.dsa.security
+
+
Verifies signatures.
+
+
DSLink - Class in org.iot.dsa.dslink
+
+
Represents an upstream connection, a node tree, and manages the lifecycle + of both. +
+
+
DSLink() + - Constructor for class org.iot.dsa.dslink.DSLink +
+
+
Use the load method to create links.
+
+
DSLinkConfig - Class in org.iot.dsa.dslink
+
+
Configuration options for starting a link.
+
+
DSLinkConfig() + - Constructor for class org.iot.dsa.dslink.DSLinkConfig +
+
+
This will create an empty unvalidated getConfig.
+
+
DSLinkConfig(File) + - Constructor for class org.iot.dsa.dslink.DSLinkConfig +
+
+
Can be use to change the working dir from the default process working + dir. +
+
+
DSLinkConfig(String) + - Constructor for class org.iot.dsa.dslink.DSLinkConfig +
+
+
Constructor for simulating a command line invocation, the argument will be + split on the space + character. +
+
+
DSLinkConfig(String[]) + - Constructor for class org.iot.dsa.dslink.DSLinkConfig +
+
+
Constructor for the arguments pass to a main method.
+
+
DSLinkConnection - Class in org.iot.dsa.dslink
+
+
Represents an upstream connection with a broker.
+
+
DSLinkConnection() + - Constructor for class org.iot.dsa.dslink.DSLinkConnection +
+
 
+
DSLinkConnection.Listener + - Interface in org.iot.dsa.dslink
+
+
Intended for requester functionality so that requesters can know when to + start and stop making requests. +
+
+
DSList - Class in org.iot.dsa.node
+
+
Indexed collection of elements.
+
+
DSList() - Constructor for class + org.iot.dsa.node.DSList +
+
 
+
DSLogger - Class in org.iot.dsa.logging
+
+
Adds a convenience layer to Java Util Logging.
+
+
DSLogger() + - Constructor for class org.iot.dsa.logging.DSLogger +
+
 
+
DSLogging - Class in org.iot.dsa.logging
+
+
Static utilities for configuring the logging subsystem.
+
+
DSLong - Class in org.iot.dsa.node
+
+
A 64 bit integer (a Java long).
+
+
DSMainNode - Class in org.iot.dsa.dslink
+
+
The root DSNode that triggers a link's custom functionality .
+
+
DSMainNode() + - Constructor for class org.iot.dsa.dslink.DSMainNode +
+
 
+
DSMap - Class in org.iot.dsa.node
+
+
String keyed collection of elements that preserves the order of addition. +
+
+
DSMap() - Constructor for class + org.iot.dsa.node.DSMap
+
 
+
DSMap.Entry - Class in org.iot.dsa.node
+
+
Allows values to be accessed quickly by index in the list, rather than + having to do a key + lookup in the map. +
+
+
DSMetadata - Class in org.iot.dsa.node
+
+
Utility fon constructing metadata maps.
+
+
DSMetadata() + - Constructor for class org.iot.dsa.node.DSMetadata +
+
 
+
DSMetadata(DSMap) + - Constructor for class org.iot.dsa.node.DSMetadata +
+
 
+
DSNode - Class in org.iot.dsa.node
+
+
The organizational unit of the node tree.
+
+
DSNode() - Constructor for class + org.iot.dsa.node.DSNode +
+
 
+
DSNull - Class in org.iot.dsa.node
+
+
Try not to use, it is for decoding raw json.
+
+
DSPasswordAes + - Class in org.iot.dsa.security
+
+
Stores an encrypted password which can be decrypted.
+
+
DSPasswordSha256 + - Class in org.iot.dsa.security
+
+
Stores and verifies passwords using a SHA-256 hash of the text.
+
+
DSPath - Class in org.iot.dsa.node
+
+
Represents a path in the node tree.
+
+
DSPath(String) - + Constructor for class org.iot.dsa.node.DSPath
+
 
+
DSPermission - Enum in org.iot.dsa.security
+
+
Used to define the required permissions for various objects.
+
+
DSPermissionException - Exception in org.iot.dsa.dslink
+
+
Indicates a request has insufficient permissions.
+
+
DSPermissionException(String) + - Constructor for exception org.iot.dsa.dslink.DSPermissionException +
+
 
+
DSRegistry - Class in org.iot.dsa.node
+
+
Static type related meta-data.
+
+
DSRegistry() + - Constructor for class org.iot.dsa.node.DSRegistry +
+
 
+
DSRequestException + - Exception in org.iot.dsa.dslink
+
+
Indicates something was wrong with a request.
+
+
DSRequestException() + - Constructor for exception org.iot.dsa.dslink.DSRequestException +
+
 
+
DSRequestException(String) + - Constructor for exception org.iot.dsa.dslink.DSRequestException +
+
 
+
DSRuntime - Class in org.iot.dsa
+
+
DSA thread pool and timers.
+
+
DSRuntime.Timer - Class in org.iot.dsa
+
+
Can be used to inspect and cancel tasks passed to the run methods in + DSRuntime. +
+
+
DSStatus - Class in org.iot.dsa.node
+
+
Represent the health, quality or condition of an object.
+
+
DSString - Class in org.iot.dsa.node
+
+
String wrapper.
+
+
DSTime - Class in org.iot.dsa.time
+
+
Misc time utility functions.
+
+
DSTopic - Class in org.iot.dsa.node.event
+
+
DSISubscribers subscribe to DSTopics on DSNodes.
+
+
DSTopic() + - Constructor for class org.iot.dsa.node.event.DSTopic +
+
 
+
DSUtil - Class in org.iot.dsa.util
+
+
Common utilities.
+
+
DSValue - Class in org.iot.dsa.node
+
+
A convenience that provides some common default behavior.
+
+
DSValue() + - Constructor for class org.iot.dsa.node.DSValue
+
 
+
DSValueNode - Class in org.iot.dsa.node
+
+
A convenience implementation of a node that is also a value.
+
+
DSValueNode() + - Constructor for class org.iot.dsa.node.DSValueNode +
+
 
+
DSValueTopic - Class in org.iot.dsa.node.event
+
+
This topic is for change of value events on DSNodes.
+
+
DSValueTopic.Event - Enum in org.iot.dsa.node.event
+
+
The possible events from this topic.
+
+
DSValueType - Enum in org.iot.dsa.node
+
+
These are the primitive types in the DSA protocol.
+
+
+ + + +

E

+
+
EDITOR - Static variable in class + org.iot.dsa.node.DSMetadata +
+
 
+
EMPTY + - Static variable in class org.iot.dsa.node.DSString +
+
+
The string of length 0.
+
+
encode(byte[]) + - Static method in class org.iot.dsa.io.DSBase64
+
+
Encodes the bytes into a single line string with no padding.
+
+
encode(byte[], int) + - Static method in class org.iot.dsa.io.DSBase64
+
+
Encodes the buffer into a String with the given line length.
+
+
encode(DSIWriter, DSNode) + - Static method in class org.iot.dsa.io.NodeEncoder +
+
+
Writes the node tree to the given writer.
+
+
encode(byte[]) + - Static method in class org.iot.dsa.node.DSBytes +
+
 
+
encode(byte[]) - + Static method in class org.iot.dsa.security.DSPasswordAes +
+
+
Encrypts the given bytes.
+
+
encode(String) + - Static method in class org.iot.dsa.security.DSPasswordAes +
+
+
Encrypts the given text.
+
+
encode(byte[]) - + Static method in class org.iot.dsa.security.DSPasswordSha256 +
+
+
SHA-256 hash of the bytes encoded as url safe base 64..
+
+
encode(String) + - Static method in class org.iot.dsa.security.DSPasswordSha256 +
+
+
SHA-256 hash of the UTF-8 bytes, encoded as url safe base 64..
+
+
encode(long, boolean) + - Static method in class org.iot.dsa.time.DSTime
+
+
Converts a Java Calendar into a DSA encoded timestamp.
+
+
encode(long, boolean, StringBuilder) + - Static method in class org.iot.dsa.time.DSTime
+
+
Converts a Java Calendar into a DSA encoded timestamp.
+
+
encode(Calendar, boolean, StringBuilder) + - Static method in class org.iot.dsa.time.DSTime
+
+
Converts a Java Calendar into a DSA encoded timestamp.
+
+
encodeForFiles(Calendar, StringBuilder) + - Static method in class org.iot.dsa.time.DSTime
+
+
Converts a Java Calendar into a number safe for file names: YYMMDDHHMMSS. +
+
+
encodeForLogs(Calendar, StringBuilder) + - Static method in class org.iot.dsa.time.DSTime
+
+
Converts a Java Calendar into a shorter human readable timestamp for use in + logging files. +
+
+
encodeKeys() + - Method in class org.iot.dsa.security.DSKeys +
+
+
Encodes the key pair which can be then decoded with decodeKeys().
+
+
encodeName(String) + - Static method in class org.iot.dsa.node.DSPath
+
+
Encodes a name for being in a path.
+
+
encodeName(String, StringBuilder) + - Static method in class org.iot.dsa.node.DSPath
+
+
Encodes a name for being in a path.
+
+
encodePath(DSNode) + - Static method in class org.iot.dsa.node.DSPath
+
+
Ascends the tree and encodes all the node names into a path.
+
+
encodePublic() + - Method in class org.iot.dsa.security.DSKeys +
+
+
X9.63 encoding of the public key.
+
+
encodePublicHashDsId() + - Method in class org.iot.dsa.security.DSKeys +
+
+
Base64 encoding (no padding and url safe) of the SHA256 hash of the public + key. +
+
+
encodeState() + - Method in class org.iot.dsa.node.DSInfo
+
 
+
encodeUrl(byte[]) + - Static method in class org.iot.dsa.io.DSBase64
+
+
Encodes to a URL safe base64 string.
+
+
endList() + - Method in class org.iot.dsa.io.AbstractWriter
+
 
+
endList() + - Method in interface org.iot.dsa.io.DSIWriter
+
+
End the current list.
+
+
endMap() - Method in class + org.iot.dsa.io.AbstractWriter +
+
 
+
endMap() - Method in interface + org.iot.dsa.io.DSIWriter +
+
+
End the current map.
+
+
ENUM_RANGE + - Static variable in class org.iot.dsa.node.DSMetadata +
+
 
+
equal(Object, Object) + - Static method in class org.iot.dsa.util.DSUtil
+
+
Comparison that takes null into account; null == null.
+
+
equals(Object) - + Method in class org.iot.dsa.node.DSBool
+
 
+
equals(Object) - + Method in class org.iot.dsa.node.DSBytes
+
+
True if the argument is a DSINumber and the values are equal or they are + both isNull. +
+
+
equals(Object) - + Method in class org.iot.dsa.node.DSDouble
+
+
True if the argument is a DSINumber and the values are equal or they are + both isNull. +
+
+
equals(Object) - + Method in class org.iot.dsa.node.DSFlexEnum
+
+
True if the argument is a DSFlexEnum and the values are equal or they are + both isNull. +
+
+
equals(Object) - + Method in class org.iot.dsa.node.DSFloat
+
+
True if the argument is a DSINumber and the values are equal or they are + both isNull. +
+
+
equals(Object) - + Method in class org.iot.dsa.node.DSGroup
+
 
+
equals(Object) - + Method in class org.iot.dsa.node.DSInfo
+
 
+
equals(Object) + - Method in class org.iot.dsa.node.DSInt
+
+
True if the argument is a DSINumber and the values are equal or they are + both isNull. +
+
+
equals(Object) - + Method in class org.iot.dsa.node.DSJavaEnum
+
+
True if the argument is a DSDynamicEnum and the values are equal or they + are both isNull. +
+
+
equals(Object) - + Method in class org.iot.dsa.node.DSLong
+
+
True if the argument is a DSINumber and the values are equal or they are + both isNull. +
+
+
equals(Object) + - Method in class org.iot.dsa.node.DSMap.Entry
+
 
+
equals(Object) + - Method in class org.iot.dsa.node.DSMap
+
 
+
equals(Object) - + Method in class org.iot.dsa.node.DSNull
+
+
True of the arg == this.
+
+
equals(Object) - + Method in class org.iot.dsa.node.DSStatus
+
 
+
equals(Object) - + Method in class org.iot.dsa.node.DSString
+
 
+
equals(Object) + - Method in class org.iot.dsa.security.DSPasswordAes +
+
 
+
equals(Object) + - Method in class org.iot.dsa.security.DSPasswordSha256 +
+
 
+
equals(Object) - + Method in class org.iot.dsa.time.DSDateTime
+
 
+
equalsDefault() + - Method in class org.iot.dsa.node.DSInfo
+
+
True if this proxies a default and the state and value match the default. +
+
+
equalsDefaultState() + - Method in class org.iot.dsa.node.DSInfo
+
+
True if the state matches the default state.
+
+
equalsDefaultType() + - Method in class org.iot.dsa.node.DSInfo
+
+
True if this proxies a default and the value type matches the default. +
+
+
equalsDefaultValue() + - Method in class org.iot.dsa.node.DSInfo
+
+
True if this proxies a default and the value matches the default.
+
+
+ + + +

F

+
+
FALSE - + Static variable in class org.iot.dsa.node.DSBool
+
 
+
FAULT + - Static variable in class org.iot.dsa.node.DSStatus +
+
+
Bad, an operational error (exception) has occurred within DSA.
+
+
fault + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
FAULT_STR - Static variable in + class org.iot.dsa.node.DSStatus
+
 
+
FileLogHandler - Class in org.iot.dsa.logging
+
+
Logs records to a file.
+
+
fine() - Method in class + org.iot.dsa.logging.DSLogger
+
+
True if the level is loggable.
+
+
fine(Object) - + Method in class org.iot.dsa.logging.DSLogger
+
+
Log a frequent event.
+
+
fine(Object, Throwable) + - Method in class org.iot.dsa.logging.DSLogger +
+
+
Log a frequent event.
+
+
finer() + - Method in class org.iot.dsa.logging.DSLogger +
+
+
True if the level is loggable.
+
+
finer(Object) - + Method in class org.iot.dsa.logging.DSLogger
+
+
Log a debug event.
+
+
finer(Object, Throwable) + - Method in class org.iot.dsa.logging.DSLogger +
+
+
Log a debug event.
+
+
finest() - Method in class + org.iot.dsa.logging.DSLogger
+
+
True if the level is loggable.
+
+
finest(Object) + - Method in class org.iot.dsa.logging.DSLogger +
+
+
Log a trace or verbose event.
+
+
finest(Object, Throwable) + - Method in class org.iot.dsa.logging.DSLogger +
+
+
Log a trace or verbose event.
+
+
fire(DSTopic, DSIEvent, DSInfo) + - Method in class org.iot.dsa.node.DSNode
+
+
Notifies subscribers of the event.
+
+
fire(DSTopic, DSIEvent, DSInfo, Object...) + - Method in class org.iot.dsa.node.DSNode
+
+
Notifies subscribers of the event.
+
+
first() - Method in class + org.iot.dsa.node.DSGroup +
+
+
Returns the item at index 0.
+
+
flush() - Method in interface + org.iot.dsa.io.DSIWriter +
+
+
Flush the stream.
+
+
flush() - Method in class + org.iot.dsa.io.json.JsonAppender
+
 
+
flush() - Method in class + org.iot.dsa.io.json.JsonWriter
+
 
+
flush() + - Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
+
Does nothing.
+
+
flush() + - Method in class org.iot.dsa.logging.AsyncLogHandler +
+
 
+
forString(String) + - Static method in enum org.iot.dsa.security.DSPermission +
+
 
+
+ + + +

G

+
+
generateHmacSHA256Signature(byte[], byte[]) + - Static method in class org.iot.dsa.security.DSKeys +
+
 
+
generateSharedSecret(byte[]) + - Method in class org.iot.dsa.security.DSKeys +
+
+
Uses the given public key to generate an ECDH shared secret.
+
+
generateSharedSecret(String) + - Method in class org.iot.dsa.security.DSKeys +
+
+
Uses the given public key to generate an ECDH shared secret.
+
+
get(int) - Method in class + org.iot.dsa.node.DSGroup +
+
+
Returns the value at the given index.
+
+
get(int, boolean) + - Method in class org.iot.dsa.node.DSGroup
+
+
Optional getter.
+
+
get(int, double) + - Method in class org.iot.dsa.node.DSGroup
+
+
Optional getter.
+
+
get(int, int) + - Method in class org.iot.dsa.node.DSGroup
+
+
Optional getter.
+
+
get(int, long) + - Method in class org.iot.dsa.node.DSGroup
+
+
Optional getter.
+
+
get(int, String) - + Method in class org.iot.dsa.node.DSGroup
+
+
Optional getter.
+
+
get(int) - Method in class + org.iot.dsa.node.DSList +
+
 
+
get(int) - Method in class + org.iot.dsa.node.DSMap
+
 
+
get(String) + - Method in class org.iot.dsa.node.DSMap
+
+
Returns the value for the given key.
+
+
get(String, boolean) + - Method in class org.iot.dsa.node.DSMap
+
+
Optional getter, returns the provided default if the value mapped to the + key is null or not + convertible. +
+
+
get(String, double) + - Method in class org.iot.dsa.node.DSMap
+
+
Optional getter, returns the provided default if the value mapped to the + key is null. +
+
+
get(String, int) - + Method in class org.iot.dsa.node.DSMap
+
+
Optional getter, returns the provided default if the value mapped to the + key is null or not + convertible. +
+
+
get(String, long) - + Method in class org.iot.dsa.node.DSMap
+
+
Optional getter, returns the provided default if the value mapped to the + key is null or not + convertible. +
+
+
get(String, String) + - Method in class org.iot.dsa.node.DSMap
+
+
Optional getter, returns the provided default if the value mapped to the + key is null. +
+
+
get(String) + - Method in class org.iot.dsa.node.DSNode
+
+
Returns the child value with the given name, or null.
+
+
getAction() - + Method in interface org.iot.dsa.dslink.responder.ApiObject
+
+
The action, should only be called if isAction() returns true.
+
+
getAction() - Method + in interface org.iot.dsa.node.action.ActionResult +
+
+
The action that was invoked.
+
+
getAction() - Method in class + org.iot.dsa.node.DSInfo +
+
 
+
getBackups() + - Method in class org.iot.dsa.logging.FileLogHandler +
+
+
Backup files for this logging, found in the same directory as the active + logging. +
+
+
getBit(int, int) + - Static method in class org.iot.dsa.util.DSUtil
+
+
Returns true if the bit at the given index is set.
+
+
getBoolean() + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
getBoolean() + - Method in interface org.iot.dsa.io.DSIReader
+
+
Returns the value when last() == BOOLEAN.
+
+
getBoolean(int) + - Method in class org.iot.dsa.node.DSGroup
+
+
Primitive getter.
+
+
getBoolean(String) + - Method in class org.iot.dsa.node.DSMap
+
+
Primitive getter.
+
+
getBooleanRange() + - Method in class org.iot.dsa.node.DSMetadata
+
+
The boolean range, or null.
+
+
getBrokerUri() + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
If not set, will look for the getConfig in dslink.json.
+
+
getBytes() + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
getBytes() - Method in interface + org.iot.dsa.io.DSIReader +
+
+
Returns the value when last() == BYTES.
+
+
getBytes() - Method in class + org.iot.dsa.node.DSBytes +
+
+
The raw bytes, do not modify.
+
+
getCalendar() + - Static method in class org.iot.dsa.time.DSTime
+
+
Attempts to reuse a calendar instance, the timezone will be set to + TimeZone.getDefault(). +
+
+
getCalendar(long) + - Static method in class org.iot.dsa.time.DSTime
+
+
Attempts to reuse a calendar instance and sets the time in millis to the + argument and the + timezone to TimeZone.getDefault(). +
+
+
getCause() + - Method in exception org.iot.dsa.util.DSException +
+
 
+
getChildren() - + Method in interface org.iot.dsa.dslink.responder.ApiObject
+
+
Iterator of child objects, should only be called if hasChildren() returns + true. +
+
+
getChildren() + - Method in class org.iot.dsa.node.DSInfo
+
 
+
getColumns() - + Method in interface org.iot.dsa.node.action.ActionTable +
+
+
Column definitions, optional but highly recommended.
+
+
getConfig() + - Method in class org.iot.dsa.dslink.DSLink
+
 
+
getConfig(String, boolean) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Looks for the value in dslink.json and if not found, returns the + fallback. +
+
+
getConfig(String, double) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Looks for the value in dslink.json and if not found, returns the + fallback. +
+
+
getConfig(String, int) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Looks for the value in dslink.json and if not found, returns the + fallback. +
+
+
getConfig(String, long) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Looks for the value in dslink.json and if not found, returns the + fallback. +
+
+
getConfig(String, String) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Looks for the value in dslink.json and if not found, returns the + fallback. +
+
+
getConnection() + - Method in class org.iot.dsa.dslink.DSLink
+
 
+
getConnectionId() + - Method in class org.iot.dsa.dslink.DSLinkConnection +
+
+
A unique descriptive tag such as a combination of the link name and the + broker host. +
+
+
getDecimalPlaces() + - Method in class org.iot.dsa.node.DSMetadata
+
+
The decimal precision or null.
+
+
getDecoder(Class) + - Static method in class org.iot.dsa.node.DSRegistry +
+
+
The instance to use for decoding.
+
+
getDefault() + - Method in class org.iot.dsa.node.DSMetadata
+
+
The default value for an action parameter, or null.
+
+
getDefaultLogger() - + Static method in class org.iot.dsa.logging.DSLogging +
+
+
The default logger.
+
+
getDefaultObject() + - Method in class org.iot.dsa.node.DSInfo
+
+
If this represents a dynamic child, this just returns the current value. +
+
+
getDepth() + - Method in class org.iot.dsa.io.AbstractWriter
+
+
Current depth in the tree, will be needed by writeNewLineIndent.
+
+
getDescription() + - Method in class org.iot.dsa.node.DSMetadata
+
+
The description, or null.
+
+
getDetail() - + Method in exception org.iot.dsa.dslink.DSRequestException +
+
+
Additional information to supply to the remote endpoint.
+
+
getDisplayName() + - Method in class org.iot.dsa.node.DSMetadata
+
+
The alternate display name, or null.
+
+
getDouble() + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
getDouble() - Method in + interface org.iot.dsa.io.DSIReader
+
+
Returns the value when last() == DOUBLE.
+
+
getDouble(int) + - Method in class org.iot.dsa.node.DSGroup
+
+
Primitive getter.
+
+
getDouble(String) + - Method in class org.iot.dsa.node.DSMap
+
+
Primitive getter.
+
+
getDsId() - Method in class + org.iot.dsa.dslink.DSLink
+
+
Returns the unique id of the connection.
+
+
getDslinkJson() + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
If not set, this will attempt to open dslink.json in the working the + process directory. +
+
+
getEditor() + - Method in class org.iot.dsa.node.DSMetadata
+
+
The editor, or null.
+
+
getElement() + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
getElement() + - Method in interface org.iot.dsa.io.DSIReader
+
+
Returns the DSElement when last() == raw type or ROOT.
+
+
getElement() + - Method in class org.iot.dsa.node.DSInfo
+
+
A convenience that casts getObject().
+
+
getElement(String) + - Method in class org.iot.dsa.node.DSNode
+
+
A convenience for (DSElement) get(name).
+
+
getElementType() + - Method in class org.iot.dsa.node.DSBool
+
 
+
getElementType() + - Method in class org.iot.dsa.node.DSBytes
+
 
+
getElementType() + - Method in class org.iot.dsa.node.DSDouble
+
 
+
getElementType() + - Method in class org.iot.dsa.node.DSElement
+
+
For switch statements.
+
+
getElementType() + - Method in class org.iot.dsa.node.DSList
+
 
+
getElementType() + - Method in class org.iot.dsa.node.DSLong
+
 
+
getElementType() + - Method in class org.iot.dsa.node.DSMap
+
 
+
getElementType() + - Method in class org.iot.dsa.node.DSNull
+
 
+
getElementType() + - Method in class org.iot.dsa.node.DSString
+
 
+
getEntry(int) + - Method in class org.iot.dsa.node.DSMap
+
 
+
getEntry(String) - + Method in class org.iot.dsa.node.DSMap
+
 
+
getEnumRange() + - Method in class org.iot.dsa.node.DSMetadata
+
+
The editor, or null.
+
+
getEnums(DSList) + - Method in class org.iot.dsa.node.DSFlexEnum
+
 
+
getEnums(DSList) + - Method in interface org.iot.dsa.node.DSIEnum +
+
+
Adds the range of possible values to the given bucket.
+
+
getEnums(DSList) + - Method in class org.iot.dsa.node.DSJavaEnum
+
 
+
getFirst() - Method in class + org.iot.dsa.node.DSNode +
+
+
The first child, or null.
+
+
getFirstInfo() + - Method in class org.iot.dsa.node.DSNode
+
+
The first child info, or null.
+
+
getFirstNodeInfo() + - Method in class org.iot.dsa.node.DSNode
+
+
The info for the first child node, or null.
+
+
getFloat(int) + - Method in class org.iot.dsa.node.DSGroup
+
+
Primitive getter.
+
+
getHandler(File) + - Static method in class org.iot.dsa.logging.FileLogHandler +
+
+
Will return an existing handler for the given file, or create a new one. +
+
+
getHelpText() + - Static method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Help text for command line options.
+
+
getHouseKeepingIntervalMillis() + - Method in class org.iot.dsa.logging.AsyncLogHandler +
+
+
Ten seconds by default, this is a guideline more than anything else.
+
+
getInfo() + - Method in class org.iot.dsa.node.DSNode
+
+
DSInfo for this node in its parent, or null if un-parented.
+
+
getInfo(String) - + Method in class org.iot.dsa.node.DSNode
+
+
Returns the info for the child with the given name, or null.
+
+
getInt(int) - Method in class + org.iot.dsa.node.DSGroup +
+
+
Primitive getter.
+
+
getInt(String) + - Method in class org.iot.dsa.node.DSMap
+
+
Primitive getter.
+
+
getInterval() + - Method in class org.iot.dsa.DSRuntime.Timer
+
+
The interval between runs, zero or less for no interval.
+
+
getKey() - Method in class + org.iot.dsa.node.DSMap.Entry
+
 
+
getKey(int) - Method in class + org.iot.dsa.node.DSMap
+
+
Returns the key at the given index.
+
+
getKeys() - Method in class + org.iot.dsa.dslink.DSLink
+
+
Public / private keys of the link, used to prove identity with brokers. +
+
+
getKeys() + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
If not set, will attempt to use the getConfig in dslink.json and fall back + to '.key' in the + process directory if necessary. +
+
+
getKeys() - Method in class + org.iot.dsa.security.DSKeys
+
+
The public and private keys.
+
+
getLast() + - Method in class org.iot.dsa.node.DSNode
+
+
The last child, or null.
+
+
getLastInfo() + - Method in class org.iot.dsa.node.DSNode
+
+
The last child info, or null.
+
+
getLastPathElement() + - Method in class org.iot.dsa.node.DSPath
+
 
+
getLevel() + - Method in enum org.iot.dsa.security.DSPermission +
+
 
+
getLink() + - Method in class org.iot.dsa.dslink.DSLinkConnection +
+
+
The link using this connection.
+
+
getLink() + - Method in class org.iot.dsa.dslink.DSMainNode +
+
+
The parent link or null.
+
+
getLinkName() + - Method in class org.iot.dsa.dslink.DSLink
+
+
As defined in dslink.json.
+
+
getLinkName() + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
getList() + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
getList() + - Method in interface org.iot.dsa.io.DSIReader
+
+
This should only be called when last() == BEGIN_LIST and it will decodeKeys + the entire + list. +
+
+
getList(int) + - Method in class org.iot.dsa.node.DSGroup
+
+
Primitive getter.
+
+
getList(String) - + Method in class org.iot.dsa.node.DSMap
+
+
Return the list, or null.
+
+
getLocalizedMessage() + - Method in exception org.iot.dsa.util.DSException +
+
 
+
getLogFile() + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
getLogger() + - Method in class org.iot.dsa.dslink.DSLink
+
+
The logger as defined in dslink.json.
+
+
getLogger() + - Method in class org.iot.dsa.dslink.DSLinkConnection +
+
 
+
getLogger(String) + - Method in class org.iot.dsa.dslink.DSMainNode +
+
+
Creates a child logger of the link.
+
+
getLogger() + - Method in class org.iot.dsa.logging.DSLogger +
+
+
Override point, returns the console logger by default.
+
+
getLogger(String, File) + - Static method in class org.iot.dsa.logging.DSLogging +
+
+
Adds a FileLogHandler to the named logger, if there isn't one already. +
+
+
getLogger() - Method in class + org.iot.dsa.node.DSNode +
+
+
Ascends the tree until a logger is found.
+
+
getLogLevel() + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
If not set, will attempt to use the getConfig in dslink.json but fall back + to 'info' if + necessary. +
+
+
getLong() + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
getLong() + - Method in interface org.iot.dsa.io.DSIReader
+
+
Returns the value when last() == LONG.
+
+
getLong(int) + - Method in class org.iot.dsa.node.DSGroup
+
+
Primitive getter.
+
+
getLong(String) - + Method in class org.iot.dsa.node.DSMap
+
+
Primitive getter.
+
+
getMain() - Method in class + org.iot.dsa.dslink.DSLink
+
+
Returns the root of the node tree.
+
+
getMainType() + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
The type of the root node.
+
+
getMap() - Method in class + org.iot.dsa.io.AbstractReader +
+
 
+
getMap() - Method in interface + org.iot.dsa.io.DSIReader +
+
+
This should only be called when last() == BEGIN_MAP and it will decodeKeys + the entire map. +
+
+
getMap(int) - Method in class + org.iot.dsa.node.DSGroup +
+
+
Primitive getter.
+
+
getMap(String) + - Method in class org.iot.dsa.node.DSMap
+
+
Returns the map value for the given key, or null.
+
+
getMap() - Method in class + org.iot.dsa.node.DSMetadata +
+
 
+
getMaxBackups() - + Method in class org.iot.dsa.logging.FileLogHandler +
+
+
The number of backup files to retain.
+
+
getMaxValue() + - Method in class org.iot.dsa.node.DSMetadata
+
+
The max value, or null.
+
+
getMessage() + - Method in exception org.iot.dsa.util.DSException +
+
 
+
getMetadata(DSMap) + - Method in interface org.iot.dsa.dslink.responder.ApiObject
+
 
+
getMetadata(DSMap) + - Method in class org.iot.dsa.node.DSFlexEnum
+
 
+
getMetadata(DSMap) + - Method in interface org.iot.dsa.node.DSIMetadata +
+
+
The entity should add any metadata about itself to the given map.
+
+
getMetadata(DSMap) + - Method in class org.iot.dsa.node.DSInfo
+
 
+
getMetadata(DSMap) + - Method in class org.iot.dsa.node.DSJavaEnum
+
 
+
getMetadata(DSInfo, DSMap) + - Static method in class org.iot.dsa.node.DSMetadata +
+
+
Fully acquires metadata about the info.
+
+
getMetadata(DSInfo, DSMap) + - Method in class org.iot.dsa.node.DSNode
+
+
Override point, add any meta data for the given info to the provided + bucket. +
+
+
getMinValue() + - Method in class org.iot.dsa.node.DSMetadata
+
+
The min value, or null.
+
+
getName() - Method + in interface org.iot.dsa.dslink.responder.ApiObject
+
+
The display name.
+
+
getName() + - Method in class org.iot.dsa.node.DSInfo
+
 
+
getName() - Method in class + org.iot.dsa.node.DSMetadata +
+
+
The name, or null.
+
+
getName() + - Method in class org.iot.dsa.node.DSNode
+
+
Returns the name of this node in its parent, or null if un-parented.
+
+
getNode() + - Method in class org.iot.dsa.node.DSInfo
+
+
A convenience that casts getObject().
+
+
getNode(String) - + Method in class org.iot.dsa.node.DSNode
+
+
A convenience for (DSNode) get(name).
+
+
getNodesFile() + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
If not set, will attempt to use the getConfig in dslink.json but fall back + to 'nodes.zip' in + the process directory if necessary. +
+
+
getObject() - Method in class + org.iot.dsa.node.DSInfo +
+
 
+
getOut() + - Method in class org.iot.dsa.logging.AsyncLogHandler +
+
+
The sink for formatted messages.
+
+
getParameters() + - Method in interface org.iot.dsa.node.action.ActionInvocation
+
+
The parameters supplied by the requester, or null.
+
+
getParameters() - + Method in interface org.iot.dsa.node.action.ActionSpec +
+
+
Returns an iterator for each parameter.
+
+
getParameters() - + Method in class org.iot.dsa.node.action.DSAction +
+
 
+
getParameters() + - Static method in class org.iot.dsa.security.DSKeys +
+
+
The AlgorithmParameterSpec for the predefined elliptic curve secp256r1. +
+
+
getParams() + - Method in class org.iot.dsa.dslink.requester.AbstractInvokeHandler
+
+
Returns the value passed to onInit.
+
+
getParent() - Method in class + org.iot.dsa.node.DSInfo +
+
 
+
getParent() - Method in class + org.iot.dsa.node.DSNode +
+
+
Returns the parent node, or null.
+
+
getPath() + - Method in class org.iot.dsa.dslink.requester.AbstractInvokeHandler
+
+
Returns the value passed to onInit.
+
+
getPath() + - Method in class org.iot.dsa.dslink.requester.AbstractListHandler
+
+
Returns the value passed to onInit.
+
+
getPath() + - Method in class org.iot.dsa.dslink.requester.AbstractSubscribeHandler
+
+
Returns the value passed to onInit.
+
+
getPath() - + Method in interface org.iot.dsa.dslink.responder.InboundRequest
+
+
The target of the request.
+
+
getPath() + - Method in class org.iot.dsa.node.DSNode
+
+
The DSA path, properly encoded.
+
+
getPath() + - Method in class org.iot.dsa.node.DSPath
+
+
The raw fully encoded path.
+
+
getPathElements() + - Method in class org.iot.dsa.node.DSPath
+
+
The individual, decoded path elements.
+
+
getPermission() + - Method in interface org.iot.dsa.dslink.responder.InboundSetRequest
+
+
The permission to set with.
+
+
getPermission() + - Method in interface org.iot.dsa.node.action.ActionInvocation
+
+
The permission level of the invoker, should be verified against the + permission level required + by the action. +
+
+
getPermission() - + Method in interface org.iot.dsa.node.action.ActionSpec +
+
+
Minimum permission level required to invoke.
+
+
getPermission() - + Method in class org.iot.dsa.node.action.DSAction +
+
 
+
getPlaceHolder() + - Method in class org.iot.dsa.node.DSMetadata
+
+
Placeholder text for text fields, or null.
+
+
getPrivateKey() + - Method in class org.iot.dsa.security.DSKeys +
+
+
A convenience that casts the private key.
+
+
getPublicKey() + - Method in class org.iot.dsa.security.DSKeys +
+
+
A convenience that casts the public key.
+
+
getQos() + - Method in class org.iot.dsa.dslink.requester.AbstractSubscribeHandler
+
+
Returns the value passed to onInit.
+
+
getRequester() - + Method in class org.iot.dsa.dslink.DSLinkConnection +
+
 
+
getRequestId() + - Method in interface org.iot.dsa.dslink.responder.InboundRequest
+
+
Unique ID of the request, or 0 for subscriptions.
+
+
getResultType() - + Method in interface org.iot.dsa.node.action.ActionSpec +
+
+
What the action returns.
+
+
getResultType() - + Method in class org.iot.dsa.node.action.DSAction +
+
 
+
getRows() + - Method in interface org.iot.dsa.node.action.ActionTable
+
+
This should return an iterator for the initial set of rows, or null if + there aren't any. +
+
+
getRunnable() + - Method in class org.iot.dsa.DSRuntime.Timer
+
+
The runnable being managed by this timer.
+
+
getSignature() - + Method in class org.iot.dsa.security.DSKeys.Signer +
+
+
The signature for all bytes passed to the update method.
+
+
getSignatureBase64() + - Method in class org.iot.dsa.security.DSKeys.Signer +
+
+
The base 64 encoding of the signature for all bytes passed to the update + method. +
+
+
getStackTrace() + - Method in exception org.iot.dsa.util.DSException +
+
 
+
getStream() + - Method in class org.iot.dsa.dslink.requester.AbstractInvokeHandler
+
+
Returns the value passed to onInit.
+
+
getStream() + - Method in class org.iot.dsa.dslink.requester.AbstractListHandler
+
+
Returns the value passed to onInit.
+
+
getStream() + - Method in class org.iot.dsa.dslink.requester.AbstractSubscribeHandler
+
+
Returns the value passed to onInit.
+
+
getString() + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
getString() - Method in + interface org.iot.dsa.io.DSIReader
+
+
Returns the value when last() == STRING.
+
+
getString(int) + - Method in class org.iot.dsa.node.DSGroup
+
+
Primitive getter.
+
+
getString(String) + - Method in class org.iot.dsa.node.DSMap
+
+
Returns the String value for the given key, or null.
+
+
getSubscriptionId() + - Method in interface org.iot.dsa.dslink.responder.InboundSubscribeRequest
+
+
Unique subscription id for this path.
+
+
getTarget() + - Method in interface org.iot.dsa.dslink.responder.OutboundListResponse
+
+
The object that represents the path of the request.
+
+
getThreadName() - + Method in class org.iot.dsa.logging.AsyncLogHandler +
+
+
Used to name the thread that processes logging records.
+
+
getThreadName() - + Method in class org.iot.dsa.logging.FileLogHandler +
+
 
+
getThreadName() + - Method in class org.iot.dsa.logging.PrintStreamLogHandler +
+
 
+
getToken() + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Authentication token for the broker, this can return null.
+
+
getTransport() - + Method in class org.iot.dsa.dslink.DSLinkConnection +
+
 
+
getType() - Method in class + org.iot.dsa.node.DSMetadata +
+
+
The type for action parameters, can be used to override types in the + responder api. +
+
+
getUnit() - Method in class + org.iot.dsa.node.DSMetadata +
+
+
Value if defined, otherwise null.
+
+
getValue() - Method + in interface org.iot.dsa.dslink.responder.ApiObject
+
+
Value of the object, should only be called if isValue() returns true.
+
+
getValue() + - Method in interface org.iot.dsa.dslink.responder.InboundSetRequest
+
+
The value to set.
+
+
getValue() - Method in class + org.iot.dsa.node.DSInfo +
+
+
A convenience that casts getObject().
+
+
getValue() + - Method in class org.iot.dsa.node.DSMap.Entry
+
 
+
getValue(String) - + Method in class org.iot.dsa.node.DSNode
+
+
A convenience for (DSIValue) get(name).
+
+
getValueChild() + - Method in class org.iot.dsa.node.DSValueNode
+
+
Subclasses must store the node value in a child value and provide the info + for that child + here. +
+
+
getValueResults() + - Method in interface org.iot.dsa.node.action.ActionSpec
+
+
This is only called for the VALUES result type.
+
+
getValueResults() + - Method in class org.iot.dsa.node.action.DSAction +
+
 
+
getValues() - Method + in interface org.iot.dsa.node.action.ActionValues +
+
 
+
getValueType() + - Method in class org.iot.dsa.node.DSBool
+
 
+
getValueType() + - Method in class org.iot.dsa.node.DSBytes
+
 
+
getValueType() + - Method in class org.iot.dsa.node.DSDouble
+
 
+
getValueType() + - Method in class org.iot.dsa.node.DSElement
+
+
The DSA value type mapping.
+
+
getValueType() + - Method in class org.iot.dsa.node.DSFlexEnum
+
 
+
getValueType() + - Method in class org.iot.dsa.node.DSFloat
+
 
+
getValueType() + - Method in class org.iot.dsa.node.DSInt
+
 
+
getValueType() + - Method in interface org.iot.dsa.node.DSIValue +
+
+
The DSA type mapping.
+
+
getValueType() + - Method in class org.iot.dsa.node.DSJavaEnum
+
 
+
getValueType() + - Method in class org.iot.dsa.node.DSList
+
 
+
getValueType() + - Method in class org.iot.dsa.node.DSLong
+
 
+
getValueType() + - Method in class org.iot.dsa.node.DSMap
+
 
+
getValueType() + - Method in class org.iot.dsa.node.DSNull
+
 
+
getValueType() + - Method in class org.iot.dsa.node.DSStatus
+
+
String.
+
+
getValueType() + - Method in class org.iot.dsa.node.DSString
+
 
+
getValueType() + - Method in class org.iot.dsa.node.DSValueNode
+
 
+
getValueType() - + Method in class org.iot.dsa.security.DSPasswordAes +
+
 
+
getValueType() - + Method in class org.iot.dsa.security.DSPasswordSha256 +
+
 
+
getValueType() + - Method in class org.iot.dsa.time.DSDateTime
+
+
String.
+
+
+ + + +

H

+
+
hasChildren() - + Method in interface org.iot.dsa.dslink.responder.ApiObject
+
+
True if getChildren() can be called.
+
+
hasChildren() + - Method in class org.iot.dsa.node.DSInfo
+
 
+
hashCode() - Method in class + org.iot.dsa.node.DSBool +
+
 
+
hashCode() - Method in class + org.iot.dsa.node.DSBytes +
+
 
+
hashCode() - Method in class + org.iot.dsa.node.DSDouble +
+
 
+
hashCode() + - Method in class org.iot.dsa.node.DSFlexEnum
+
 
+
hashCode() - Method in class + org.iot.dsa.node.DSFloat +
+
 
+
hashCode() - Method in class + org.iot.dsa.node.DSGroup +
+
 
+
hashCode() - Method in class + org.iot.dsa.node.DSInfo +
+
 
+
hashCode() + - Method in class org.iot.dsa.node.DSInt
+
 
+
hashCode() + - Method in class org.iot.dsa.node.DSJavaEnum
+
 
+
hashCode() - Method in class + org.iot.dsa.node.DSLong +
+
 
+
hashCode() + - Method in class org.iot.dsa.node.DSMap.Entry
+
 
+
hashCode() + - Method in class org.iot.dsa.node.DSMap
+
 
+
hashCode() - Method in class + org.iot.dsa.node.DSStatus +
+
 
+
hashCode() - Method in class + org.iot.dsa.node.DSString +
+
 
+
hashCode() + - Method in class org.iot.dsa.security.DSPasswordAes +
+
 
+
hashCode() - Method + in class org.iot.dsa.security.DSPasswordSha256 +
+
 
+
hashCode() + - Method in class org.iot.dsa.time.DSDateTime
+
 
+
hasNext() + - Method in class org.iot.dsa.node.DSInfo
+
+
True if there is another info after this one.
+
+
houseKeeping() - + Method in class org.iot.dsa.logging.AsyncLogHandler +
+
+
Subclass hook for activities such as rolling files and cleaning up old + garbage. +
+
+
houseKeeping() - + Method in class org.iot.dsa.logging.FileLogHandler +
+
 
+
+ + + +

I

+
+
InboundInvokeRequest + - Interface in org.iot.dsa.dslink.responder +
+
+
See ActionInvocation for the real meat.
+
+
InboundListRequest + - Interface in org.iot.dsa.dslink.responder +
+
+
The details about an incoming list request passed to the responder.
+
+
InboundRequest + - Interface in org.iot.dsa.dslink.responder +
+
+
Common to all incoming requests.
+
+
InboundSetRequest + - Interface in org.iot.dsa.dslink.responder +
+
 
+
InboundSubscribeRequest + - Interface in org.iot.dsa.dslink.responder +
+
+
The details about an incoming subscribe request passed to the responder. +
+
+
indexOf(DSElement) + - Method in class org.iot.dsa.node.DSGroup
+
+
Scans the collection and returns the first index that equal the arg.
+
+
indexOf(String) - + Method in class org.iot.dsa.node.DSMap
+
+
Index of the given key, or -1.
+
+
info() - Method in class + org.iot.dsa.logging.DSLogger
+
+
True if the level is loggable.
+
+
info(Object) - + Method in class org.iot.dsa.logging.DSLogger
+
+
Log an infrequent major lifecycle event.
+
+
info(Object, Throwable) + - Method in class org.iot.dsa.logging.DSLogger +
+
+
Log an infrequent major lifecycle event.
+
+
INFO_TOPIC - Static variable in + class org.iot.dsa.node.DSNode
+
 
+
init(DSLinkConfig) + - Method in class org.iot.dsa.dslink.DSLink
+
+
Configures a link instance including creating the appropriate connection. +
+
+
initCause(Throwable) + - Method in exception org.iot.dsa.util.DSException +
+
 
+
insert(int, DSList...) + - Method in interface org.iot.dsa.node.action.ActionInvocation
+
+
Only use with open tables, insert the rows at the given index.
+
+
INSTANCE + - Static variable in class org.iot.dsa.node.event.DSInfoTopic +
+
+
The only instance of this topic.
+
+
INSTANCE + - Static variable in class org.iot.dsa.node.event.DSValueTopic +
+
+
The only instance of this topic.
+
+
invoke(String, DSMap, OutboundInvokeHandler) + - Method in interface org.iot.dsa.dslink.DSIRequester +
+
+
Submits an invoke request.
+
+
invoke(DSInfo, ActionInvocation) + - Method in class org.iot.dsa.node.action.DSAction +
+
+
Calls onInvoke on the proper node.
+
+
isAction() - Method + in interface org.iot.dsa.dslink.responder.ApiObject
+
+
True if the object is an action.
+
+
isAction() - Method in class + org.iot.dsa.node.DSInfo +
+
 
+
isAdmin() - Method + in interface org.iot.dsa.dslink.responder.ApiObject
+
+
Whether or not this object requires configuration permission to + read/write. +
+
+
isAdmin() + - Method in class org.iot.dsa.node.DSInfo
+
 
+
isBad() - Method in class + org.iot.dsa.node.DSStatus +
+
+
If any of the bad flags are set, or is null.
+
+
isBoolean() - Method in class + org.iot.dsa.node.DSBool +
+
 
+
isBoolean() + - Method in class org.iot.dsa.node.DSElement
+
+
Whether or not the object represents a boolean.
+
+
isBytes() + - Method in class org.iot.dsa.node.DSBytes
+
 
+
isBytes(String) - + Static method in class org.iot.dsa.node.DSBytes
+
+
True if the string starts with the DSA escape sequence for a base 64 + encoded string. +
+
+
isBytes() - Method in class + org.iot.dsa.node.DSElement +
+
+
Whether or not the object represents a byte array.
+
+
isCancelled() + - Method in class org.iot.dsa.DSRuntime.Timer
+
 
+
isClosed() - + Method in enum org.iot.dsa.node.action.ActionSpec.ResultType
+
+
True if CLOSED_TABLE, VOID, or VALUES.
+
+
isConfig() + - Method in enum org.iot.dsa.security.DSPermission +
+
 
+
isConfigFault() + - Method in class org.iot.dsa.node.DSStatus
+
+
True if the associate bit is set.
+
+
isConnected() - + Method in class org.iot.dsa.dslink.DSLinkConnection +
+
+
True when a connection is established with the remote endpoint.
+
+
isDefaultInstance() + - Method in class org.iot.dsa.node.DSNode
+
+
True if this is the default instance for the type.
+
+
isDefaultOnCopy() + - Method in class org.iot.dsa.node.DSInfo
+
+
Whether or not the current value, or the default value is copied.
+
+
isDisabled() + - Method in class org.iot.dsa.node.DSStatus
+
+
True if the associate bit is set.
+
+
isDouble() - Method in class + org.iot.dsa.node.DSDouble +
+
 
+
isDouble() - Method in class + org.iot.dsa.node.DSElement +
+
+
Whether or not the object represents a double.
+
+
isDouble() - Method in class + org.iot.dsa.node.DSFloat +
+
 
+
isDouble() + - Method in class org.iot.dsa.node.DSInt
+
 
+
isDouble() - Method in + interface org.iot.dsa.node.DSINumber
+
+
Whether or not the object represents a double.
+
+
isDown() + - Method in class org.iot.dsa.node.DSStatus
+
+
True if the associate bit is set.
+
+
isDynamic() - Method in class + org.iot.dsa.node.DSInfo +
+
+
Whether or not this info represents a declared default.
+
+
isEmpty() + - Method in class org.iot.dsa.node.DSGroup
+
+
Returns true when childCount() == 0.
+
+
isEmpty() - Method in class + org.iot.dsa.node.DSMetadata +
+
 
+
isEqual(Object) + - Method in class org.iot.dsa.node.action.DSAction +
+
+
Defaults to the equals method.
+
+
isEqual(Object) + - Method in class org.iot.dsa.node.DSElement
+
 
+
isEqual(Object) + - Method in class org.iot.dsa.node.DSFlexEnum
+
 
+
isEqual(Object) - + Method in class org.iot.dsa.node.DSFloat
+
 
+
isEqual(DSInfo) + - Method in class org.iot.dsa.node.DSInfo
+
+
True if the flags and target object are equal (not identical if the target + is a node). +
+
+
isEqual(Object) - + Method in class org.iot.dsa.node.DSInt
+
 
+
isEqual(Object) + - Method in interface org.iot.dsa.node.DSIObject +
+
+
Equals implementation that doesn't require hashCodes to equal, primarily + intended + so for comparing nodes. +
+
+
isEqual(Object) + - Method in class org.iot.dsa.node.DSJavaEnum
+
 
+
isEqual(Object) - + Method in class org.iot.dsa.node.DSNode
+
+
True if the argument is a node with the same children, although their order + can be + different. +
+
+
isEqual(Object) - + Method in class org.iot.dsa.node.DSStatus
+
 
+
isEqual(Object) + - Method in class org.iot.dsa.node.event.DSTopic +
+
+
Only test instance equality.
+
+
isEqual(Object) + - Method in class org.iot.dsa.security.DSPasswordAes +
+
 
+
isEqual(Object) + - Method in class org.iot.dsa.security.DSPasswordSha256 +
+
 
+
isEqual(Object) + - Method in class org.iot.dsa.time.DSDateTime
+
+
Defaults to the equals method.
+
+
isFault() - Method in class + org.iot.dsa.node.DSStatus +
+
+
True if the associate bit is set.
+
+
isFinished() + - Method in class org.iot.dsa.DSRuntime.Timer
+
+
True if cancelled or was a one time execution and that has finished.
+
+
isFixedList(byte) + - Static method in class org.iot.dsa.io.msgpack.MsgpackReader +
+
 
+
isFixedMap(byte) + - Static method in class org.iot.dsa.io.msgpack.MsgpackReader +
+
 
+
isFixInt(byte) - + Static method in class org.iot.dsa.io.msgpack.MsgpackReader +
+
 
+
isFixStr(byte) - + Static method in class org.iot.dsa.io.msgpack.MsgpackReader +
+
 
+
isFloat() - Method in class + org.iot.dsa.node.DSElement +
+
+
Whether or not the object represents a float.
+
+
isFloat() + - Method in class org.iot.dsa.node.DSFloat
+
 
+
isFloat() - Method in class + org.iot.dsa.node.DSInt
+
 
+
isFloat() - Method in interface + org.iot.dsa.node.DSINumber
+
+
Whether or not the object represents a double.
+
+
isGood() + - Method in class org.iot.dsa.node.DSStatus
+
+
If true, any associate object / value can be trusted.
+
+
isGroup() - Method in class + org.iot.dsa.node.DSElement +
+
+
Whether or not the object represents a list or map.
+
+
isGroup() + - Method in class org.iot.dsa.node.DSGroup
+
 
+
isHidden() - Method + in interface org.iot.dsa.dslink.responder.ApiObject
+
+
True if the object should ignored (not be exposed through the api).
+
+
isHidden() - Method in class + org.iot.dsa.node.DSInfo +
+
+
Whether or not an object is visible to clients.
+
+
isIdentical(DSInfo) + - Method in class org.iot.dsa.node.DSInfo
+
+
True if the flags and target object are identical.
+
+
isIdentical(Object) + - Method in class org.iot.dsa.node.DSNode
+
+
True if the argument is a node with the same children in the exact same + order. +
+
+
isInfinite() + - Method in class org.iot.dsa.node.DSDouble
+
 
+
isInt() - Method in class + org.iot.dsa.node.DSElement +
+
+
Whether or not the object represents an int.
+
+
isInt() - Method in class + org.iot.dsa.node.DSFloat +
+
 
+
isInt() - Method in class + org.iot.dsa.node.DSInt
+
 
+
isInt() - Method in interface + org.iot.dsa.node.DSINumber
+
+
Whether or not the object represents an int.
+
+
isList() + - Method in class org.iot.dsa.node.DSElement
+
+
Whether or not the object represents a list.
+
+
isList() - Method in class + org.iot.dsa.node.DSList +
+
+
Returns true.
+
+
isList() + - Method in enum org.iot.dsa.security.DSPermission +
+
 
+
isLong() + - Method in class org.iot.dsa.node.DSElement
+
+
Whether or not the object represents a long.
+
+
isLong() - Method in class + org.iot.dsa.node.DSFloat +
+
 
+
isLong() - Method in class + org.iot.dsa.node.DSInt
+
 
+
isLong() + - Method in interface org.iot.dsa.node.DSINumber +
+
+
Whether or not the object represents a long.
+
+
isLong() - Method in class + org.iot.dsa.node.DSLong +
+
 
+
isMap() - Method in class + org.iot.dsa.node.DSElement +
+
+
Whether or not the object represents a amp.
+
+
isMap() - Method in class + org.iot.dsa.node.DSMap
+
+
Returns true.
+
+
isNaN() - Method in class + org.iot.dsa.node.DSDouble +
+
 
+
isNode() - Method in class + org.iot.dsa.node.DSInfo +
+
+
Whether or not the object is a DSNode.
+
+
isNode(Object) - + Static method in class org.iot.dsa.node.DSNode
+
+
Convenience for instanceof DSNode.
+
+
isNull() + - Method in class org.iot.dsa.node.action.DSAction +
+
+
False
+
+
isNull() - Method in class + org.iot.dsa.node.DSBool +
+
 
+
isNull() - Method in class + org.iot.dsa.node.DSBytes +
+
 
+
isNull() + - Method in class org.iot.dsa.node.DSDouble
+
 
+
isNull() + - Method in class org.iot.dsa.node.DSElement
+
+
Whether or not the object represents null.
+
+
isNull() - Method in class + org.iot.dsa.node.DSFlexEnum +
+
 
+
isNull() - Method in class + org.iot.dsa.node.DSFloat +
+
 
+
isNull(int) - Method in class + org.iot.dsa.node.DSGroup +
+
+
Whether or not the object at the given index is null.
+
+
isNull() - Method in class + org.iot.dsa.node.DSInt
+
 
+
isNull() + - Method in interface org.iot.dsa.node.DSIObject +
+
 
+
isNull() + - Method in interface org.iot.dsa.node.DSIValue +
+
+
Values should have an instance representing null.
+
+
isNull() - Method in class + org.iot.dsa.node.DSJavaEnum +
+
 
+
isNull() - Method in class + org.iot.dsa.node.DSList +
+
+
Returns false.
+
+
isNull() - Method in class + org.iot.dsa.node.DSLong +
+
 
+
isNull() - Method in class + org.iot.dsa.node.DSMap
+
+
Returns false.
+
+
isNull(String) + - Method in class org.iot.dsa.node.DSMap
+
+
Returns true if the key isn't in the map, or it's value is null.
+
+
isNull() - Method in class + org.iot.dsa.node.DSNode +
+
+
Returns false.
+
+
isNull() - Method in class + org.iot.dsa.node.DSNull +
+
+
True
+
+
isNull() + - Method in class org.iot.dsa.node.DSStatus
+
 
+
isNull() - Method in class + org.iot.dsa.node.event.DSTopic
+
+
False
+
+
isNull() + - Method in class org.iot.dsa.security.DSPasswordAes +
+
 
+
isNull() + - Method in class org.iot.dsa.security.DSPasswordSha256 +
+
 
+
isNull() - Method in class + org.iot.dsa.time.DSDateTime +
+
 
+
isNumber() - Method in class + org.iot.dsa.node.DSDouble +
+
 
+
isNumber() - Method in class + org.iot.dsa.node.DSElement +
+
+
Whether or not the object represents a number.
+
+
isNumber() - Method in class + org.iot.dsa.node.DSLong +
+
 
+
isOk() - Method in class + org.iot.dsa.node.DSStatus +
+
 
+
isOpen() - + Method in interface org.iot.dsa.dslink.responder.InboundListRequest
+
+
Whether or not the list stream is still open.
+
+
isOpen() - Method + in interface org.iot.dsa.node.action.ActionInvocation +
+
+
Whether or not response is still open.
+
+
isOpen() - + Method in enum org.iot.dsa.node.action.ActionSpec.ResultType
+
+
True if OPEN_TABLE or STREAM_TABLE
+
+
isOverride() + - Method in class org.iot.dsa.node.DSStatus
+
+
True if the associate bit is set.
+
+
isRead() + - Method in enum org.iot.dsa.security.DSPermission +
+
 
+
isReadOnly() - + Method in interface org.iot.dsa.dslink.responder.ApiObject
+
+
True if the object is a value and cannot be written.
+
+
isReadOnly() + - Method in class org.iot.dsa.node.DSInfo
+
+
Whether or not an object can be written by a client.
+
+
isRemoteConfigFault() + - Method in class org.iot.dsa.node.DSStatus
+
 
+
isRemoteDisabled() + - Method in class org.iot.dsa.node.DSStatus
+
 
+
isRemoteDown() + - Method in class org.iot.dsa.node.DSStatus
+
 
+
isRemoteFault() + - Method in class org.iot.dsa.node.DSStatus
+
 
+
isRemoteOverride() + - Method in class org.iot.dsa.node.DSStatus
+
 
+
isRemoteStale() + - Method in class org.iot.dsa.node.DSStatus
+
 
+
isRemoteUnknown() + - Method in class org.iot.dsa.node.DSStatus
+
 
+
isRequester() + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Looks for the isRequester config, false by default.
+
+
isResponder() + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Looks for the isResponder config, true by default.
+
+
isRunning() + - Method in class org.iot.dsa.DSRuntime.Timer
+
+
True when the runnable is being actually being executed.
+
+
isRunning() - Method in class + org.iot.dsa.node.DSNode +
+
+
A convenience for !isStopped().
+
+
isStable() - Method in class + org.iot.dsa.node.DSNode +
+
+
True after stable is called, children are stable before their parents. +
+
+
isStale() - Method in class + org.iot.dsa.node.DSStatus +
+
 
+
isStarted() - Method in class + org.iot.dsa.node.DSNode +
+
+
True after start is called, children are started before their parents. +
+
+
isStopped() - Method in class + org.iot.dsa.node.DSNode +
+
+
True after stop is called, children are stopped before their parents.
+
+
isStream() - + Method in enum org.iot.dsa.node.action.ActionSpec.ResultType
+
+
True if this is the STREAM_TABLE.
+
+
isStreamOpen() + - Method in interface org.iot.dsa.dslink.requester.OutboundStream
+
+
Whether or not the request is open.
+
+
isString() - Method in class + org.iot.dsa.node.DSElement +
+
+
Whether or not the object represents a string.
+
+
isString() - Method in class + org.iot.dsa.node.DSString +
+
 
+
isSubscribed() + - Method in class org.iot.dsa.node.DSNode
+
+
True if there are any subscribers.
+
+
isSubscribed(DSInfo, DSTopic) + - Method in class org.iot.dsa.node.DSNode
+
+
True if there are any subscriptions with the matching child and topic. +
+
+
isSubscribed(DSTopic) + - Method in class org.iot.dsa.node.DSNode
+
+
True if there any subscriptions for the given topic.
+
+
isTransient() + - Method in class org.iot.dsa.node.DSInfo
+
+
Whether or not an object is persistent.
+
+
isUnknown() + - Method in class org.iot.dsa.node.DSStatus
+
 
+
isValid(DSElement) + - Method in interface org.iot.dsa.security.DSIPassword +
+
+
Returns true if the give element is valid according to the backing + implementation. +
+
+
isValid(DSElement) + - Method in class org.iot.dsa.security.DSPasswordAes +
+
+
Encrypts the string value of the given element and compares against the + value stored in this + object. +
+
+
isValid(String) + - Method in class org.iot.dsa.security.DSPasswordAes +
+
+
Encrypts the given string and compares against the value stored in this + object. +
+
+
isValid(DSElement) + - Method in class org.iot.dsa.security.DSPasswordSha256 +
+
+
Hashes the string value of the given element and compares against the hash + stored in this + object. +
+
+
isValid(String) + - Method in class org.iot.dsa.security.DSPasswordSha256 +
+
+
Hashes the given string and compares against the value stored in this + object. +
+
+
isValue() - Method + in interface org.iot.dsa.dslink.responder.ApiObject
+
+
True if getValue() can be called.
+
+
isValue() + - Method in class org.iot.dsa.node.DSInfo
+
 
+
isValues() - + Method in enum org.iot.dsa.node.action.ActionSpec.ResultType
+
 
+
isVoid() - + Method in enum org.iot.dsa.node.action.ActionSpec.ResultType
+
 
+
isWrite() + - Method in enum org.iot.dsa.security.DSPermission +
+
 
+
isZip() - Method in class + org.iot.dsa.io.json.JsonAppender
+
+
Whether or not this is zipping the output.
+
+
iterateNodes() + - Method in class org.iot.dsa.node.DSNode
+
+
Returns an info iterator of child DSNodes.
+
+
iterateValues() + - Method in class org.iot.dsa.node.DSNode
+
+
Returns an info iterator of child DSIValues.
+
+
iterator() - Method in class + org.iot.dsa.node.DSList +
+
+
Returns an iterator that does not implement remove.
+
+
iterator() - Method in class + org.iot.dsa.node.DSNode +
+
+
Returns an info iterator of all children.
+
+
+ + + +

J

+
+
JsonAppender - Class in org.iot.dsa.io.json
+
+
Json implementation of DSWriter intended for Appendables such as + StringBuilders. +
+
+
JsonAppender() + - Constructor for class org.iot.dsa.io.json.JsonAppender +
+
+
Be sure to call one of the setOutput methods.
+
+
JsonAppender(Appendable) + - Constructor for class org.iot.dsa.io.json.JsonAppender +
+
+
Will write directly to the given appendable.
+
+
JsonAppender(File) + - Constructor for class org.iot.dsa.io.json.JsonAppender +
+
+
Creates an underlying FileWriter.
+
+
JsonAppender(File, String) + - Constructor for class org.iot.dsa.io.json.JsonAppender +
+
+
Will create a zip file using the zipFileName as file name inside the zip. +
+
+
JsonAppender(OutputStream) + - Constructor for class org.iot.dsa.io.json.JsonAppender +
+
+
Creates an underlying OutputStreamWriter.
+
+
JsonAppender(OutputStream, String) + - Constructor for class org.iot.dsa.io.json.JsonAppender +
+
+
Will write a zip file to the given stream.
+
+
JsonConstants + - Interface in org.iot.dsa.io.json
+
+
Useful constants.
+
+
JsonReader - Class in org.iot.dsa.io.json
+
+
Json implementation of DSReader.
+
+
JsonReader() + - Constructor for class org.iot.dsa.io.json.JsonReader +
+
 
+
JsonReader(CharSequence) + - Constructor for class org.iot.dsa.io.json.JsonReader +
+
 
+
JsonReader(File) + - Constructor for class org.iot.dsa.io.json.JsonReader +
+
 
+
JsonReader(InputStream, String) + - Constructor for class org.iot.dsa.io.json.JsonReader +
+
 
+
JsonReader(Reader) + - Constructor for class org.iot.dsa.io.json.JsonReader +
+
 
+
JsonWriter - Class in org.iot.dsa.io.json
+
+
Json implementation of DSWriter intended for OutputStreams and Writers. +
+
+
JsonWriter() + - Constructor for class org.iot.dsa.io.json.JsonWriter +
+
+
Be sure to call one of the setOutput methods.
+
+
JsonWriter(File) + - Constructor for class org.iot.dsa.io.json.JsonWriter +
+
+
Creates an underlying FileWriter.
+
+
JsonWriter(File, String) + - Constructor for class org.iot.dsa.io.json.JsonWriter +
+
+
Will create a zip file using the zipFileName as file name inside the zip. +
+
+
JsonWriter(OutputStream) + - Constructor for class org.iot.dsa.io.json.JsonWriter +
+
+
Creates an underlying OutputStreamWriter.
+
+
JsonWriter(OutputStream, String) + - Constructor for class org.iot.dsa.io.json.JsonWriter +
+
+
Will write a zip file to the given stream.
+
+
JsonWriter(Writer) + - Constructor for class org.iot.dsa.io.json.JsonWriter +
+
 
+
+ + + +

K

+
+
key(CharSequence) + - Method in class org.iot.dsa.io.AbstractWriter
+
 
+
key(CharSequence) + - Method in interface org.iot.dsa.io.DSIWriter
+
+
Write a key in the current map.
+
+
keys - + Variable in class org.iot.dsa.node.DSMap
+
+
For preserving order.
+
+
+ + + +

L

+
+
last() + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
last() - Method in interface + org.iot.dsa.io.DSIReader +
+
+
The last value returned from next().
+
+
last() - Method in class + org.iot.dsa.node.DSGroup +
+
+
Returns the item at the highest index.
+
+
lastIndexOf(DSElement) + - Method in class org.iot.dsa.node.DSGroup
+
+
Scans the collection and returns the first index that equal the arg.
+
+
lastRun() - Method in class + org.iot.dsa.DSRuntime.Timer +
+
+
The lastRun run or -1 if it hasn't run yet.
+
+
length() - Method in class + org.iot.dsa.io.AbstractWriter +
+
+
Returns 0 by default.
+
+
length() - Method in interface + org.iot.dsa.io.DSIWriter +
+
+
If the writer is buffering output, this returns the size of that buffer. +
+
+
length() + - Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
+
Returns the number of bytes in the outgoing byte buffer.
+
+
length() - Method in class + org.iot.dsa.node.DSBytes +
+
+
The number of bytes in the array.
+
+
list(String, OutboundListHandler) + - Method in interface org.iot.dsa.dslink.DSIRequester +
+
+
Submits a list request.
+
+
list - + Variable in class org.iot.dsa.node.DSList
+
 
+
load(DSLinkConfig) + - Static method in class org.iot.dsa.dslink.DSLink +
+
+
Creates a link by first testing for an existing serialized database.
+
+
+ + + +

M

+
+
main(String[]) - + Static method in class org.iot.dsa.dslink.DSLink +
+
+
This is a convenience for DSLink.load(new DSLinkConfig(args)).run() and can + be used as the + the main class for any link. +
+
+
make(boolean) + - Static method in class org.iot.dsa.node.DSElement +
+
+
Creates an DSIObject representation of the primitive.
+
+
make(byte[]) + - Static method in class org.iot.dsa.node.DSElement +
+
+
Creates an DSIObject representation of the primitive.
+
+
make(double) + - Static method in class org.iot.dsa.node.DSElement +
+
+
Creates an DSIObject representation of the primitive.
+
+
make(int) - Static method in + class org.iot.dsa.node.DSElement
+
+
Creates an DSIObject representation of the primitive.
+
+
make(long) - Static method in + class org.iot.dsa.node.DSElement
+
+
Creates an DSIObject representation of the primitive.
+
+
make(String) - + Static method in class org.iot.dsa.node.DSElement +
+
+
Creates an DSIObject representation of the primitive.
+
+
makeBackup() + - Method in class org.iot.dsa.logging.FileLogHandler +
+
+
Only public for testing, do not call.
+
+
makeMessage(Throwable) + - Static method in exception org.iot.dsa.util.DSException +
+
+
Attempts come up with the best description of the argument.
+
+
makeNull() - Static method in + class org.iot.dsa.node.DSElement
+
+
Creates an DSIObject representation of null.
+
+
makeRuntime(Throwable) + - Static method in exception org.iot.dsa.util.DSException +
+
+
If the given exception is already a runtime exception, it is cast and + returned, + otherwise it will be returned wrapped by an instance of this class. +
+
+
map - + Variable in class org.iot.dsa.node.DSMap
+
 
+
MAX_VALUE - Static variable in + class org.iot.dsa.node.DSMetadata
+
 
+
millis() - Method in enum + org.iot.dsa.time.DSInterval +
+
+
The approximate number of ms in the interval.
+
+
MILLIS_DAY - Static variable in + class org.iot.dsa.time.DSTime
+
 
+
MILLIS_FIFTEEN_MINUTES + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_FIFTEEN_SECONDS + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_FIVE_MINUTES + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_FIVE_SECONDS + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_FOUR_HOURS + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_HOUR - Static variable in + class org.iot.dsa.time.DSTime
+
 
+
MILLIS_MINUTE + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_MONTH + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_QUARTER + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_SECOND + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_SIX_HOURS + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_TEN_MINUTES + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_TEN_SECONDS + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_THIRTY_MINUTES + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_THIRTY_SECONDS + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_THREE_HOURS + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_TWELVE_HOURS + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_TWENTY_MINUTES + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_TWO_HOURS + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
MILLIS_WEEK - Static variable in + class org.iot.dsa.time.DSTime
+
 
+
MILLIS_YEAR - Static variable in + class org.iot.dsa.time.DSTime
+
 
+
millisToNanos(long) + - Static method in class org.iot.dsa.time.DSTime
+
 
+
MIN_VALUE - Static variable in + class org.iot.dsa.node.DSMetadata
+
 
+
MsgpackReader - Class in org.iot.dsa.io.msgpack
+
+
MsgPack implementation of DSReader.
+
+
MsgpackReader() + - Constructor for class org.iot.dsa.io.msgpack.MsgpackReader +
+
 
+
MsgpackReader(InputStream) + - Constructor for class org.iot.dsa.io.msgpack.MsgpackReader +
+
 
+
MsgpackWriter - Class in org.iot.dsa.io.msgpack
+
 
+
MsgpackWriter() + - Constructor for class org.iot.dsa.io.msgpack.MsgpackWriter +
+
 
+
MsgpackWriter(ByteBuffer) + - Constructor for class org.iot.dsa.io.msgpack.MsgpackWriter +
+
 
+
+ + + +

N

+
+
NAME + - Static variable in class org.iot.dsa.node.DSMetadata +
+
 
+
NANOS_IN_MS - Static variable in + class org.iot.dsa.time.DSTime
+
 
+
NANOS_IN_SEC + - Static variable in class org.iot.dsa.time.DSTime +
+
 
+
nanosToMillis(long) + - Static method in class org.iot.dsa.time.DSTime
+
 
+
newKeyPair() + - Static method in class org.iot.dsa.security.DSKeys +
+
+
Creates a key pair for the predefined elliptic curve secp256r1.
+
+
newSignature() + - Static method in class org.iot.dsa.security.DSKeys +
+
+
Returns a SHA256withECDSA signature.
+
+
newSigner() + - Method in class org.iot.dsa.security.DSKeys +
+
+
Creates a signer for this private key.
+
+
newVerifier() + - Method in class org.iot.dsa.security.DSKeys +
+
+
Creates a verifier for this public key.
+
+
next() + - Method in class org.iot.dsa.io.AbstractReader
+
+
Subclasses must override this, read the next item from the stream, then + call one of the + setXxx methods. +
+
+
next() - Method in interface + org.iot.dsa.io.DSIReader +
+
+
Advances the reader to the next item and returns the token representing + it's current state. +
+
+
next() + - Method in class org.iot.dsa.io.json.JsonReader +
+
 
+
next() + - Method in class org.iot.dsa.io.msgpack.MsgpackReader +
+
 
+
next() + - Method in class org.iot.dsa.node.DSInfo
+
+
The next info in the parent node.
+
+
next(long) + - Method in enum org.iot.dsa.time.DSInterval
+
+
Returns the nextRun interval for the previously aligned timestamp.
+
+
nextAction() + - Method in class org.iot.dsa.node.DSInfo
+
+
The next DSInfo in the parent that is an action, or null.
+
+
nextNode() - Method in class + org.iot.dsa.node.DSInfo +
+
+
The next DSInfo in the parent that is a node, or null.
+
+
nextRun() - Method in class + org.iot.dsa.DSRuntime.Timer +
+
+
The next scheduled time to run.
+
+
nextValue() - Method in class + org.iot.dsa.node.DSInfo +
+
+
The next DSInfo in the parent that is a value, or null.
+
+
NodeDecoder - Class in org.iot.dsa.io
+
+
Decodes a node (tree) that was encoded with NodeEncoder.
+
+
NodeEncoder - Class in org.iot.dsa.io
+
+
Encodes a node tree using a compact JSON schema.
+
+
NULL - + Static variable in class org.iot.dsa.node.DSBool
+
 
+
NULL - + Static variable in class org.iot.dsa.node.DSBytes +
+
 
+
NULL - + Static variable in class org.iot.dsa.node.DSDouble +
+
 
+
NULL + - Static variable in class org.iot.dsa.node.DSFlexEnum +
+
 
+
NULL - + Static variable in class org.iot.dsa.node.DSFloat +
+
 
+
NULL - + Static variable in class org.iot.dsa.node.DSInt
+
 
+
NULL + - Static variable in class org.iot.dsa.node.DSJavaEnum +
+
 
+
NULL - + Static variable in class org.iot.dsa.node.DSLong
+
 
+
NULL - + Static variable in class org.iot.dsa.node.DSNull
+
 
+
NULL - + Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
NULL - + Static variable in class org.iot.dsa.node.DSString +
+
 
+
NULL + - Static variable in class org.iot.dsa.security.DSPasswordAes +
+
 
+
NULL - Static variable in + class org.iot.dsa.security.DSPasswordSha256
+
 
+
NULL + - Static variable in class org.iot.dsa.time.DSDateTime +
+
 
+
+ + + +

O

+
+
OK - + Static variable in class org.iot.dsa.node.DSStatus +
+
+
Good, no other status applies.
+
+
ok - + Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
OK_OVERRIDE + - Static variable in class org.iot.dsa.node.DSStatus +
+
+
Good, the value is overridden within DSA.
+
+
OK_OVERRIDE_STR + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
OK_REMOTE_OVERRIDE + - Static variable in class org.iot.dsa.node.DSStatus +
+
+
Good, the value is overridden outside of DSA.
+
+
OK_REMOTE_OVERRIDE_STR + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
OK_STR - Static variable in class + org.iot.dsa.node.DSStatus +
+
 
+
okOverride - Static variable in + class org.iot.dsa.node.DSStatus
+
 
+
okRemoteOverride + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
onChildAdded(DSInfo) + - Method in class org.iot.dsa.node.DSNode
+
+
Called when the given child is added and in the stable state.
+
+
onChildChanged(DSInfo) + - Method in class org.iot.dsa.node.DSNode
+
+
Called when the given child is changed and in the stable state.
+
+
onChildChanged(DSInfo) + - Method in class org.iot.dsa.node.DSValueNode
+
+
This fires the NODE_CHANGED topic when the value child changes.
+
+
onChildRemoved(DSInfo) + - Method in class org.iot.dsa.node.DSNode
+
+
Called when the given child is removed and in the stable state.
+
+
onClose() + - Method in interface org.iot.dsa.dslink.requester.OutboundRequestHandler
+
+
Callback for when the request stream is closed, no matter how or by who. +
+
+
onClose() + - Method in class org.iot.dsa.dslink.requester.SimpleRequestHandler
+
+
Does nothing by default.
+
+
onClose() + - Method in interface org.iot.dsa.dslink.responder.OutboundListResponse
+
+
Will be called no matter how the stream is closed.
+
+
onClose(Integer) + - Method in interface org.iot.dsa.dslink.responder.SubscriptionCloseHandler
+
+
Will be called no matter how the subscription is terminated.
+
+
onClose() + - Method in interface org.iot.dsa.node.action.ActionResult
+
+
Always called, whether or not the result is a stream, and no matter who + closes it. +
+
+
onColumns(DSList) + - Method in interface org.iot.dsa.dslink.requester.OutboundInvokeHandler
+
+
Called whenever columns are received.
+
+
onComplete() - + Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
+
Callback, for when the top level container is finished.
+
+
onConnect(DSLinkConnection) + - Method in interface org.iot.dsa.dslink.DSLinkConnection.Listener
+
+
Called asynchronously after the connection with the endpoint is opened. +
+
+
onConnect() + - Method in class org.iot.dsa.dslink.DSLinkConnection +
+
+
Called after onInitialize and before onRun.
+
+
onDisconnect(DSLinkConnection) + - Method in interface org.iot.dsa.dslink.DSLinkConnection.Listener
+
+
Called synchronously after the connection with the endpoint is closed. +
+
+
onDisconnect() - + Method in class org.iot.dsa.dslink.DSLinkConnection +
+
+
Called when this network connection has been closed.
+
+
onError(String, String, String) + - Method in interface org.iot.dsa.dslink.requester.OutboundRequestHandler
+
+
Callback for when an error is received.
+
+
onError(String, String, String) + - Method in class org.iot.dsa.dslink.requester.SimpleRequestHandler
+
+
Does nothing by default.
+
+
onEvent(DSTopic, DSIEvent, DSNode, DSInfo, Object...) + - Method in interface org.iot.dsa.node.event.DSISubscriber
+
+
Subscription callback.
+
+
onInfoChanged(DSInfo) + - Method in class org.iot.dsa.node.DSNode
+
+
Called when the given info is modified and in the stable state.
+
+
onInit(String, DSMap, OutboundStream) + - Method in class org.iot.dsa.dslink.requester.AbstractInvokeHandler
+
+
Sets the fields so they can be access via the corresponding getters.
+
+
onInit(String, OutboundStream) + - Method in class org.iot.dsa.dslink.requester.AbstractListHandler
+
+
Sets the fields so they can be accessed with the corresponding getters. +
+
+
onInit(String, int, OutboundStream) + - Method in class org.iot.dsa.dslink.requester.AbstractSubscribeHandler
+
+
Sets the fields so they can be accessed via the corresponding getters. +
+
+
onInit(String, DSMap, OutboundStream) + - Method in interface org.iot.dsa.dslink.requester.OutboundInvokeHandler
+
+
Called by the requester before returning from the invoke method.
+
+
onInit(String, OutboundStream) + - Method in interface org.iot.dsa.dslink.requester.OutboundListHandler
+
+
Called by the requester before returning from the list method.
+
+
onInit(String, int, OutboundStream) + - Method in interface org.iot.dsa.dslink.requester.OutboundSubscribeHandler
+
+
Called by the requester before returning from the subscribe method.
+
+
onInitialize() - + Method in class org.iot.dsa.dslink.DSLinkConnection +
+
+
Always called before onConnect.
+
+
onInitialized() + - Method in interface org.iot.dsa.dslink.requester.OutboundListHandler
+
+
Called once the initial state of the target has been transmitted.
+
+
onInsert(int, DSList) + - Method in interface org.iot.dsa.dslink.requester.OutboundInvokeHandler
+
+
Called when the given rows should be inserted at the given index.
+
+
onInvoke(InboundInvokeRequest) + - Method in interface org.iot.dsa.dslink.DSIResponder +
+
+
The implementation should quickly create an object for responding to the + request, but do no + processing of it on the calling thread. +
+
+
onInvoke(DSInfo, ActionInvocation) + - Method in class org.iot.dsa.dslink.DSLink
+
+
Handles the save action.
+
+
onInvoke(DSInfo, ActionInvocation) + - Method in class org.iot.dsa.node.DSNode
+
+
Override point, called by the default implementation of DSAction.invoke. +
+
+
onList(InboundListRequest) + - Method in interface org.iot.dsa.dslink.DSIResponder +
+
+
The implementation should quickly create an object for responding to the + request, but do no + processing of it on the calling thread. +
+
+
onMode(OutboundInvokeHandler.Mode) + - Method in interface org.iot.dsa.dslink.requester.OutboundInvokeHandler
+
+
Called whenever a mode is received.
+
+
onRemove(String) + - Method in interface org.iot.dsa.dslink.requester.OutboundListHandler
+
+
Only called after onOpen(), indicates something about the target of the + request has been + removed. +
+
+
onReplace(int, int, DSList) + - Method in interface org.iot.dsa.dslink.requester.OutboundInvokeHandler
+
+
The rows starting and ending with the given indexes should be removed and + the given rows + inserted at the start index. +
+
+
onRun() + - Method in class org.iot.dsa.dslink.DSLinkConnection +
+
+
The long term management of the connection (reading and writing).
+
+
onSet(InboundSetRequest) + - Method in interface org.iot.dsa.dslink.DSIResponder +
+
+
The implementation should do no processing of it on the calling thread. +
+
+
onSet(DSInfo, DSIValue) + - Method in class org.iot.dsa.node.DSNode
+
+
Override point, called when a value being set.
+
+
onSet(DSIValue) + - Method in class org.iot.dsa.node.DSNode
+
+
Override point, called only when a DSNode subclass implements DSIValue is + being set. +
+
+
onSet(DSIValue) + - Method in class org.iot.dsa.node.DSValueNode
+
 
+
onStable() + - Method in class org.iot.dsa.dslink.DSLinkConnection +
+
+
Starts the connection.
+
+
onStable() - Method in class + org.iot.dsa.node.DSNode +
+
+
Called once this node is stable, but before stable is called on children. +
+
+
onStarted() - Method in class + org.iot.dsa.node.DSNode +
+
+
Called once this node and its entire subtree is started.
+
+
onStopped() + - Method in class org.iot.dsa.dslink.DSLink
+
 
+
onStopped() - Method in class + org.iot.dsa.node.DSNode +
+
+
Called once this node and its entire subtree is stopped.
+
+
onSubscribe(InboundSubscribeRequest) + - Method in interface org.iot.dsa.dslink.DSIResponder +
+
+
The implementation should quickly create an object for responding to the + request, but do no + processing of it on the calling thread. +
+
+
onSubscribe(DSTopic, DSInfo, DSISubscriber) + - Method in class org.iot.dsa.node.DSNode
+
+
Called for every subscription.
+
+
onSubscribed() + - Method in class org.iot.dsa.node.DSNode
+
+
Called when this node transitions from having no subscriptions to having a + subscription of + any kind. +
+
+
onSubscribed(DSTopic, DSInfo) + - Method in class org.iot.dsa.node.DSNode
+
+
Called when the child and topic pair transitions from having no + subscriptions to have a + subscription. +
+
+
onTableMeta(DSMap) + - Method in interface org.iot.dsa.dslink.requester.OutboundInvokeHandler
+
+
Called whenever metadata for the entire table is received.
+
+
onUnsubscribe(DSTopic, DSInfo, DSISubscriber) + - Method in class org.iot.dsa.node.DSNode
+
+
Called for every unsubscribe.
+
+
onUnsubscribed() + - Method in class org.iot.dsa.node.DSNode
+
+
Called when this node transitions to having no subscriptions of any kind. +
+
+
onUnsubscribed(DSTopic, DSInfo) + - Method in class org.iot.dsa.node.DSNode
+
+
Called when the child and topic pair transitions to having no + subscriptions. +
+
+
onUnsubscribed(DSTopic, DSNode, DSInfo) + - Method in interface org.iot.dsa.node.event.DSISubscriber
+
+
Called no matter how the unsubscribe happens, whether explicitly or if the + node + unsubscribes itself. +
+
+
onUpdate(DSList) + - Method in interface org.iot.dsa.dslink.requester.OutboundInvokeHandler
+
+
Called for every row.
+
+
onUpdate(String, DSElement) + - Method in interface org.iot.dsa.dslink.requester.OutboundListHandler
+
+
Called to provide a value for node metadata, attribute or child.
+
+
onUpdate(DSDateTime, DSElement, DSStatus) + - Method in interface org.iot.dsa.dslink.requester.OutboundSubscribeHandler
+
+
Subscription update mechanism.
+
+
org.iot.dsa - package org.iot.dsa
+
+
Use the DSRuntime thread pool and timers.
+
+
org.iot.dsa.dslink - package + org.iot.dsa.dslink +
+
+
DSLink is the main entry point for an application.
+
+
org.iot.dsa.dslink.requester + - package org.iot.dsa.dslink.requester +
+
+
API for implementing requesters without having to modeling everything in + the node tree. +
+
+
org.iot.dsa.dslink.responder + - package org.iot.dsa.dslink.responder +
+
+
API for implementing responders without having modeling everything in the + node tree. +
+
+
org.iot.dsa.io - package org.iot.dsa.io +
+
+
Node serialization and streaming abstraction for JSON and MsgPack.
+
+
org.iot.dsa.io.json - package + org.iot.dsa.io.json +
+
 
+
org.iot.dsa.io.msgpack - package + org.iot.dsa.io.msgpack +
+
 
+
org.iot.dsa.logging - package + org.iot.dsa.logging +
+
+
Async handler for Java Util Logging that also manages log backups.
+
+
org.iot.dsa.node - package + org.iot.dsa.node +
+
+
Persistent data model used to build the node tree of a link.
+
+
org.iot.dsa.node.action - package + org.iot.dsa.node.action +
+
 
+
org.iot.dsa.node.event - package + org.iot.dsa.node.event +
+
 
+
org.iot.dsa.security - package + org.iot.dsa.security +
+
 
+
org.iot.dsa.time - package + org.iot.dsa.time +
+
 
+
org.iot.dsa.util - package + org.iot.dsa.util +
+
 
+
OutboundInvokeHandler + - Interface in org.iot.dsa.dslink.requester +
+
+
Callback mechanism passed to the invoke method on DSIRequester.
+
+
OutboundInvokeHandler.Mode + - Enum in org.iot.dsa.dslink.requester +
+
 
+
OutboundListHandler + - Interface in org.iot.dsa.dslink.requester +
+
+
Callback mechanism passed to the list method on DSIRequester.
+
+
OutboundListResponse + - Interface in org.iot.dsa.dslink.responder +
+
+
The responder is responsible for returning this upon notification of a list + request. +
+
+
OutboundRequestHandler + - Interface in org.iot.dsa.dslink.requester +
+
+
Callbacks common to all outbound requests.
+
+
OutboundStream + - Interface in org.iot.dsa.dslink.requester +
+
+
Mechanism for the requester to close outbound requests.
+
+
OutboundSubscribeHandler + - Interface in org.iot.dsa.dslink.requester +
+
+
Callback mechanism passed to the subscribe method in the requester.
+
+
+ + + +

P

+
+
parse(String[]) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Parses command line args to set the internal state of this object.
+
+
PLACEHOLDER + - Static variable in class org.iot.dsa.node.DSMetadata +
+
 
+
prepareParameter(DSInfo, DSMap) + - Method in class org.iot.dsa.node.action.DSAction +
+
+
Override point, called for each parameter as it is being sent to the + requester. +
+
+
prettyPrint + - Variable in class org.iot.dsa.io.AbstractWriter
+
+
Subclasses can use this if applicable.
+
+
printStackTrace() + - Method in exception org.iot.dsa.util.DSException +
+
 
+
printStackTrace(PrintStream) + - Method in exception org.iot.dsa.util.DSException +
+
 
+
printStackTrace(PrintWriter) + - Method in exception org.iot.dsa.util.DSException +
+
 
+
PrintStreamLogHandler - Class in org.iot.dsa.logging
+
+
Async logging handler for writing to streams such as System.out.
+
+
PrintStreamLogHandler(String, PrintStream) + - Constructor for class org.iot.dsa.logging.PrintStreamLogHandler
+
 
+
publish(LogRecord) + - Method in class org.iot.dsa.logging.AsyncLogHandler +
+
+
Enqueues the record for the write thread.
+
+
put(int, DSElement) + - Method in class org.iot.dsa.node.DSList
+
+
Replaces a value and returns this.
+
+
put(int, boolean) + - Method in class org.iot.dsa.node.DSList
+
+
Primitive setter, returns this.
+
+
put(int, double) + - Method in class org.iot.dsa.node.DSList
+
+
Primitive setter, returns this.
+
+
put(int, int) + - Method in class org.iot.dsa.node.DSList
+
+
Primitive setter, returns this.
+
+
put(int, long) + - Method in class org.iot.dsa.node.DSList
+
+
Primitive setter, returns this.
+
+
put(int, String) - + Method in class org.iot.dsa.node.DSList
+
+
Primitive setter, returns this.
+
+
put(String, DSElement) + - Method in class org.iot.dsa.node.DSMap
+
+
Adds or replaces the value for the given key and returns this.
+
+
put(String, boolean) + - Method in class org.iot.dsa.node.DSMap
+
+
Primitive setter, returns this.
+
+
put(String, double) + - Method in class org.iot.dsa.node.DSMap
+
+
Primitive setter, returns this.
+
+
put(String, int) - + Method in class org.iot.dsa.node.DSMap
+
+
Primitive setter, returns this.
+
+
put(String, long) - + Method in class org.iot.dsa.node.DSMap
+
+
Primitive setter, returns this.
+
+
put(String, String) + - Method in class org.iot.dsa.node.DSMap
+
+
Primitive setter, returns this.
+
+
put(String, Throwable) + - Method in class org.iot.dsa.node.DSMap
+
+
Puts a String representing the stack trace into the map.
+
+
put(String, DSIObject) + - Method in class org.iot.dsa.node.DSNode
+
+
Adds or replaces the named child.
+
+
put(String, boolean) + - Method in class org.iot.dsa.node.DSNode
+
+
A convenience for put(String, DSIObject)
+
+
put(String, double) + - Method in class org.iot.dsa.node.DSNode
+
+
A convenience for put(String, DSIObject)
+
+
put(String, float) + - Method in class org.iot.dsa.node.DSNode
+
+
A convenience for put(String, DSIObject)
+
+
put(String, int) - + Method in class org.iot.dsa.node.DSNode
+
+
A convenience for put(String, DSIObject)
+
+
put(String, long) + - Method in class org.iot.dsa.node.DSNode
+
+
A convenience for put(String, DSIObject)
+
+
put(String, String) + - Method in class org.iot.dsa.node.DSNode
+
+
A convenience for put(String, DSIObject)
+
+
put(DSInfo, DSIObject) + - Method in class org.iot.dsa.node.DSNode
+
+
Replaces the child.
+
+
putAll(DSMap) - + Method in class org.iot.dsa.node.DSMap
+
+
Adds / overwrites entries in this map with those from the given.
+
+
putList(String) - + Method in class org.iot.dsa.node.DSMap
+
+
Puts a new list for given key and returns it.
+
+
putMap(String) + - Method in class org.iot.dsa.node.DSMap
+
+
Puts a new map for given key and returns it.
+
+
putNull(String) - + Method in class org.iot.dsa.node.DSMap
+
+
Puts a null value for given key and returns this.
+
+
+ + + +

R

+
+
readDouble(byte[], int, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Reads the primitive from a byte array.
+
+
readDouble(InputStream, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Reads the primitive from a stream.
+
+
readFloat(byte[], int, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Reads the primitive from a byte array.
+
+
readFloat(InputStream, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Reads the primitive a stream
+
+
readInt(byte[], int, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Reads the primitive from a byte array.
+
+
readInt(InputStream, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Reads the primitive from a stream.
+
+
readLong(byte[], int, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Reads the primitive from a byte array.
+
+
readLong(InputStream, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Reads the primitive from a stream.
+
+
readShort(byte[], int, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Reads the primitive from a byte array.
+
+
readShort(InputStream, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Reads the primitive from a stream.
+
+
recycle(Calendar) + - Static method in class org.iot.dsa.time.DSTime
+
+
Return a calendar instance for reuse.
+
+
registerDecoder(Class, DSIValue) + - Static method in class org.iot.dsa.node.DSRegistry +
+
+
DSIValues must provide an instance for decoding.
+
+
REMOTE_CONFIG_FAULT + - Static variable in class org.iot.dsa.node.DSStatus +
+
+
Bad, a configuration error is being reported by the foreign system.
+
+
REMOTE_CONFIG_FAULT_STR + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
REMOTE_DISABLED + - Static variable in class org.iot.dsa.node.DSStatus +
+
+
Bad, the foreign system is reporting the object is disabled.
+
+
REMOTE_DISABLED_STR + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
REMOTE_DOWN + - Static variable in class org.iot.dsa.node.DSStatus +
+
+
Bad, down communications are being reported by the foreign system.
+
+
REMOTE_DOWN_STR + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
REMOTE_FAULT + - Static variable in class org.iot.dsa.node.DSStatus +
+
+
Bad, an operational error is being reported by the foreign system.
+
+
REMOTE_FAULT_STR + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
REMOTE_STALE + - Static variable in class org.iot.dsa.node.DSStatus +
+
+
Bad, a stale value is being reported by the foreign system.
+
+
REMOTE_STALE_STR + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
REMOTE_UNKNOWN + - Static variable in class org.iot.dsa.node.DSStatus +
+
+
Bad, the foreign system is reporting the status is unknown.
+
+
REMOTE_UNKNOWN_STR + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
remoteConfigFault + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
remoteDisabled + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
remoteDown - Static variable in + class org.iot.dsa.node.DSStatus
+
 
+
remoteFault + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
remoteStale + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
remoteUnknown + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
remove(String, OutboundRequestHandler) + - Method in interface org.iot.dsa.dslink.DSIRequester +
+
+
Submits request to remove an attribute.
+
+
remove(int) - Method in class + org.iot.dsa.node.DSGroup +
+
+
Removes the value at the given index and returns it.
+
+
remove(int) - Method in class + org.iot.dsa.node.DSList +
+
 
+
remove(int) - Method in class + org.iot.dsa.node.DSMap
+
 
+
remove(String) + - Method in class org.iot.dsa.node.DSMap
+
+
Removes the key-value pair and returns the removed value.
+
+
remove(DSInfo) + - Method in class org.iot.dsa.node.DSNode
+
+
Removes the child.
+
+
remove(String) - + Method in class org.iot.dsa.node.DSNode
+
+
Remove the named child if it is contained.
+
+
removeFirst() + - Method in class org.iot.dsa.node.DSGroup
+
+
Remove and return the item at index 0.
+
+
removeLast() + - Method in class org.iot.dsa.node.DSGroup
+
+
Remove and return the item at the highest index.
+
+
removeListener(DSLinkConnection.Listener) + - Method in class org.iot.dsa.dslink.DSLinkConnection +
+
+
Removes a listener for connection events.
+
+
replace(int, int, DSList...) + - Method in interface org.iot.dsa.node.action.ActionInvocation
+
+
Only use with open tables, deletes len rows starting at the given index, + then inserts the + given rows in their place. +
+
+
reset() - Method in class + org.iot.dsa.io.AbstractReader +
+
 
+
reset() - Method in class + org.iot.dsa.io.AbstractWriter +
+
 
+
reset() - Method in interface + org.iot.dsa.io.DSIReader +
+
+
Sets last() == ROOT.
+
+
reset() - Method in interface + org.iot.dsa.io.DSIWriter +
+
+
Clears the state of the writer.
+
+
reset() - Method in class + org.iot.dsa.io.json.JsonAppender
+
 
+
reset() - Method in class + org.iot.dsa.io.json.JsonReader
+
 
+
reset() - Method in class + org.iot.dsa.io.json.JsonWriter
+
 
+
reset() + - Method in class org.iot.dsa.io.msgpack.MsgpackReader +
+
 
+
reset() + - Method in class org.iot.dsa.security.DSKeys.Signer +
+
+
Call to begin a new signature.
+
+
reset() + - Method in class org.iot.dsa.security.DSKeys.Verifier +
+
+
Call to begin a new signature.
+
+
restore(DSElement) + - Method in class org.iot.dsa.node.DSFlexEnum
+
 
+
restore(DSElement) + - Method in interface org.iot.dsa.node.DSIStorable +
+
+
Deserialize a value from the configuration database, these will be values + returned from the + store() method. +
+
+
restore(DSElement) + - Method in class org.iot.dsa.node.DSJavaEnum
+
 
+
restore(DSElement) + - Method in class org.iot.dsa.node.DSStatus
+
 
+
restore(File) - + Static method in class org.iot.dsa.security.DSKeys +
+
+
Decodes a key pair that was encoded by the store method.
+
+
restore(InputStream) + - Static method in class org.iot.dsa.security.DSKeys +
+
+
Decodes a key pair that was encoded by the store method, does not onClose + the given stream. +
+
+
restore(DSElement) + - Method in class org.iot.dsa.security.DSPasswordAes +
+
 
+
restore(DSElement) + - Method in class org.iot.dsa.security.DSPasswordSha256 +
+
 
+
run() + - Method in class org.iot.dsa.dslink.DSLink
+
+
Calls starts, waits the stableDelay, then calls stable.
+
+
run(Runnable) + - Static method in class org.iot.dsa.DSRuntime
+
+
Run as soon as possible on the application's thread pool and run only + once. +
+
+
run(Runnable, long, long) + - Static method in class org.iot.dsa.DSRuntime
+
+
Run periodically starting at the given time and repeat at the given + millisecond interval. +
+
+
run() - Method in class + org.iot.dsa.DSRuntime.Timer +
+
+
Do not call.
+
+
runAt(Runnable, long) + - Static method in class org.iot.dsa.DSRuntime
+
+
Run once at the given time.
+
+
runCount() + - Method in class org.iot.dsa.DSRuntime.Timer
+
+
The number of completed runs.
+
+
runDelayed(Runnable, long) + - Static method in class org.iot.dsa.DSRuntime
+
+
Run once after the given delay.
+
+
+ + + +

S

+
+
save() - Method in class + org.iot.dsa.dslink.DSLink
+
+
Serializes the configuration database.
+
+
send(DSList) + - Method in interface org.iot.dsa.node.action.ActionInvocation
+
+
Only use with stream and open tables.
+
+
set(String, DSIValue, OutboundRequestHandler) + - Method in interface org.iot.dsa.dslink.DSIRequester +
+
+
Submits a set request.
+
+
set(String, DSElement) + - Method in class org.iot.dsa.node.DSMetadata
+
+
Set arbitrary keys.
+
+
setAdmin(boolean) + - Method in class org.iot.dsa.node.DSInfo
+
 
+
setBackupThreshold(int) + - Method in class org.iot.dsa.logging.FileLogHandler +
+
+
The file size threshold after which a logging file will be backed up and + cleared. +
+
+
setBeginList() + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
setBeginMap() + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
setBit(int, int, boolean) + - Static method in class org.iot.dsa.util.DSUtil
+
+
Set or unset a bit at the given index.
+
+
setBooleanRange(DSList) + - Method in class org.iot.dsa.node.DSMetadata
+
+
The list must be size 2 and the entries must not be null.
+
+
setBooleanRange(String, String) + - Method in class org.iot.dsa.node.DSMetadata
+
+
The parameters can be null, which will result in the default text + (false/true). +
+
+
setBrokerUri(String) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
 
+
setConfig(String, boolean) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Modifies the in-memory representation of dslink.json, but it will not be + saved back to disk. +
+
+
setConfig(String, double) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Modifies the in-memory representation of dslink.json, but it will not be + saved back to disk. +
+
+
setConfig(String, int) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Modifies the in-memory representation of dslink.json, but it will not be + saved back to disk. +
+
+
setConfig(String, long) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Modifies the in-memory representation of dslink.json, but it will not be + saved back to disk. +
+
+
setConfig(String, String) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Modifies the in-memory representation of dslink.json, but it will not be + saved back to disk. +
+
+
setDecimalPlaces(DSLong) + - Method in class org.iot.dsa.node.DSMetadata
+
 
+
setDefault(DSIValue) + - Method in class org.iot.dsa.node.DSMetadata
+
+
Sets the default value only, does not set type information.
+
+
setDefaultLevel(Level) + - Static method in class org.iot.dsa.logging.DSLogging +
+
 
+
setDescription(String) + - Method in class org.iot.dsa.node.DSMetadata
+
 
+
setDetail(String) + - Method in exception org.iot.dsa.dslink.DSRequestException +
+
+
Overrides the default detail which is the stack trace of this exception. +
+
+
setDetail(Throwable) + - Method in exception org.iot.dsa.dslink.DSRequestException +
+
+
Overrides the default detail which is the stack trace of this exception. +
+
+
setDisplayName(String) + - Method in class org.iot.dsa.node.DSMetadata
+
 
+
setDslinkJson(DSMap) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Directly set the map without using file io.
+
+
setDslinkJson(File) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Sets the link map by file path.
+
+
setEditor(String) + - Method in class org.iot.dsa.node.DSMetadata
+
+
See the EDITOR_ constants.
+
+
setEndInput() + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
setEndList() + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
setEndMap() + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
setEnumRange(DSList) + - Method in class org.iot.dsa.node.DSMetadata
+
+
List of string values for an enum or string.
+
+
setEnumRange(String...) + - Method in class org.iot.dsa.node.DSMetadata
+
+
List of string values for an enum or string.
+
+
setHidden(boolean) + - Method in class org.iot.dsa.node.DSInfo
+
 
+
setInput(CharSequence) + - Method in class org.iot.dsa.io.json.JsonReader +
+
+
Sets the input source, resets to ROOT, and returns this.
+
+
setInput(File) + - Method in class org.iot.dsa.io.json.JsonReader +
+
+
Sets the input source, resets to ROOT, and returns this.
+
+
setInput(InputStream, String) + - Method in class org.iot.dsa.io.json.JsonReader +
+
+
Sets the input source, resets to ROOT, and returns this.
+
+
setInput(Reader) + - Method in class org.iot.dsa.io.json.JsonReader +
+
+
Sets the input source, resets to ROOT, and returns this.
+
+
setInput(InputStream) + - Method in class org.iot.dsa.io.msgpack.MsgpackReader +
+
+
Sets the input source, resets to ROOT, and returns this.
+
+
setKeys(DSKeys) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Directly set the keys without using file io.
+
+
setKeys(File) - + Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Sets the link keys by file path.
+
+
setLinkName(String) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Overrides dslink.json.
+
+
setLogFile(File) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Overrides dslink.json.
+
+
setLogLevel(String) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Should be one of the following (case insensitive): all, finest, finer, + fine, config, info, + warning, severe, off. +
+
+
setLogLevel(Level) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Overrides dslink.json.
+
+
setMainType(Class) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
The type of the root node.
+
+
setMap(DSMap) + - Method in class org.iot.dsa.node.DSMetadata
+
+
Change the underlying map so the metadata instance can be reused.
+
+
setMaxBackups(int) + - Method in class org.iot.dsa.logging.FileLogHandler +
+
+
The default is 10.
+
+
setMaxQueueSize(int) + - Method in class org.iot.dsa.logging.AsyncLogHandler +
+
 
+
setMaxValue(DSElement) + - Method in class org.iot.dsa.node.DSMetadata
+
+
The arg should be a number.
+
+
setMinValue(DSElement) + - Method in class org.iot.dsa.node.DSMetadata
+
+
The arg should be a number.
+
+
setName(String) + - Method in class org.iot.dsa.node.DSMetadata
+
 
+
setNextValue(boolean) + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
setNextValue(byte[]) + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
setNextValue(double) + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
setNextValue(long) - + Method in class org.iot.dsa.io.AbstractReader
+
 
+
setNextValue(String) + - Method in class org.iot.dsa.io.AbstractReader
+
 
+
setNextValueNull() - + Method in class org.iot.dsa.io.AbstractReader
+
 
+
setNodes(DSMainNode) + - Method in class org.iot.dsa.dslink.DSLink
+
 
+
setNodesFile(File) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Overrides dslink.json.
+
+
setOut(PrintStream) + - Method in class org.iot.dsa.logging.AsyncLogHandler +
+
+
Sets the sink for formatted messages.
+
+
setOutput(Appendable) + - Method in class org.iot.dsa.io.json.JsonAppender +
+
+
Sets the sink, resets the state and returns this.
+
+
setOutput(File) + - Method in class org.iot.dsa.io.json.JsonAppender +
+
+
Sets the sink, resets the state and returns this.
+
+
setOutput(File, String) + - Method in class org.iot.dsa.io.json.JsonAppender +
+
+
Will create a zip file using the zipFileName as file name inside the zip. +
+
+
setOutput(OutputStream) + - Method in class org.iot.dsa.io.json.JsonAppender +
+
+
Sets the sink, resets the state and returns this.
+
+
setOutput(OutputStream, String) + - Method in class org.iot.dsa.io.json.JsonAppender +
+
+
Will write a zip file to the given stream.
+
+
setOutput(File) + - Method in class org.iot.dsa.io.json.JsonWriter +
+
+
Sets the sink, resets the state and returns this.
+
+
setOutput(File, String) + - Method in class org.iot.dsa.io.json.JsonWriter +
+
+
Will create a zip file using the zipFileName as file name inside the zip. +
+
+
setOutput(OutputStream) + - Method in class org.iot.dsa.io.json.JsonWriter +
+
+
Sets the sink, resets the state and returns this.
+
+
setOutput(OutputStream, String) + - Method in class org.iot.dsa.io.json.JsonWriter +
+
+
Will write a zip file to the given stream.
+
+
setOutput(Writer) + - Method in class org.iot.dsa.io.json.JsonWriter +
+
+
Sets the sink, resets the state and returns this.
+
+
setPermission(DSPermission) + - Method in class org.iot.dsa.node.action.DSAction +
+
+
Returns this, it is not necessary to set the permission to read.
+
+
setPlaceHolder(String) + - Method in class org.iot.dsa.node.DSMetadata
+
+
Place holder text for text fields.
+
+
setPrettyPrint(boolean) + - Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
setReadOnly(boolean) + - Method in class org.iot.dsa.node.DSInfo
+
 
+
setRequester(boolean) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Overrides dslink.json.
+
+
setResponder(boolean) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Overrides dslink.json.
+
+
setResultType(ActionSpec.ResultType) + - Method in class org.iot.dsa.node.action.DSAction +
+
+
Returns this, it is not necessary to set the result to void.
+
+
setSaveEnabled(boolean) + - Method in class org.iot.dsa.dslink.DSLink
+
+
This is a transient option intended for unit tests.
+
+
setSkipMissedIntervals(boolean) + - Method in class org.iot.dsa.DSRuntime.Timer
+
+
The default is true, set this to false if all intervals should be run, even + if they run + later than scheduled. +
+
+
setToken(String) + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Overrides dslink.json.
+
+
setTransient(boolean) + - Method in class org.iot.dsa.node.DSInfo
+
 
+
setType(DSIValue) + - Method in class org.iot.dsa.node.DSMetadata
+
+
Sets the type and if the given is an enum, sets the enum range as well. +
+
+
setType(DSValueType) + - Method in class org.iot.dsa.node.DSMetadata
+
+
The type for action parameters, can be used to override types in the + responder api. +
+
+
setUnit(String) + - Method in class org.iot.dsa.node.DSMetadata
+
+
The unit identifier.
+
+
severe() - Method in class + org.iot.dsa.logging.DSLogger
+
+
True if the level is loggable.
+
+
severe(Object) + - Method in class org.iot.dsa.logging.DSLogger +
+
 
+
severe(Object, Throwable) + - Method in class org.iot.dsa.logging.DSLogger +
+
 
+
shouldEncode(int) + - Static method in class org.iot.dsa.node.DSPath
+
+
Returns true for characters that should be encoded.
+
+
shutdown() - Method in class + org.iot.dsa.dslink.DSLink
+
+
Properly shuts down the link when a thread is executing the run method. +
+
+
sign(byte[], int, int) + - Method in class org.iot.dsa.security.DSKeys +
+
+
A convenience that creates a signer and signs the given bytes.
+
+
Signer(PrivateKey) + - Constructor for class org.iot.dsa.security.DSKeys.Signer +
+
 
+
SimpleRequestHandler + - Class in org.iot.dsa.dslink.requester +
+
+
Empty callback implementations.
+
+
SimpleRequestHandler() + - Constructor for class org.iot.dsa.dslink.requester.SimpleRequestHandler
+
 
+
size() - Method in class + org.iot.dsa.node.DSGroup +
+
+
The number of items is the group.
+
+
size() + - Method in class org.iot.dsa.node.DSList
+
 
+
size() + - Method in class org.iot.dsa.node.DSMap
+
 
+
splitPath(String) + - Static method in class org.iot.dsa.node.DSPath
+
+
Splits the path, but does not decode any names.
+
+
stable() - Method in class + org.iot.dsa.node.DSNode +
+
+
Called after the entire subtree is started.
+
+
STALE + - Static variable in class org.iot.dsa.node.DSStatus +
+
+
Bad, the value hasn't updated in a reasonable amount of time (user + configurable on a per + point basis) within DSA. +
+
+
stale + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
STALE_STR - Static variable in + class org.iot.dsa.node.DSStatus
+
 
+
start() + - Method in class org.iot.dsa.logging.AsyncLogHandler +
+
+
This must be called for the handler to actually do anything.
+
+
start() - Method in class + org.iot.dsa.node.DSNode +
+
+
Sets the state to starting.
+
+
stop() + - Method in class org.iot.dsa.node.DSNode
+
+
Sets the state to stopped.
+
+
store() + - Method in class org.iot.dsa.node.DSFlexEnum
+
 
+
store() + - Method in interface org.iot.dsa.node.DSIStorable +
+
+
Serialize the value for the configuration database.
+
+
store() + - Method in class org.iot.dsa.node.DSJavaEnum
+
 
+
store() - Method in class + org.iot.dsa.node.DSStatus +
+
 
+
store(File) + - Method in class org.iot.dsa.security.DSKeys +
+
+
Write the bytes from the string encoding to the given file.
+
+
store(OutputStream) + - Method in class org.iot.dsa.security.DSKeys +
+
+
Writes the bytes from the string encoding to the given stream, does not + onClose the stream. +
+
+
store() + - Method in class org.iot.dsa.security.DSPasswordAes +
+
 
+
store() + - Method in class org.iot.dsa.security.DSPasswordSha256 +
+
 
+
subscribe(String, int, OutboundSubscribeHandler) + - Method in interface org.iot.dsa.dslink.DSIRequester +
+
+
Submits a subscribe request.
+
+
subscribe(DSTopic, DSInfo, DSISubscriber) + - Method in class org.iot.dsa.node.DSNode
+
+
Subscribes the child and topic.
+
+
SubscriptionCloseHandler + - Interface in org.iot.dsa.dslink.responder +
+
+
The responder returns this from the subscription request notification + method so the link can + notify the responder whenever a subscription is terminated. +
+
+
+ + + +

T

+
+
throwRuntime(Throwable) + - Static method in exception org.iot.dsa.util.DSException +
+
+
If the given exception is already a runtime exception, it is rethrown, + otherwise + it will be thrown wrapped by an instance of this class. +
+
+
timeInMillis() + - Method in class org.iot.dsa.time.DSDateTime
+
+
The Java time represented by this object.
+
+
toBoolean() - Method in class + org.iot.dsa.node.DSBool +
+
 
+
toBoolean() + - Method in class org.iot.dsa.node.DSDouble
+
 
+
toBoolean() + - Method in class org.iot.dsa.node.DSElement
+
+
Attempts to return a boolean value.
+
+
toBoolean() + - Method in interface org.iot.dsa.node.DSIBoolean +
+
 
+
toBoolean() - Method in class + org.iot.dsa.node.DSLong +
+
 
+
toBoolean() + - Method in class org.iot.dsa.node.DSString
+
 
+
toBytes() + - Method in class org.iot.dsa.node.DSBytes
+
 
+
toBytes() - Method in class + org.iot.dsa.node.DSElement +
+
+
Returns the raw byte array for DSBytes only, which should not be + modified. +
+
+
toDouble() - Method in class + org.iot.dsa.node.DSBool +
+
+
0 or 1.
+
+
toDouble() - Method in class + org.iot.dsa.node.DSDouble +
+
 
+
toDouble() - Method in class + org.iot.dsa.node.DSElement +
+
+
Attempts to return a double value.
+
+
toDouble() - Method in class + org.iot.dsa.node.DSFloat +
+
 
+
toDouble() + - Method in class org.iot.dsa.node.DSInt
+
 
+
toDouble() - Method in + interface org.iot.dsa.node.DSINumber
+
+
If not a double, will cast the underlying value.
+
+
toDouble() - Method in class + org.iot.dsa.node.DSLong +
+
 
+
toElement() + - Method in class org.iot.dsa.node.DSElement
+
+
Returns this.
+
+
toElement() + - Method in class org.iot.dsa.node.DSFlexEnum
+
 
+
toElement() - Method in class + org.iot.dsa.node.DSFloat +
+
 
+
toElement() - Method in class + org.iot.dsa.node.DSInt
+
 
+
toElement() + - Method in interface org.iot.dsa.node.DSIValue +
+
+
The current value should convert itself to an element for DSA interop such + as subscription + updates, and setting requests. +
+
+
toElement() + - Method in class org.iot.dsa.node.DSJavaEnum
+
 
+
toElement() - Method in class + org.iot.dsa.node.DSList +
+
 
+
toElement() - Method in class + org.iot.dsa.node.DSMap
+
 
+
toElement() - Method in class + org.iot.dsa.node.DSNull +
+
+
Returns this.
+
+
toElement() + - Method in class org.iot.dsa.node.DSStatus
+
 
+
toElement() + - Method in class org.iot.dsa.node.DSValueNode
+
 
+
toElement() + - Method in class org.iot.dsa.security.DSPasswordAes +
+
+
Returns a string representing the url safe base64 encoding of the hash. +
+
+
toElement() - + Method in class org.iot.dsa.security.DSPasswordSha256 +
+
+
Returns a string representing the url safe base64 encoding of the hash. +
+
+
toElement() + - Method in class org.iot.dsa.time.DSDateTime
+
 
+
toEnum() - Method in class + org.iot.dsa.node.DSJavaEnum +
+
+
The Java enum.
+
+
toFloat() + - Method in class org.iot.dsa.node.DSBool
+
+
0 or 1.
+
+
toFloat() - Method in class + org.iot.dsa.node.DSDouble +
+
 
+
toFloat() - Method in class + org.iot.dsa.node.DSElement +
+
+
Attempts to return a float value.
+
+
toFloat() + - Method in class org.iot.dsa.node.DSFloat
+
 
+
toFloat() - Method in class + org.iot.dsa.node.DSInt
+
 
+
toFloat() - Method in interface + org.iot.dsa.node.DSINumber
+
+
If not a float, will cast the underlying value.
+
+
toFloat() + - Method in class org.iot.dsa.node.DSLong
+
 
+
toGroup() - Method in class + org.iot.dsa.node.DSElement +
+
+
Lists and maps return themselves, everything else results in an + exception. +
+
+
toGroup() + - Method in class org.iot.dsa.node.DSGroup
+
 
+
toInt() - Method in class + org.iot.dsa.node.DSBool +
+
+
0 or 1.
+
+
toInt() - Method in class + org.iot.dsa.node.DSDouble +
+
 
+
toInt() - Method in class + org.iot.dsa.node.DSElement +
+
+
Attempts to return an int value.
+
+
toInt() - Method in class + org.iot.dsa.node.DSFloat +
+
 
+
toInt() - Method in class + org.iot.dsa.node.DSInt
+
 
+
toInt() - Method in interface + org.iot.dsa.node.DSINumber
+
+
If not an int, will cast the underlying value.
+
+
toInt() - Method in class + org.iot.dsa.node.DSLong +
+
 
+
toList() + - Method in class org.iot.dsa.node.DSElement
+
+
Lists return themselves, everything else results in an exception.
+
+
toList() - Method in class + org.iot.dsa.node.DSList +
+
 
+
toLong() - Method in class + org.iot.dsa.node.DSBool +
+
+
0 or 1.
+
+
toLong() + - Method in class org.iot.dsa.node.DSDouble
+
 
+
toLong() + - Method in class org.iot.dsa.node.DSElement
+
+
Attempts to return a long value.
+
+
toLong() - Method in class + org.iot.dsa.node.DSFloat +
+
 
+
toLong() - Method in class + org.iot.dsa.node.DSInt
+
 
+
toLong() + - Method in interface org.iot.dsa.node.DSINumber +
+
+
If not a long, will cast the underlying value.
+
+
toLong() - Method in class + org.iot.dsa.node.DSLong +
+
 
+
toMap() - Method in class + org.iot.dsa.node.DSElement +
+
+
Maps return themselves, everything else results in an exception.
+
+
toMap() - Method in class + org.iot.dsa.node.DSMap
+
 
+
toNode(Object) - + Static method in class org.iot.dsa.node.DSNode
+
+
A convenience that casts the argument to a node.
+
+
toNumber() - Method in class + org.iot.dsa.node.DSDouble +
+
 
+
toNumber() - Method in class + org.iot.dsa.node.DSFloat +
+
 
+
toNumber() + - Method in class org.iot.dsa.node.DSInt
+
 
+
toNumber() - Method in + interface org.iot.dsa.node.DSINumber
+
+
Returns the Java primitive wrapper.
+
+
toNumber() - Method in class + org.iot.dsa.node.DSLong +
+
 
+
toStatus() - Method in + interface org.iot.dsa.node.DSIStatus
+
 
+
toStatus() - Method in class + org.iot.dsa.node.DSStatus +
+
 
+
toString() + - Method in class org.iot.dsa.DSRuntime.Timer
+
 
+
toString() - + Method in enum org.iot.dsa.node.action.ActionSpec.ResultType
+
 
+
toString() - Method in class + org.iot.dsa.node.DSBool +
+
 
+
toString() - Method in class + org.iot.dsa.node.DSBytes +
+
 
+
toString() - Method in class + org.iot.dsa.node.DSDouble +
+
 
+
toString() + - Method in enum org.iot.dsa.node.DSElementType
+
 
+
toString() + - Method in class org.iot.dsa.node.DSFlexEnum
+
 
+
toString() - Method in class + org.iot.dsa.node.DSFloat +
+
 
+
toString() - Method in class + org.iot.dsa.node.DSGroup +
+
+
Json encodes the graph, be careful.
+
+
toString() - Method in interface + org.iot.dsa.node.DSIEnum
+
+
The string representation of the the enum value.
+
+
toString() + - Method in class org.iot.dsa.node.DSInt
+
 
+
toString() + - Method in class org.iot.dsa.node.DSJavaEnum
+
 
+
toString() - Method in class + org.iot.dsa.node.DSLong +
+
 
+
toString() - Method in class + org.iot.dsa.node.DSNull +
+
 
+
toString() - Method in class + org.iot.dsa.node.DSStatus +
+
 
+
toString() - Method in class + org.iot.dsa.node.DSString +
+
 
+
toString() - Method in class + org.iot.dsa.node.DSValue +
+
+
If isNull(), returns "null", otherwise returns toElement().toString()
+
+
toString() + - Method in enum org.iot.dsa.node.DSValueType
+
 
+
toString() + - Method in class org.iot.dsa.security.DSPasswordAes +
+
 
+
toString() - Method + in class org.iot.dsa.security.DSPasswordSha256 +
+
 
+
toString() + - Method in enum org.iot.dsa.security.DSPermission +
+
 
+
toString() + - Method in class org.iot.dsa.time.DSDateTime
+
+
ISO 8601 standard format of "yyyy-mm-ddThh:mm:ss.mmm[+/-]hh:mm".
+
+
toString() + - Method in exception org.iot.dsa.util.DSException +
+
 
+
trimBackups() - + Method in class org.iot.dsa.logging.FileLogHandler +
+
+
Only public for testing, do not call.
+
+
TRUE - + Static variable in class org.iot.dsa.node.DSBool
+
 
+
TYPE + - Static variable in class org.iot.dsa.node.DSMetadata +
+
 
+
+ + + +

U

+
+
UNIT + - Static variable in class org.iot.dsa.node.DSMetadata +
+
 
+
UNKNOWN - Static variable in class + org.iot.dsa.node.DSStatus +
+
+
Bad, the status is unknown within DSA, typically the initial state at + boot. +
+
+
unknown - Static variable in class + org.iot.dsa.node.DSStatus +
+
 
+
UNKNOWN_STR + - Static variable in class org.iot.dsa.node.DSStatus +
+
 
+
unsubscribe(DSTopic, DSInfo, DSISubscriber) + - Method in class org.iot.dsa.node.DSNode
+
+
Unsubscribes the tuple.
+
+
update(long, DSIValue, DSStatus) + - Method in interface org.iot.dsa.dslink.responder.InboundSubscribeRequest
+
+
The responder should call this when first received and then whenever the + value or status + changes. +
+
+
update(byte[]) - + Method in class org.iot.dsa.security.DSKeys.Signer +
+
+
Update the signature with the given bytes.
+
+
update(byte[], int, int) + - Method in class org.iot.dsa.security.DSKeys.Signer +
+
+
Update the signature with the given bytes.
+
+
update(byte[]) - + Method in class org.iot.dsa.security.DSKeys.Verifier +
+
+
Update the signature with the given bytes.
+
+
update(byte[], int, int) + - Method in class org.iot.dsa.security.DSKeys.Verifier +
+
+
Update the signature with the given bytes.
+
+
UTF8 - + Static variable in class org.iot.dsa.node.DSString +
+
+
The standard UTF8 charset, can be used with string.getBytes(Charset).
+
+
+ + + +

V

+
+
valBoolean + - Variable in class org.iot.dsa.io.AbstractReader
+
 
+
valBytes - Variable in class + org.iot.dsa.io.AbstractReader +
+
 
+
validate(byte[]) + - Method in class org.iot.dsa.security.DSKeys.Verifier +
+
+
Returns true if the given signature is valid for the bytes passed to + update. +
+
+
validate(String) + - Method in class org.iot.dsa.security.DSKeys.Verifier +
+
+
Returns true if the given base 64 encoded signature is valid for the bytes + passed to + update. +
+
+
validateChild(DSIObject) + - Method in class org.iot.dsa.node.DSNode
+
+
Override point, throw a meaningful IllegalArgumentException if the child is + not allowed +
+
+
validateParent(DSNode) + - Method in class org.iot.dsa.dslink.DSMainNode +
+
+
The parent must be a DSLink instance.
+
+
validateParent(DSNode) + - Method in class org.iot.dsa.node.DSNode
+
+
Override point, throw a meaningful IllegalArgumentException if the parent + is not allowed +
+
+
valLong - Variable in class + org.iot.dsa.io.AbstractReader +
+
 
+
valReal - Variable in class + org.iot.dsa.io.AbstractReader +
+
 
+
valString + - Variable in class org.iot.dsa.io.AbstractReader
+
 
+
value(DSElement) + - Method in class org.iot.dsa.io.AbstractWriter
+
 
+
value(boolean) + - Method in class org.iot.dsa.io.AbstractWriter
+
 
+
value(byte[]) + - Method in class org.iot.dsa.io.AbstractWriter
+
 
+
value(double) + - Method in class org.iot.dsa.io.AbstractWriter
+
 
+
value(int) + - Method in class org.iot.dsa.io.AbstractWriter
+
 
+
value(long) + - Method in class org.iot.dsa.io.AbstractWriter
+
 
+
value(String) - + Method in class org.iot.dsa.io.AbstractWriter
+
 
+
value(DSElement) + - Method in interface org.iot.dsa.io.DSIWriter
+
+
Write a value to the map or list.
+
+
value(boolean) + - Method in interface org.iot.dsa.io.DSIWriter
+
+
Write a value to the map or list.
+
+
value(byte[]) + - Method in interface org.iot.dsa.io.DSIWriter
+
+
Write a value to the map or list.
+
+
value(double) + - Method in interface org.iot.dsa.io.DSIWriter
+
+
Write a value to the map or list.
+
+
value(int) - Method in interface + org.iot.dsa.io.DSIWriter +
+
+
Write a value to the map or list.
+
+
value(long) - Method in + interface org.iot.dsa.io.DSIWriter
+
+
Write a value to the map or list.
+
+
value(String) - + Method in interface org.iot.dsa.io.DSIWriter
+
+
Write a value to the map or list.
+
+
value(DSElement) + - Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
VALUE_TOPIC - Static variable in + class org.iot.dsa.node.DSNode
+
 
+
valueOf(String) + - Static method in enum org.iot.dsa.dslink.requester.OutboundInvokeHandler.Mode
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) + - Static method in enum org.iot.dsa.io.DSIReader.Token +
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) + - Static method in enum org.iot.dsa.node.action.ActionSpec.ResultType
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(boolean) + - Static method in class org.iot.dsa.node.DSBool
+
+
Will return either TRUE or FALSE.
+
+
valueOf(DSElement) + - Method in class org.iot.dsa.node.DSBool
+
 
+
valueOf(String) - + Static method in class org.iot.dsa.node.DSBool
+
+
Will return NULL, TRUE or FALSE.
+
+
valueOf(byte[]) + - Static method in class org.iot.dsa.node.DSBytes +
+
 
+
valueOf(DSElement) + - Method in class org.iot.dsa.node.DSBytes
+
 
+
valueOf(String) - + Static method in class org.iot.dsa.node.DSBytes
+
+
Decodes a base64 encoded byte array.
+
+
valueOf(double) + - Static method in class org.iot.dsa.node.DSDouble +
+
+
Attempts to reuse some common values before creating a new instance.
+
+
valueOf(DSElement) + - Method in class org.iot.dsa.node.DSDouble
+
 
+
valueOf(String) - + Static method in class org.iot.dsa.node.DSDouble
+
+
Checks for null, then uses Double.parseDouble()
+
+
valueOf(DSElement) + - Method in class org.iot.dsa.node.DSElement
+
+
Returns the argument.
+
+
valueOf(String) + - Static method in enum org.iot.dsa.node.DSElementType +
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(DSElement) + - Method in class org.iot.dsa.node.DSFlexEnum
+
 
+
valueOf(String, DSList) + - Static method in class org.iot.dsa.node.DSFlexEnum +
+
+
Creates a enum representing the given value and range.
+
+
valueOf(String) + - Method in class org.iot.dsa.node.DSFlexEnum
+
+
Creates a new enum for the given value using the range from this + instance. +
+
+
valueOf(DSElement) + - Method in class org.iot.dsa.node.DSFloat
+
 
+
valueOf(float) + - Static method in class org.iot.dsa.node.DSFloat +
+
+
Attempts to reuse some common values before creating a new instance.
+
+
valueOf(String) - + Static method in class org.iot.dsa.node.DSFloat
+
+
Checks for null, then uses Float.parseFloat()
+
+
valueOf(DSElement) + - Method in class org.iot.dsa.node.DSInt
+
 
+
valueOf(int) - Static method in + class org.iot.dsa.node.DSInt
+
+
Attempts to reuse some common values before creating a new instance.
+
+
valueOf(String) - + Static method in class org.iot.dsa.node.DSInt
+
+
Checks for null, then uses Float.parseFloat()
+
+
valueOf(DSElement) + - Method in interface org.iot.dsa.node.DSIValue +
+
+
This should convert an element transmitted over DSA, such as subscription + updates or set + requests. +
+
+
valueOf(DSElement) + - Method in class org.iot.dsa.node.DSJavaEnum
+
 
+
valueOf(Enum) - + Static method in class org.iot.dsa.node.DSJavaEnum +
+
+
Creates an enum for the given value (and it's range).
+
+
valueOf(String) + - Method in class org.iot.dsa.node.DSJavaEnum
+
 
+
valueOf(DSElement) + - Method in class org.iot.dsa.node.DSList
+
 
+
valueOf(DSElement...) + - Static method in class org.iot.dsa.node.DSList
+
 
+
valueOf(Double...) + - Static method in class org.iot.dsa.node.DSList
+
 
+
valueOf(Long...) - + Static method in class org.iot.dsa.node.DSList
+
 
+
valueOf(String...) + - Static method in class org.iot.dsa.node.DSList
+
 
+
valueOf(DSElement) + - Method in class org.iot.dsa.node.DSLong
+
+
Returns this.
+
+
valueOf(long) + - Static method in class org.iot.dsa.node.DSLong
+
+
Attempts to reuse some common values before creating a new instance.
+
+
valueOf(String) - + Static method in class org.iot.dsa.node.DSLong
+
+
Checks for null, then uses Float.parseFloat()
+
+
valueOf(DSElement) + - Method in class org.iot.dsa.node.DSMap
+
 
+
valueOf(DSElement) + - Method in class org.iot.dsa.node.DSNull
+
+
Returns this.
+
+
valueOf(DSElement) + - Method in class org.iot.dsa.node.DSStatus
+
 
+
valueOf(String) - + Static method in class org.iot.dsa.node.DSStatus
+
 
+
valueOf(DSElement) + - Method in class org.iot.dsa.node.DSString
+
 
+
valueOf(Object) - + Static method in class org.iot.dsa.node.DSString
+
 
+
valueOf(DSElement) + - Method in class org.iot.dsa.node.DSValueNode
+
 
+
valueOf(String) + - Static method in enum org.iot.dsa.node.DSValueType +
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) + - Static method in enum org.iot.dsa.node.event.DSInfoTopic.Event
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) + - Static method in enum org.iot.dsa.node.event.DSValueTopic.Event
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(DSElement) + - Method in class org.iot.dsa.security.DSPasswordAes +
+
+
Creates a encrypted password for the given clear text.
+
+
valueOf(String) + - Static method in class org.iot.dsa.security.DSPasswordAes +
+
+
Creates a encrypted password for the given clear text.
+
+
valueOf(DSElement) + - Method in class org.iot.dsa.security.DSPasswordSha256 +
+
+
Creates a digest password for the given clear text.
+
+
valueOf(String) + - Static method in class org.iot.dsa.security.DSPasswordSha256 +
+
+
Creates a digest password for the given clear text.
+
+
valueOf(String) + - Static method in enum org.iot.dsa.security.DSPermission +
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(DSElement) + - Method in class org.iot.dsa.time.DSDateTime
+
 
+
valueOf(long) + - Static method in class org.iot.dsa.time.DSDateTime +
+
 
+
valueOf(String) + - Static method in class org.iot.dsa.time.DSDateTime +
+
+
Decodes an ISO 8601 standard format of + "yyyy-mm-ddThh:mm:ss.mmm[+/-]hh:mm". +
+
+
valueOf(String) + - Static method in enum org.iot.dsa.time.DSInterval +
+
+
Returns the enum constant of this type with the specified name.
+
+
values() + - Static method in enum org.iot.dsa.dslink.requester.OutboundInvokeHandler.Mode
+
+
Returns an array containing the constants of this enum type, in + the order they are declared. +
+
+
values() - Static method in + enum org.iot.dsa.io.DSIReader.Token
+
+
Returns an array containing the constants of this enum type, in + the order they are declared. +
+
+
values() - + Static method in enum org.iot.dsa.node.action.ActionSpec.ResultType
+
+
Returns an array containing the constants of this enum type, in + the order they are declared. +
+
+
values() - Static method in + enum org.iot.dsa.node.DSElementType
+
+
Returns an array containing the constants of this enum type, in + the order they are declared. +
+
+
values() - Static method in + enum org.iot.dsa.node.DSValueType
+
+
Returns an array containing the constants of this enum type, in + the order they are declared. +
+
+
values() - Static + method in enum org.iot.dsa.node.event.DSInfoTopic.Event +
+
+
Returns an array containing the constants of this enum type, in + the order they are declared. +
+
+
values() - Static + method in enum org.iot.dsa.node.event.DSValueTopic.Event +
+
+
Returns an array containing the constants of this enum type, in + the order they are declared. +
+
+
values() + - Static method in enum org.iot.dsa.security.DSPermission +
+
+
Returns an array containing the constants of this enum type, in + the order they are declared. +
+
+
values() - Static method in enum + org.iot.dsa.time.DSInterval +
+
+
Returns an array containing the constants of this enum type, in + the order they are declared. +
+
+
Verifier(PublicKey) + - Constructor for class org.iot.dsa.security.DSKeys.Verifier +
+
 
+
verify(byte[], int, int, String) + - Method in class org.iot.dsa.security.DSKeys +
+
+
A convenience that creates a verifier and validates the signature for the + given bytes. +
+
+
+ + + +

W

+
+
warn() - Method in class + org.iot.dsa.logging.DSLogger
+
+
True if the level is loggable.
+
+
warn(Object) - + Method in class org.iot.dsa.logging.DSLogger
+
+
Log an unusual but not critical event.
+
+
warn(Object, Throwable) + - Method in class org.iot.dsa.logging.DSLogger +
+
+
Log an unusual but not critical event.
+
+
wasHelpRequested() + - Method in class org.iot.dsa.dslink.DSLinkConfig +
+
+
Whether or not -h or --help was provided.
+
+
write(boolean) + - Method in class org.iot.dsa.io.AbstractWriter
+
+
Write the value.
+
+
write(byte[]) + - Method in class org.iot.dsa.io.AbstractWriter
+
+
Write the value.
+
+
write(double) + - Method in class org.iot.dsa.io.AbstractWriter
+
+
Write the value.
+
+
write(long) + - Method in class org.iot.dsa.io.AbstractWriter
+
+
Write the value.
+
+
write(boolean) + - Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
write(byte[]) - + Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
write(double) - + Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
write(long) - + Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
write(boolean) - + Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
 
+
write(byte[]) - + Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
 
+
write(double) - + Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
 
+
write(long) - Method + in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
 
+
write(LogRecord) + - Method in class org.iot.dsa.logging.AsyncLogHandler +
+
+
Formats and writes the logging record the underlying stream.
+
+
writeDouble(double, byte[], int, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Encodes the primitive into a byte array.
+
+
writeDouble(double, OutputStream, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Encodes the primitive into a stream.
+
+
writeFloat(float, byte[], int, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Encodes the primitive into a byte array.
+
+
writeFloat(float, OutputStream, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Encodes the primitive into a stream
+
+
writeInt(int, byte[], int, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Encodes the primitive into a byte array.
+
+
writeInt(int, OutputStream, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Encodes the primitive into a stream.
+
+
writeKey(CharSequence) + - Method in class org.iot.dsa.io.AbstractWriter
+
+
Write string key of a map entry.
+
+
writeKey(CharSequence) + - Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
writeKey(CharSequence) + - Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
 
+
writeKeyValueSeparator() + - Method in class org.iot.dsa.io.AbstractWriter
+
+
Separate the key from the value in a map.
+
+
writeKeyValueSeparator() + - Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
writeKeyValueSeparator() + - Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
 
+
writeListEnd() + - Method in class org.iot.dsa.io.AbstractWriter
+
+
End the current list.
+
+
writeListEnd() + - Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
writeListEnd() - + Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
 
+
writeListStart(int) + - Method in class org.iot.dsa.io.AbstractWriter
+
+
Start a new list.
+
+
writeListStart(int) + - Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
writeListStart(int) + - Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
+
A negative size implies dynamic and will be written when the list is + closed. +
+
+
writeLong(long, byte[], int, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Encodes the primitive into a byte array.
+
+
writeLong(long, OutputStream, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Encodes the primitive into a stream.
+
+
writeMapEnd() + - Method in class org.iot.dsa.io.AbstractWriter
+
+
End the current map.
+
+
writeMapEnd() - + Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
writeMapEnd() - + Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
 
+
writeMapStart(int) - + Method in class org.iot.dsa.io.AbstractWriter
+
+
Start a new map.
+
+
writeMapStart(int) + - Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
writeMapStart(int) + - Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
+
A negative size implies dynamic and will be written when the map is + closed. +
+
+
writeNewLineIndent() + - Method in class org.iot.dsa.io.AbstractWriter
+
+
Override point for subclasses which perform use pretty printing, such as + json. +
+
+
writeNewLineIndent() + - Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
+
Two spaces per level.
+
+
writeNewLineIndent() + - Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
 
+
writeNull() + - Method in class org.iot.dsa.io.AbstractWriter
+
+
Write a null value.
+
+
writeNull() - + Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
writeNull() - Method + in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
 
+
writeSeparator() + - Method in class org.iot.dsa.io.AbstractWriter
+
+
Write a value separator, such as the comma in json.
+
+
writeSeparator() + - Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
writeSeparator() + - Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
 
+
writeShort(short, byte[], int, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Encodes the primitive into a byte array.
+
+
writeShort(short, OutputStream, boolean) + - Static method in class org.iot.dsa.node.DSBytes +
+
+
Encodes the primitive into a stream.
+
+
writeTo(ByteBuffer) + - Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
+
Writes the internal buffer to the parameter.
+
+
writeTo(OutputStream) + - Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
+
Writes the internal buffer to the parameter.
+
+
writeValue(CharSequence) + - Method in class org.iot.dsa.io.AbstractWriter
+
+
Write the value, which will never be null.
+
+
writeValue(CharSequence) + - Method in class org.iot.dsa.io.json.AbstractJsonWriter +
+
 
+
writeValue(CharSequence) + - Method in class org.iot.dsa.io.msgpack.MsgpackWriter +
+
 
+
+ A B C D E F G H I J K L M N O P R S T U V W  +
- - - - - + - + + + + +
+ + + + + + diff --git a/docs/javadoc/index.html b/docs/javadoc/index.html index 5a034975..b222090b 100644 --- a/docs/javadoc/index.html +++ b/docs/javadoc/index.html @@ -1,10 +1,11 @@ - + - -dslink-core 0.15.0 API - + + - - - - - - -<noscript> -<div>JavaScript is disabled on your browser.</div> -</noscript> -<h2>Frame Alert</h2> -<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> - + + + + + + + <noscript> + <div>JavaScript is disabled on your browser.</div> + </noscript> + <h2>Frame Alert</h2> + <p>This document is designed to be viewed using the frames feature. If you see this message, you + are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame + version</a>.</p> + diff --git a/docs/javadoc/org/iot/dsa/DSRuntime.Timer.html b/docs/javadoc/org/iot/dsa/DSRuntime.Timer.html index 3b03235d..034121ee 100644 --- a/docs/javadoc/org/iot/dsa/DSRuntime.Timer.html +++ b/docs/javadoc/org/iot/dsa/DSRuntime.Timer.html @@ -1,12 +1,13 @@ - + - -DSRuntime.Timer (dslink-core 0.15.0 API) - - - + + DSRuntime.Timer (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa
-

Class DSRuntime.Timer

+
org.iot.dsa
+

Class DSRuntime.Timer

-
    -
  • java.lang.Object
  • -
  • -
      -
    • org.iot.dsa.DSRuntime.Timer
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    java.lang.Runnable
    -
    -
    -
    Enclosing class:
    -
    DSRuntime
    -
    -
    -
    -
    public static class DSRuntime.Timer
    +  
      +
    • java.lang.Object
    • +
    • +
        +
      • org.iot.dsa.DSRuntime.Timer
      • +
      +
    • +
    +
    +
      +
    • +
      +
      All Implemented Interfaces:
      +
      java.lang.Runnable
      +
      +
      +
      Enclosing class:
      +
      DSRuntime
      +
      +
      +
      +
      public static class DSRuntime.Timer
       extends java.lang.Object
       implements java.lang.Runnable
      -
      Can be used to inspect and cancel tasks passed to the run methods in DSRuntime.
      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Method Summary

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        All Methods Instance Methods Concrete Methods 
        Modifier and TypeMethod and Description
        voidcancel() -
        Cancel execution, will not impact current running tasks and will have no effect if - already cancelled.
        -
        longgetInterval() -
        The interval between runs, zero or less for no interval.
        -
        java.lang.RunnablegetRunnable() -
        The runnable being managed by this timer.
        -
        booleanisCancelled() 
        booleanisFinished() -
        True if cancelled or was a one time execution and that has finished.
        -
        booleanisRunning() -
        True when the runnable is being actually being executed.
        -
        longlastRun() -
        The lastRun run or -1 if it hasn't run yet.
        -
        longnextRun() -
        The next scheduled time to run.
        -
        voidrun() -
        Do not call.
        -
        longrunCount() -
        The number of completed runs.
        -
        DSRuntime.TimersetSkipMissedIntervals(boolean skipMissed) -
        The default is true, set this to false if all intervals should be run, even if they run - later than scheduled.
        -
        java.lang.StringtoString() 
        -
          -
        • - - -

          Methods inherited from class java.lang.Object

          -clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
        • -
        -
      • -
      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Method Detail

        - - - -
          -
        • -

          cancel

          -
          public void cancel()
          -
          Cancel execution, will not impact current running tasks and will have no effect if - already cancelled.
          -
        • -
        - - - -
          -
        • -

          getInterval

          -
          public long getInterval()
          -
          The interval between runs, zero or less for no interval.
          -
        • -
        - - - -
          -
        • -

          getRunnable

          -
          public java.lang.Runnable getRunnable()
          -
          The runnable being managed by this timer.
          -
        • -
        - - - -
          -
        • -

          isCancelled

          -
          public boolean isCancelled()
          -
        • -
        - - - -
          -
        • -

          isFinished

          -
          public boolean isFinished()
          -
          True if cancelled or was a one time execution and that has finished.
          -
        • -
        - - - -
          -
        • -

          isRunning

          -
          public boolean isRunning()
          -
          True when the runnable is being actually being executed.
          -
        • -
        - - - -
          -
        • -

          lastRun

          -
          public long lastRun()
          -
          The lastRun run or -1 if it hasn't run yet.
          -
        • -
        - - - -
          -
        • -

          nextRun

          -
          public long nextRun()
          -
          The next scheduled time to run.
          -
          -
          Returns:
          -
          0 or less when finished.
          -
          -
        • -
        - - - -
          -
        • -

          run

          -
          public void run()
          -
          Do not call.
          -
          -
          Specified by:
          -
          run in interface java.lang.Runnable
          -
          -
        • -
        - - - -
          -
        • -

          runCount

          -
          public long runCount()
          -
          The number of completed runs.
          -
        • -
        - - - -
          -
        • -

          setSkipMissedIntervals

          -
          public DSRuntime.Timer setSkipMissedIntervals(boolean skipMissed)
          -
          The default is true, set this to false if all intervals should be run, even if they run - later than scheduled.
          -
          -
          Parameters:
          -
          skipMissed - False if intervals should be run after they were scheduled to.
          -
          Returns:
          -
          this
          -
          -
        • -
        - - - -
          -
        • -

          toString

          -
          public java.lang.String toString()
          -
          -
          Overrides:
          -
          toString in class java.lang.Object
          -
          -
        • -
        -
      • -
      -
    • -
    -
    +
    Can be used to inspect and cancel tasks passed to the run methods in + DSRuntime. +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidcancel() +
      Cancel execution, will not impact current running tasks and + will have no effect if + already cancelled. +
      +
      longgetInterval() +
      The interval between runs, zero or less for no interval.
      +
      java.lang.RunnablegetRunnable() +
      The runnable being managed by this timer.
      +
      booleanisCancelled()  +
      booleanisFinished() +
      True if cancelled or was a one time execution and that has + finished. +
      +
      booleanisRunning() +
      True when the runnable is being actually being executed.
      +
      longlastRun() +
      The lastRun run or -1 if it hasn't run yet.
      +
      longnextRun() +
      The next scheduled time to run.
      +
      voidrun() +
      Do not call.
      +
      longrunCount() +
      The number of completed runs.
      +
      DSRuntime.Timer + setSkipMissedIntervals(boolean skipMissed) +
      The default is true, set this to false if all intervals should + be run, even if they run + later than scheduled. +
      +
      java.lang.StringtoString()  +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        + clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, + wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        cancel

        +
        public void cancel()
        +
        Cancel execution, will not impact current running tasks and will + have no effect if + already cancelled. +
        +
      • +
      + + + +
        +
      • +

        getInterval

        +
        public long getInterval()
        +
        The interval between runs, zero or less for no interval.
        +
      • +
      + + + +
        +
      • +

        getRunnable

        +
        public java.lang.Runnable getRunnable()
        +
        The runnable being managed by this timer.
        +
      • +
      + + + +
        +
      • +

        isCancelled

        +
        public boolean isCancelled()
        +
      • +
      + + + +
        +
      • +

        isFinished

        +
        public boolean isFinished()
        +
        True if cancelled or was a one time execution and that has + finished. +
        +
      • +
      + + + +
        +
      • +

        isRunning

        +
        public boolean isRunning()
        +
        True when the runnable is being actually being executed.
        +
      • +
      + + + +
        +
      • +

        lastRun

        +
        public long lastRun()
        +
        The lastRun run or -1 if it hasn't run yet.
        +
      • +
      + + + +
        +
      • +

        nextRun

        +
        public long nextRun()
        +
        The next scheduled time to run.
        +
        +
        Returns:
        +
        0 or less when finished.
        +
        +
      • +
      + + + +
        +
      • +

        run

        +
        public void run()
        +
        Do not call.
        +
        +
        Specified by:
        +
        run in interface java.lang.Runnable
        +
        +
      • +
      + + + +
        +
      • +

        runCount

        +
        public long runCount()
        +
        The number of completed runs.
        +
      • +
      + + + +
        +
      • +

        setSkipMissedIntervals

        +
        public DSRuntime.Timer setSkipMissedIntervals(boolean skipMissed)
        +
        The default is true, set this to false if all intervals should be + run, even if they run + later than scheduled. +
        +
        +
        Parameters:
        +
        skipMissed - False if intervals should be run after they were + scheduled to. +
        +
        Returns:
        +
        this
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
  • +
+
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/DSRuntime.html b/docs/javadoc/org/iot/dsa/DSRuntime.html index 66827a3f..87c1e30e 100644 --- a/docs/javadoc/org/iot/dsa/DSRuntime.html +++ b/docs/javadoc/org/iot/dsa/DSRuntime.html @@ -1,12 +1,13 @@ - + - -DSRuntime (dslink-core 0.15.0 API) - - - + + DSRuntime (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa
-

Class DSRuntime

+
org.iot.dsa
+

Class DSRuntime

-
    -
  • java.lang.Object
  • -
  • -
      -
    • org.iot.dsa.DSRuntime
    • -
    -
  • -
-
-
    -
  • -
    -
    -
    public class DSRuntime
    +  
      +
    • java.lang.Object
    • +
    • +
        +
      • org.iot.dsa.DSRuntime
      • +
      +
    • +
    +
    +
      +
    • +
      +
      +
      public class DSRuntime
       extends java.lang.Object
      -
      DSA thread pool and timers.
      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Nested Class Summary

        - - - - - - - - - - -
        Nested Classes 
        Modifier and TypeClass and Description
        static class DSRuntime.Timer -
        Can be used to inspect and cancel tasks passed to the run methods in DSRuntime.
        -
        -
      • -
      - -
        -
      • - - -

        Method Summary

        - - - - - - - - - - - - - - - - - - - - - - -
        All Methods Static Methods Concrete Methods 
        Modifier and TypeMethod and Description
        static voidrun(java.lang.Runnable arg) -
        Run as soon as possible on the application's thread pool and run only once.
        -
        static DSRuntime.Timerrun(java.lang.Runnable arg, - long start, - long interval) -
        Run periodically starting at the given time and repeat at the given millisecond interval.
        -
        static DSRuntime.TimerrunAt(java.lang.Runnable arg, - long at) -
        Run once at the given time.
        -
        static DSRuntime.TimerrunDelayed(java.lang.Runnable arg, - long delayMillis) -
        Run once after the given delay.
        -
        -
          -
        • - - -

          Methods inherited from class java.lang.Object

          -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
        • -
        -
      • -
      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Method Detail

        - - - -
          -
        • -

          run

          -
          public static void run(java.lang.Runnable arg)
          -
          Run as soon as possible on the application's thread pool and run only once.
          -
        • -
        - - - -
          -
        • -

          run

          -
          public static DSRuntime.Timer run(java.lang.Runnable arg,
          +        
          DSA thread pool and timers.
          +
        • +
        +
    +
    +
      +
    • + +
        +
      • + + +

        Nested Class Summary

        + + + + + + + + + + +
        Nested Classes 
        Modifier and TypeClass and Description
        static class DSRuntime.Timer +
        Can be used to inspect and cancel tasks passed to the run + methods in DSRuntime. +
        +
        +
      • +
      + +
        +
      • + + +

        Method Summary

        + + + + + + + + + + + + + + + + + + + + + + +
        All Methods Static Methods Concrete Methods 
        Modifier and TypeMethod and Description
        static voidrun(java.lang.Runnable arg) +
        Run as soon as possible on the application's thread pool and + run only once. +
        +
        static DSRuntime.Timer + run(java.lang.Runnable arg, + long start, + long interval) +
        Run periodically starting at the given time and repeat at the + given millisecond interval. +
        +
        static DSRuntime.Timer + runAt(java.lang.Runnable arg, + long at) +
        Run once at the given time.
        +
        static DSRuntime.Timer + runDelayed(java.lang.Runnable arg, + long delayMillis) +
        Run once after the given delay.
        +
        +
          +
        • + + +

          Methods inherited from class java.lang.Object

          + clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, + wait, wait, wait
        • +
        +
      • +
      +
    • +
    +
    +
    +
      +
    • + +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          run

          +
          public static void run(java.lang.Runnable arg)
          +
          Run as soon as possible on the application's thread pool and run + only once. +
          +
        • +
        + + + +
          +
        • +

          run

          +
          public static DSRuntime.Timer run(java.lang.Runnable arg,
                                             long start,
                                             long interval)
          -
          Run periodically starting at the given time and repeat at the given millisecond interval.
          -
          -
          Parameters:
          -
          arg - What to runAt.
          -
          start - First absolute execution time, or if less or equal to 0, start immediately.
          -
          interval - The millisecond interval at which to run.
          -
          Returns:
          -
          For inspecting and cancel execution.
          -
          -
        • -
        - - - -
          -
        • -

          runAt

          -
          public static DSRuntime.Timer runAt(java.lang.Runnable arg,
          +                
          Run periodically starting at the given time and repeat at the + given millisecond interval. +
          +
          +
          Parameters:
          +
          arg - What to runAt.
          +
          start - First absolute execution time, or if less or equal to 0, + start immediately. +
          +
          interval - The millisecond interval at which to run.
          +
          Returns:
          +
          For inspecting and cancel execution.
          +
          +
        • +
        + + + +
          +
        • +

          runAt

          +
          public static DSRuntime.Timer runAt(java.lang.Runnable arg,
                                               long at)
          -
          Run once at the given time.
          -
          -
          Parameters:
          -
          arg - What to runAt.
          -
          at - Execution time. If the time is past, it'll run right away.
          -
          Returns:
          -
          For inspecting and cancel execution.
          -
          -
        • -
        - - - -
          -
        • -

          runDelayed

          -
          public static DSRuntime.Timer runDelayed(java.lang.Runnable arg,
          +                
          Run once at the given time.
          +
          +
          Parameters:
          +
          arg - What to runAt.
          +
          at - Execution time. If the time is past, it'll run right away. +
          +
          Returns:
          +
          For inspecting and cancel execution.
          +
          +
        • +
        + + + +
          +
        • +

          runDelayed

          +
          public static DSRuntime.Timer runDelayed(java.lang.Runnable arg,
                                                    long delayMillis)
          -
          Run once after the given delay.
          -
          -
          Parameters:
          -
          arg - What to runAt.
          -
          delayMillis - The number of millis to wait before running.
          -
          Returns:
          -
          For inspecting and cancel execution.
          -
          -
        • -
        -
      • -
      -
    • -
    -
    +
    Run once after the given delay.
    +
    +
    Parameters:
    +
    arg - What to runAt.
    +
    delayMillis - The number of millis to wait before running.
    +
    Returns:
    +
    For inspecting and cancel execution.
    +
    +
  • +
+ + + + +
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/io/AbstractReader.html b/docs/javadoc/org/iot/dsa/io/AbstractReader.html index 91d043c9..5d090b50 100644 --- a/docs/javadoc/org/iot/dsa/io/AbstractReader.html +++ b/docs/javadoc/org/iot/dsa/io/AbstractReader.html @@ -1,12 +1,13 @@ - + - -AbstractReader (dslink-core 0.15.0 API) - - - + + AbstractReader (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.io
-

Class AbstractReader

+
org.iot.dsa.io
+

Class AbstractReader

-
    -
  • java.lang.Object
  • -
  • -
      -
    • org.iot.dsa.io.AbstractReader
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    java.io.Closeable, java.lang.AutoCloseable, DSIReader
    -
    -
    -
    Direct Known Subclasses:
    -
    JsonReader, MsgpackReader
    -
    -
    -
    -
    public abstract class AbstractReader
    +  
      +
    • java.lang.Object
    • +
    • +
        +
      • org.iot.dsa.io.AbstractReader
      • +
      +
    • +
    +
    +
      +
    • +
      +
      All Implemented Interfaces:
      +
      java.io.Closeable, java.lang.AutoCloseable, DSIReader +
      +
      +
      +
      Direct Known Subclasses:
      +
      JsonReader, MsgpackReader
      +
      +
      +
      +
      public abstract class AbstractReader
       extends java.lang.Object
       implements DSIReader
      -
      Basic implementation of DSReader. Subclasses must implement the next() method.
      -
      -
      See Also:
      -
      next(), -DSIReader
      -
      -
    • -
    -
    -
    - -
    -
    -
      -
    • - -
        -
      • - - -

        Field Detail

        - - - -
          -
        • -

          valBoolean

          -
          protected boolean valBoolean
          -
        • -
        - - - -
          -
        • -

          valBytes

          -
          protected byte[] valBytes
          -
        • -
        - - - -
          -
        • -

          valReal

          -
          protected double valReal
          -
        • -
        - - - -
          -
        • -

          valLong

          -
          protected long valLong
          -
        • -
        - - - -
          -
        • -

          valString

          -
          protected java.lang.String valString
          -
        • -
        -
      • -
      - -
        -
      • - - -

        Constructor Detail

        - - - -
          -
        • -

          AbstractReader

          -
          public AbstractReader()
          -
        • -
        -
      • -
      - -
        -
      • - - -

        Method Detail

        - - - -
          -
        • -

          getBoolean

          -
          public boolean getBoolean()
          -
          Description copied from interface: DSIReader
          -
          Returns the value when last() == BOOLEAN.
          -
          -
          Specified by:
          -
          getBoolean in interface DSIReader
          -
          -
        • -
        - - - -
          -
        • -

          getBytes

          -
          public byte[] getBytes()
          -
          Description copied from interface: DSIReader
          -
          Returns the value when last() == BYTES.
          -
          -
          Specified by:
          -
          getBytes in interface DSIReader
          -
          -
        • -
        - - - -
          -
        • -

          getDouble

          -
          public double getDouble()
          -
          Description copied from interface: DSIReader
          -
          Returns the value when last() == DOUBLE.
          -
          -
          Specified by:
          -
          getDouble in interface DSIReader
          -
          -
        • -
        - - - -
          -
        • -

          getElement

          -
          public DSElement getElement()
          -
          Description copied from interface: DSIReader
          -
          Returns the DSElement when last() == raw type or ROOT.
          -
          -
          Specified by:
          -
          getElement in interface DSIReader
          -
          -
        • -
        - - - -
          -
        • -

          getList

          -
          public DSList getList()
          -
          Description copied from interface: DSIReader
          -
          This should only be called when last() == BEGIN_LIST and it will decodeKeys the entire - list. Call next rather than this method to get the list in pieces.
          -
          -
          Specified by:
          -
          getList in interface DSIReader
          -
          -
        • -
        - - - -
          -
        • -

          getLong

          -
          public long getLong()
          -
          Description copied from interface: DSIReader
          -
          Returns the value when last() == LONG.
          -
          -
          Specified by:
          -
          getLong in interface DSIReader
          -
          -
        • -
        - - - -
          -
        • -

          getMap

          -
          public DSMap getMap()
          -
          Description copied from interface: DSIReader
          -
          This should only be called when last() == BEGIN_MAP and it will decodeKeys the entire map. - Call next rather than this method get the map in pieces.
          -
          -
          Specified by:
          -
          getMap in interface DSIReader
          -
          -
        • -
        - - - -
          -
        • -

          getString

          -
          public java.lang.String getString()
          -
          Description copied from interface: DSIReader
          -
          Returns the value when last() == STRING.
          -
          -
          Specified by:
          -
          getString in interface DSIReader
          -
          -
        • -
        - - - -
          -
        • -

          last

          -
          public DSIReader.Token last()
          -
          Description copied from interface: DSIReader
          -
          The last value returned from next(). At the beginning of a document, before next has been - called, this will return ROOT.
          -
          -
          Specified by:
          -
          last in interface DSIReader
          -
          -
        • -
        - - - -
          -
        • -

          next

          -
          public abstract DSIReader.Token next()
          -
          Subclasses must override this, read the next item from the stream, then call one of the - setXxx methods. +
          Basic implementation of DSReader. Subclasses must implement the next() + method. +
          +
          +
          See Also:
          +
          next(), + DSIReader +
          +
          +
        • +
        +
    +
    + +
    +
    +
      +
    • + +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          valBoolean

          +
          protected boolean valBoolean
          +
        • +
        + + + +
          +
        • +

          valBytes

          +
          protected byte[] valBytes
          +
        • +
        + + + +
          +
        • +

          valReal

          +
          protected double valReal
          +
        • +
        + + + +
          +
        • +

          valLong

          +
          protected long valLong
          +
        • +
        + + + +
          +
        • +

          valString

          +
          protected java.lang.String valString
          +
        • +
        +
      • +
      + +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          AbstractReader

          +
          public AbstractReader()
          +
        • +
        +
      • +
      + +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          getBoolean

          +
          public boolean getBoolean()
          +
          Description copied from interface: DSIReader +
          +
          Returns the value when last() == BOOLEAN.
          +
          +
          Specified by:
          +
          getBoolean in + interface DSIReader +
          +
          +
        • +
        + + + +
          +
        • +

          getBytes

          +
          public byte[] getBytes()
          +
          Description copied from interface: DSIReader +
          +
          Returns the value when last() == BYTES.
          +
          +
          Specified by:
          +
          getBytes in + interface DSIReader +
          +
          +
        • +
        + + + +
          +
        • +

          getDouble

          +
          public double getDouble()
          +
          Description copied from interface: DSIReader +
          +
          Returns the value when last() == DOUBLE.
          +
          +
          Specified by:
          +
          getDouble in + interface DSIReader +
          +
          +
        • +
        + + + +
          +
        • +

          getElement

          +
          public DSElement getElement()
          +
          Description copied from interface: DSIReader +
          +
          Returns the DSElement when last() == raw type or ROOT.
          +
          +
          Specified by:
          +
          getElement in + interface DSIReader +
          +
          +
        • +
        + + + +
          +
        • +

          getList

          +
          public DSList getList()
          +
          Description copied from interface: DSIReader +
          +
          This should only be called when last() == BEGIN_LIST and it will + decodeKeys the entire + list. Call next rather than this method to get the list in pieces. +
          +
          +
          Specified by:
          +
          getList in + interface DSIReader +
          +
          +
        • +
        + + + +
          +
        • +

          getLong

          +
          public long getLong()
          +
          Description copied from interface: DSIReader +
          +
          Returns the value when last() == LONG.
          +
          +
          Specified by:
          +
          getLong in + interface DSIReader +
          +
          +
        • +
        + + + +
          +
        • +

          getMap

          +
          public DSMap getMap()
          +
          Description copied from interface: DSIReader +
          +
          This should only be called when last() == BEGIN_MAP and it will + decodeKeys the entire map. + Call next rather than this method get the map in pieces. +
          +
          +
          Specified by:
          +
          getMap in + interface DSIReader +
          +
          +
        • +
        + + + +
          +
        • +

          getString

          +
          public java.lang.String getString()
          +
          Description copied from interface: DSIReader +
          +
          Returns the value when last() == STRING.
          +
          +
          Specified by:
          +
          getString in + interface DSIReader +
          +
          +
        • +
        + + + +
          +
        • +

          last

          +
          public DSIReader.Token last()
          +
          Description copied from interface: DSIReader +
          +
          The last value returned from next(). At the beginning of a + document, before next has been + called, this will return ROOT. +
          +
          +
          Specified by:
          +
          last in + interface DSIReader +
          +
          +
        • +
        + + + +
          +
        • +

          next

          +
          public abstract DSIReader.Token next()
          +
          Subclasses must override this, read the next item from the + stream, then call one of the + setXxx methods. -

          +

          - Advances the reader to the next item and returns the token representing it's current state.

          -
          -
          Specified by:
          -
          next in interface DSIReader
          -
          -
        • -
        - - - - - - - - - - - - - - - - - - - - - - - -
          -
        • -

          setNextValue

          -
          protected DSIReader.Token setNextValue(boolean arg)
          -
        • -
        - - - -
          -
        • -

          setNextValue

          -
          protected DSIReader.Token setNextValue(byte[] arg)
          -
        • -
        - - - -
          -
        • -

          setNextValue

          -
          protected DSIReader.Token setNextValue(double arg)
          -
        • -
        - - - - - - - -
          -
        • -

          setNextValue

          -
          protected DSIReader.Token setNextValue(java.lang.String arg)
          -
        • -
        - - - - - - - - -
      • -
      -
    • -
    -
    + Advances the reader to the next item and returns the token representing it's + current state.
+
+
Specified by:
+
next in + interface DSIReader +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
    +
  • +

    setNextValue

    +
    protected DSIReader.Token setNextValue(boolean arg)
    +
  • +
+ + + +
    +
  • +

    setNextValue

    +
    protected DSIReader.Token setNextValue(byte[] arg)
    +
  • +
+ + + +
    +
  • +

    setNextValue

    +
    protected DSIReader.Token setNextValue(double arg)
    +
  • +
+ + + +
    +
  • +

    setNextValue

    +
    protected DSIReader.Token setNextValue(long arg)
    +
  • +
+ + + +
    +
  • +

    setNextValue

    +
    protected DSIReader.Token setNextValue(java.lang.String arg)
    +
  • +
+ + + +
    +
  • +

    setNextValueNull

    +
    protected DSIReader.Token setNextValueNull()
    +
  • +
+ + + + + + + + +
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/io/AbstractWriter.html b/docs/javadoc/org/iot/dsa/io/AbstractWriter.html index 6af2eb3c..47fc86c6 100644 --- a/docs/javadoc/org/iot/dsa/io/AbstractWriter.html +++ b/docs/javadoc/org/iot/dsa/io/AbstractWriter.html @@ -1,12 +1,13 @@ - + - -AbstractWriter (dslink-core 0.15.0 API) - - - + + AbstractWriter (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.io
-

Class AbstractWriter

+
org.iot.dsa.io
+

Class AbstractWriter

-
    -
  • java.lang.Object
  • -
  • -
      -
    • org.iot.dsa.io.AbstractWriter
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    java.io.Closeable, java.lang.AutoCloseable, DSIWriter
    -
    -
    -
    Direct Known Subclasses:
    -
    AbstractJsonWriter, MsgpackWriter
    -
    -
    -
    -
    public abstract class AbstractWriter
    +  
      +
    • java.lang.Object
    • +
    • +
        +
      • org.iot.dsa.io.AbstractWriter
      • +
      +
    • +
    +
    +
      +
    • +
      +
      All Implemented Interfaces:
      +
      java.io.Closeable, java.lang.AutoCloseable, DSIWriter +
      +
      +
      +
      Direct Known Subclasses:
      +
      AbstractJsonWriter, MsgpackWriter
      +
      +
      +
      +
      public abstract class AbstractWriter
       extends java.lang.Object
      -implements java.io.Closeable, DSIWriter
      -
      Basic implementation of DSWriter. Subclasses must implement the abstract methods which all start - with write.
      -
      -
      See Also:
      -
      DSIWriter
      -
      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Field Summary

        - - - - - - - - - - -
        Fields 
        Modifier and TypeField and Description
        protected booleanprettyPrint -
        Subclasses can use this if applicable.
        -
        -
      • -
      - -
        -
      • - - -

        Constructor Summary

        - - - - - - - - -
        Constructors 
        Constructor and Description
        AbstractWriter() 
        -
      • -
      - -
        -
      • - - -

        Method Summary

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        All Methods Instance Methods Abstract Methods Concrete Methods 
        Modifier and TypeMethod and Description
        AbstractWriterbeginList() -
        Start a new list and return this.
        -
        AbstractWriterbeginList(int size) -
        Start a new list of the given size and return this.
        -
        AbstractWriterbeginMap() -
        Start a new map and return this.
        -
        AbstractWriterbeginMap(int size) -
        Start a new map of the given size and return this.
        -
        AbstractWriterendList() -
        End the current list.
        -
        AbstractWriterendMap() -
        End the current map.
        -
        protected intgetDepth() -
        Current depth in the tree, will be needed by writeNewLineIndent.
        -
        AbstractWriterkey(java.lang.CharSequence arg) -
        Write a key in the current map.
        -
        intlength() -
        Returns 0 by default.
        -
        AbstractWriterreset() -
        Clears the state of the writer.
        -
        AbstractWritervalue(boolean arg) -
        Write a value to the map or list.
        -
        AbstractWritervalue(byte[] arg) -
        Write a value to the map or list.
        -
        AbstractWritervalue(double arg) -
        Write a value to the map or list.
        -
        AbstractWritervalue(DSElement arg) -
        Write a value to the map or list.
        -
        AbstractWritervalue(int arg) -
        Write a value to the map or list.
        -
        AbstractWritervalue(long arg) -
        Write a value to the map or list.
        -
        AbstractWritervalue(java.lang.String arg) -
        Write a value to the map or list.
        -
        protected abstract voidwrite(boolean arg) -
        Write the value.
        -
        protected abstract voidwrite(byte[] arg) -
        Write the value.
        -
        protected abstract voidwrite(double arg) -
        Write the value.
        -
        protected abstract voidwrite(long arg) -
        Write the value.
        -
        protected abstract voidwriteKey(java.lang.CharSequence arg) -
        Write string key of a map entry.
        -
        protected abstract voidwriteKeyValueSeparator() -
        Separate the key from the value in a map.
        -
        protected abstract voidwriteListEnd() -
        End the current list.
        -
        protected abstract voidwriteListStart(int size) -
        Start a new list.
        -
        protected abstract voidwriteMapEnd() -
        End the current map.
        -
        protected abstract voidwriteMapStart(int size) -
        Start a new map.
        -
        protected voidwriteNewLineIndent() -
        Override point for subclasses which perform use pretty printing, such as json.
        -
        protected abstract voidwriteNull() -
        Write a null value.
        -
        protected abstract voidwriteSeparator() -
        Write a value separator, such as the comma in json.
        -
        protected abstract voidwriteValue(java.lang.CharSequence arg) -
        Write the value, which will never be null.
        -
        -
          -
        • - - -

          Methods inherited from class java.lang.Object

          -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
        • -
        - -
      • -
      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Field Detail

        - - - -
          -
        • -

          prettyPrint

          -
          protected boolean prettyPrint
          -
          Subclasses can use this if applicable.
          -
        • -
        -
      • -
      - -
        -
      • - - -

        Constructor Detail

        - - - -
          -
        • -

          AbstractWriter

          -
          public AbstractWriter()
          -
        • -
        -
      • -
      - -
        -
      • - - -

        Method Detail

        - - - - - - - -
          -
        • -

          beginList

          -
          public AbstractWriter beginList(int size)
          -
          Description copied from interface: DSIWriter
          -
          Start a new list of the given size and return this.
          -
          -
          Specified by:
          -
          beginList in interface DSIWriter
          -
          Parameters:
          -
          size - Less than zero means the size is unknown.
          -
          -
        • -
        - - - - - - - -
          -
        • -

          beginMap

          -
          public AbstractWriter beginMap(int size)
          -
          Description copied from interface: DSIWriter
          -
          Start a new map of the given size and return this.
          -
          -
          Specified by:
          -
          beginMap in interface DSIWriter
          -
          Parameters:
          -
          size - Less than zero means the size is unknown.
          -
          -
        • -
        - - - - - - - - - - - -
          -
        • -

          getDepth

          -
          protected int getDepth()
          -
          Current depth in the tree, will be needed by writeNewLineIndent.
          -
        • -
        - - - -
          -
        • -

          key

          -
          public AbstractWriter key(java.lang.CharSequence arg)
          -
          Description copied from interface: DSIWriter
          -
          Write a key in the current map. Cannot be called in a list, must be followed by a call to - one of the value methods.
          -
          -
          Specified by:
          -
          key in interface DSIWriter
          -
          -
        • -
        - - - -
          -
        • -

          length

          -
          public int length()
          -
          Returns 0 by default.
          -
          -
          Specified by:
          -
          length in interface DSIWriter
          -
          -
        • -
        - - - - - - - -
          -
        • -

          value

          -
          public AbstractWriter value(DSElement arg)
          -
          Description copied from interface: DSIWriter
          -
          Write a value to the map or list. If in a map, this must have been preceded by a call to - key(String). This can be used to encode an entire graph.
          -
          -
          Specified by:
          -
          value in interface DSIWriter
          -
          -
        • -
        - - - -
          -
        • -

          value

          -
          public AbstractWriter value(boolean arg)
          -
          Description copied from interface: DSIWriter
          -
          Write a value to the map or list. If in a map, this must have been preceded by a call to - key(String).
          -
          -
          Specified by:
          -
          value in interface DSIWriter
          -
          -
        • -
        - - - -
          -
        • -

          value

          -
          public AbstractWriter value(byte[] arg)
          -
          Description copied from interface: DSIWriter
          -
          Write a value to the map or list. If in a map, this must have been preceded by a call to - key(String).
          -
          -
          Specified by:
          -
          value in interface DSIWriter
          -
          -
        • -
        - - - -
          -
        • -

          value

          -
          public AbstractWriter value(double arg)
          -
          Description copied from interface: DSIWriter
          -
          Write a value to the map or list. If in a map, this must have been preceded by a call to - key(String).
          -
          -
          Specified by:
          -
          value in interface DSIWriter
          -
          -
        • -
        - - - -
          -
        • -

          value

          -
          public AbstractWriter value(int arg)
          -
          Description copied from interface: DSIWriter
          -
          Write a value to the map or list. If in a map, this must have been preceded by a call to - key(String).
          -
          -
          Specified by:
          -
          value in interface DSIWriter
          -
          -
        • -
        - - - -
          -
        • -

          value

          -
          public AbstractWriter value(long arg)
          -
          Description copied from interface: DSIWriter
          -
          Write a value to the map or list. If in a map, this must have been preceded by a call to - key(String).
          -
          -
          Specified by:
          -
          value in interface DSIWriter
          -
          -
        • -
        - - - -
          -
        • -

          value

          -
          public AbstractWriter value(java.lang.String arg)
          -
          Description copied from interface: DSIWriter
          -
          Write a value to the map or list. If in a map, this must have been preceded by a call to - key(String).
          -
          -
          Specified by:
          -
          value in interface DSIWriter
          -
          -
        • -
        - - - -
          -
        • -

          write

          -
          protected abstract void write(boolean arg)
          +implements java.io.Closeable, DSIWriter
          +
          Basic implementation of DSWriter. Subclasses must implement the abstract + methods which all start + with write. +
          +
          +
          See Also:
          +
          DSIWriter
          +
          +
        • +
        +
    +
    +
      +
    • + +
        +
      • + + +

        Field Summary

        + + + + + + + + + + +
        Fields 
        Modifier and TypeField and Description
        protected booleanprettyPrint +
        Subclasses can use this if applicable.
        +
        +
      • +
      + +
        +
      • + + +

        Constructor Summary

        + + + + + + + + +
        Constructors 
        Constructor and Description
        AbstractWriter()  +
        +
      • +
      + +
        +
      • + + +

        Method Summary

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        All Methods Instance Methods Abstract Methods Concrete Methods 
        Modifier and TypeMethod and Description
        AbstractWriter + beginList() +
        Start a new list and return this.
        +
        AbstractWriter + beginList(int size) +
        Start a new list of the given size and return this.
        +
        AbstractWriter + beginMap() +
        Start a new map and return this.
        +
        AbstractWriter + beginMap(int size) +
        Start a new map of the given size and return this.
        +
        AbstractWriter + endList() +
        End the current list.
        +
        AbstractWriter + endMap() +
        End the current map.
        +
        protected intgetDepth() +
        Current depth in the tree, will be needed by + writeNewLineIndent. +
        +
        AbstractWriter + key(java.lang.CharSequence arg) +
        Write a key in the current map.
        +
        intlength() +
        Returns 0 by default.
        +
        AbstractWriter + reset() +
        Clears the state of the writer.
        +
        AbstractWriter + value(boolean arg) +
        Write a value to the map or list.
        +
        AbstractWriter + value(byte[] arg) +
        Write a value to the map or list.
        +
        AbstractWriter + value(double arg) +
        Write a value to the map or list.
        +
        AbstractWriter + value(DSElement arg) +
        Write a value to the map or list.
        +
        AbstractWriter + value(int arg) +
        Write a value to the map or list.
        +
        AbstractWriter + value(long arg) +
        Write a value to the map or list.
        +
        AbstractWriter + value(java.lang.String arg) +
        Write a value to the map or list.
        +
        protected abstract voidwrite(boolean arg) +
        Write the value.
        +
        protected abstract voidwrite(byte[] arg) +
        Write the value.
        +
        protected abstract voidwrite(double arg) +
        Write the value.
        +
        protected abstract voidwrite(long arg) +
        Write the value.
        +
        protected abstract voidwriteKey(java.lang.CharSequence arg) +
        Write string key of a map entry.
        +
        protected abstract voidwriteKeyValueSeparator() +
        Separate the key from the value in a map.
        +
        protected abstract voidwriteListEnd() +
        End the current list.
        +
        protected abstract voidwriteListStart(int size) +
        Start a new list.
        +
        protected abstract voidwriteMapEnd() +
        End the current map.
        +
        protected abstract voidwriteMapStart(int size) +
        Start a new map.
        +
        protected voidwriteNewLineIndent() +
        Override point for subclasses which perform use pretty + printing, such as json. +
        +
        protected abstract voidwriteNull() +
        Write a null value.
        +
        protected abstract voidwriteSeparator() +
        Write a value separator, such as the comma in json.
        +
        protected abstract voidwriteValue(java.lang.CharSequence arg) +
        Write the value, which will never be null.
        +
        +
          +
        • + + +

          Methods inherited from class java.lang.Object

          + clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, + wait, wait, wait
        • +
        + +
      • +
      +
    • +
    +
    +
    +
      +
    • + +
        +
      • + + +

        Field Detail

        + + + +
          +
        • +

          prettyPrint

          +
          protected boolean prettyPrint
          +
          Subclasses can use this if applicable.
          +
        • +
        +
      • +
      + +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          AbstractWriter

          +
          public AbstractWriter()
          +
        • +
        +
      • +
      + +
        +
      • + + +

        Method Detail

        + + + + + + + +
          +
        • +

          beginList

          +
          public AbstractWriter beginList(int size)
          +
          Description copied from interface: DSIWriter +
          +
          Start a new list of the given size and return this.
          +
          +
          Specified by:
          +
          beginList in + interface DSIWriter +
          +
          Parameters:
          +
          size - Less than zero means the size is unknown.
          +
          +
        • +
        + + + +
          +
        • +

          beginMap

          +
          public AbstractWriter beginMap()
          +
          Description copied from interface: DSIWriter +
          +
          Start a new map and return this.
          +
          +
          Specified by:
          +
          beginMap in + interface DSIWriter +
          +
          +
        • +
        + + + +
          +
        • +

          beginMap

          +
          public AbstractWriter beginMap(int size)
          +
          Description copied from interface: DSIWriter +
          +
          Start a new map of the given size and return this.
          +
          +
          Specified by:
          +
          beginMap in + interface DSIWriter +
          +
          Parameters:
          +
          size - Less than zero means the size is unknown.
          +
          +
        • +
        + + + + + + + + + + + +
          +
        • +

          getDepth

          +
          protected int getDepth()
          +
          Current depth in the tree, will be needed by + writeNewLineIndent. +
          +
        • +
        + + + +
          +
        • +

          key

          +
          public AbstractWriter key(java.lang.CharSequence arg)
          +
          Description copied from interface: DSIWriter +
          +
          Write a key in the current map. Cannot be called in a list, must + be followed by a call to + one of the value methods. +
          +
          +
          Specified by:
          +
          key in + interface DSIWriter +
          +
          +
        • +
        + + + +
          +
        • +

          length

          +
          public int length()
          +
          Returns 0 by default.
          +
          +
          Specified by:
          +
          length in + interface DSIWriter +
          +
          +
        • +
        + + + +
          +
        • +

          reset

          +
          public AbstractWriter reset()
          +
          Description copied from interface: DSIWriter +
          +
          Clears the state of the writer.
          +
          +
          Specified by:
          +
          reset in + interface DSIWriter +
          +
          +
        • +
        + + + +
          +
        • +

          value

          +
          public AbstractWriter value(DSElement arg)
          +
          Description copied from interface: DSIWriter +
          +
          Write a value to the map or list. If in a map, this must have + been preceded by a call to + key(String). This can be used to encode an entire graph. +
          +
          +
          Specified by:
          +
          value in + interface DSIWriter +
          +
          +
        • +
        + + + +
          +
        • +

          value

          +
          public AbstractWriter value(boolean arg)
          +
          Description copied from interface: DSIWriter +
          +
          Write a value to the map or list. If in a map, this must have + been preceded by a call to + key(String). +
          +
          +
          Specified by:
          +
          value in + interface DSIWriter +
          +
          +
        • +
        + + + +
          +
        • +

          value

          +
          public AbstractWriter value(byte[] arg)
          +
          Description copied from interface: DSIWriter +
          +
          Write a value to the map or list. If in a map, this must have + been preceded by a call to + key(String). +
          +
          +
          Specified by:
          +
          value in + interface DSIWriter +
          +
          +
        • +
        + + + +
          +
        • +

          value

          +
          public AbstractWriter value(double arg)
          +
          Description copied from interface: DSIWriter +
          +
          Write a value to the map or list. If in a map, this must have + been preceded by a call to + key(String). +
          +
          +
          Specified by:
          +
          value in + interface DSIWriter +
          +
          +
        • +
        + + + +
          +
        • +

          value

          +
          public AbstractWriter value(int arg)
          +
          Description copied from interface: DSIWriter +
          +
          Write a value to the map or list. If in a map, this must have + been preceded by a call to + key(String). +
          +
          +
          Specified by:
          +
          value in + interface DSIWriter +
          +
          +
        • +
        + + + +
          +
        • +

          value

          +
          public AbstractWriter value(long arg)
          +
          Description copied from interface: DSIWriter +
          +
          Write a value to the map or list. If in a map, this must have + been preceded by a call to + key(String). +
          +
          +
          Specified by:
          +
          value in + interface DSIWriter +
          +
          +
        • +
        + + + +
          +
        • +

          value

          +
          public AbstractWriter value(java.lang.String arg)
          +
          Description copied from interface: DSIWriter +
          +
          Write a value to the map or list. If in a map, this must have + been preceded by a call to + key(String). +
          +
          +
          Specified by:
          +
          value in + interface DSIWriter +
          +
          +
        • +
        + + + +
          +
        • +

          write

          +
          protected abstract void write(boolean arg)
                                  throws java.io.IOException
          -
          Write the value.
          -
          -
          Throws:
          -
          java.io.IOException
          -
          -
        • -
        - - - -
          -
        • -

          write

          -
          protected abstract void write(byte[] arg)
          +                
          Write the value.
          +
          +
          Throws:
          +
          java.io.IOException
          +
          +
        • +
        + + + +
          +
        • +

          write

          +
          protected abstract void write(byte[] arg)
                                  throws java.io.IOException
          -
          Write the value.
          -
          -
          Throws:
          -
          java.io.IOException
          -
          -
        • -
        - - - -
          -
        • -

          write

          -
          protected abstract void write(double arg)
          +                
          Write the value.
          +
          +
          Throws:
          +
          java.io.IOException
          +
          +
        • +
        + + + +
          +
        • +

          write

          +
          protected abstract void write(double arg)
                                  throws java.io.IOException
          -
          Write the value.
          -
          -
          Throws:
          -
          java.io.IOException
          -
          -
        • -
        - - - -
          -
        • -

          write

          -
          protected abstract void write(long arg)
          +                
          Write the value.
          +
          +
          Throws:
          +
          java.io.IOException
          +
          +
        • +
        + + + +
          +
        • +

          write

          +
          protected abstract void write(long arg)
                                  throws java.io.IOException
          -
          Write the value.
          -
          -
          Throws:
          -
          java.io.IOException
          -
          -
        • -
        - - - -
          -
        • -

          writeKey

          -
          protected abstract void writeKey(java.lang.CharSequence arg)
          +                
          Write the value.
          +
          +
          Throws:
          +
          java.io.IOException
          +
          +
        • +
        + + + +
          +
        • +

          writeKey

          +
          protected abstract void writeKey(java.lang.CharSequence arg)
                                     throws java.io.IOException
          -
          Write string key of a map entry.
          -
          -
          Throws:
          -
          java.io.IOException
          -
          -
        • -
        - - - -
          -
        • -

          writeKeyValueSeparator

          -
          protected abstract void writeKeyValueSeparator()
          +                
          Write string key of a map entry.
          +
          +
          Throws:
          +
          java.io.IOException
          +
          +
        • +
        + + + +
          +
        • +

          writeKeyValueSeparator

          +
          protected abstract void writeKeyValueSeparator()
                                                   throws java.io.IOException
          -
          Separate the key from the value in a map.
          -
          -
          Throws:
          -
          java.io.IOException
          -
          -
        • -
        - - - -
          -
        • -

          writeListEnd

          -
          protected abstract void writeListEnd()
          +                
          Separate the key from the value in a map.
          +
          +
          Throws:
          +
          java.io.IOException
          +
          +
        • +
        + + + +
          +
        • +

          writeListEnd

          +
          protected abstract void writeListEnd()
                                         throws java.io.IOException
          -
          End the current list.
          -
          -
          Throws:
          -
          java.io.IOException
          -
          -
        • -
        - - - -
          -
        • -

          writeListStart

          -
          protected abstract void writeListStart(int size)
          +                
          End the current list.
          +
          +
          Throws:
          +
          java.io.IOException
          +
          +
        • +
        + + + +
          +
        • +

          writeListStart

          +
          protected abstract void writeListStart(int size)
                                           throws java.io.IOException
          -
          Start a new list.
          -
          -
          Throws:
          -
          java.io.IOException
          -
          -
        • -
        - - - -
          -
        • -

          writeMapEnd

          -
          protected abstract void writeMapEnd()
          +                
          Start a new list.
          +
          +
          Throws:
          +
          java.io.IOException
          +
          +
        • +
        + + + +
          +
        • +

          writeMapEnd

          +
          protected abstract void writeMapEnd()
                                        throws java.io.IOException
          -
          End the current map.
          -
          -
          Throws:
          -
          java.io.IOException
          -
          -
        • -
        - - - -
          -
        • -

          writeMapStart

          -
          protected abstract void writeMapStart(int size)
          +                
          End the current map.
          +
          +
          Throws:
          +
          java.io.IOException
          +
          +
        • +
        + + + +
          +
        • +

          writeMapStart

          +
          protected abstract void writeMapStart(int size)
                                          throws java.io.IOException
          -
          Start a new map.
          -
          -
          Throws:
          -
          java.io.IOException
          -
          -
        • -
        - - - -
          -
        • -

          writeNewLineIndent

          -
          protected void writeNewLineIndent()
          +                
          Start a new map.
          +
          +
          Throws:
          +
          java.io.IOException
          +
          +
        • +
        + + + +
          +
        • +

          writeNewLineIndent

          +
          protected void writeNewLineIndent()
                                      throws java.io.IOException
          -
          Override point for subclasses which perform use pretty printing, such as json. Does nothing - by default.
          -
          -
          Throws:
          -
          java.io.IOException
          -
          See Also:
          -
          getDepth()
          -
          -
        • -
        - - - -
          -
        • -

          writeNull

          -
          protected abstract void writeNull()
          +                
          Override point for subclasses which perform use pretty printing, + such as json. Does nothing + by default. +
          +
          +
          Throws:
          +
          java.io.IOException
          +
          See Also:
          +
          getDepth() +
          +
          +
        • +
        + + + +
          +
        • +

          writeNull

          +
          protected abstract void writeNull()
                                      throws java.io.IOException
          -
          Write a null value.
          -
          -
          Throws:
          -
          java.io.IOException
          -
          -
        • -
        - - - -
          -
        • -

          writeSeparator

          -
          protected abstract void writeSeparator()
          +                
          Write a null value.
          +
          +
          Throws:
          +
          java.io.IOException
          +
          +
        • +
        + + + +
          +
        • +

          writeSeparator

          +
          protected abstract void writeSeparator()
                                           throws java.io.IOException
          -
          Write a value separator, such as the comma in json.
          -
          -
          Throws:
          -
          java.io.IOException
          -
          -
        • -
        - - - -
          -
        • -

          writeValue

          -
          protected abstract void writeValue(java.lang.CharSequence arg)
          +                
          Write a value separator, such as the comma in json.
          +
          +
          Throws:
          +
          java.io.IOException
          +
          +
        • +
        + + + +
          +
        • +

          writeValue

          +
          protected abstract void writeValue(java.lang.CharSequence arg)
                                       throws java.io.IOException
          -
          Write the value, which will never be null.
          -
          -
          Throws:
          -
          java.io.IOException
          -
          -
        • -
        -
      • -
      -
    • -
    -
    +
    Write the value, which will never be null.
    +
    +
    Throws:
    +
    java.io.IOException
    +
    +
  • +
+ + + + +
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/io/DSBase64.html b/docs/javadoc/org/iot/dsa/io/DSBase64.html index 1624870a..0191cb06 100644 --- a/docs/javadoc/org/iot/dsa/io/DSBase64.html +++ b/docs/javadoc/org/iot/dsa/io/DSBase64.html @@ -1,12 +1,13 @@ - + - -DSBase64 (dslink-core 0.15.0 API) - - - + + DSBase64 (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.io
-

Class DSBase64

+
org.iot.dsa.io
+

Class DSBase64

-
    -
  • java.lang.Object
  • -
  • -
      -
    • org.iot.dsa.io.DSBase64
    • -
    -
  • -
-
-
    -
  • -
    -
    -
    public class DSBase64
    +  
      +
    • java.lang.Object
    • +
    • +
        +
      • org.iot.dsa.io.DSBase64
      • +
      +
    • +
    +
    +
      +
    • +
      +
      +
      public class DSBase64
       extends java.lang.Object
      -
      Thread-safe Base64 encoder and decoder. This only exists because we need to be compatible with - Java 6.
      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Constructor Summary

        - - - - - - - - -
        Constructors 
        Constructor and Description
        DSBase64() 
        -
      • -
      - -
        -
      • - - -

        Method Summary

        - - - - - - - - - - - - - - - - - - - - - - -
        All Methods Static Methods Concrete Methods 
        Modifier and TypeMethod and Description
        static byte[]decode(java.lang.String str) -
        Decodes a base 64 encoded string.
        -
        static java.lang.Stringencode(byte[] buf) -
        Encodes the bytes into a single line string with no padding.
        -
        static java.lang.Stringencode(byte[] buf, - int linelen) -
        Encodes the buffer into a String with the given line length.
        -
        static java.lang.StringencodeUrl(byte[] bytes) -
        Encodes to a URL safe base64 string.
        -
        -
          -
        • - - -

          Methods inherited from class java.lang.Object

          -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
        • -
        -
      • -
      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Constructor Detail

        - - - -
          -
        • -

          DSBase64

          -
          public DSBase64()
          -
        • -
        -
      • -
      - -
        -
      • - - -

        Method Detail

        - - - -
          -
        • -

          decode

          -
          public static byte[] decode(java.lang.String str)
          -
          Decodes a base 64 encoded string. Will decodeKeys both url safe and unsafe.
          -
          -
          Parameters:
          -
          str - Most not be null.
          -
          Returns:
          -
          Never null.
          -
          Throws:
          -
          java.lang.IllegalArgumentException - If anything is wrong with the parameter.
          -
          -
        • -
        - - - -
          -
        • -

          encode

          -
          public static java.lang.String encode(byte[] buf)
          -
          Encodes the bytes into a single line string with no padding.
          -
          -
          Parameters:
          -
          buf - The bytes to encode.
          -
          Returns:
          -
          The encoding.
          -
          -
        • -
        - - - -
          -
        • -

          encode

          -
          public static java.lang.String encode(byte[] buf,
          +        
          Thread-safe Base64 encoder and decoder. This only exists because we need + to be compatible with + Java 6. +
          +
        • +
        +
    +
    +
      +
    • + +
        +
      • + + +

        Constructor Summary

        + + + + + + + + +
        Constructors 
        Constructor and Description
        DSBase64()  +
        +
      • +
      + +
        +
      • + + +

        Method Summary

        + + + + + + + + + + + + + + + + + + + + + + +
        All Methods Static Methods Concrete Methods 
        Modifier and TypeMethod and Description
        static byte[]decode(java.lang.String str) +
        Decodes a base 64 encoded string.
        +
        static java.lang.Stringencode(byte[] buf) +
        Encodes the bytes into a single line string with no padding. +
        +
        static java.lang.Stringencode(byte[] buf, + int linelen) +
        Encodes the buffer into a String with the given line length. +
        +
        static java.lang.StringencodeUrl(byte[] bytes) +
        Encodes to a URL safe base64 string.
        +
        +
          +
        • + + +

          Methods inherited from class java.lang.Object

          + clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, + wait, wait, wait
        • +
        +
      • +
      +
    • +
    +
    +
    +
      +
    • + +
        +
      • + + +

        Constructor Detail

        + + + +
          +
        • +

          DSBase64

          +
          public DSBase64()
          +
        • +
        +
      • +
      + +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          decode

          +
          public static byte[] decode(java.lang.String str)
          +
          Decodes a base 64 encoded string. Will decodeKeys both url safe + and unsafe. +
          +
          +
          Parameters:
          +
          str - Most not be null.
          +
          Returns:
          +
          Never null.
          +
          Throws:
          +
          java.lang.IllegalArgumentException - If anything is wrong with + the parameter. +
          +
          +
        • +
        + + + +
          +
        • +

          encode

          +
          public static java.lang.String encode(byte[] buf)
          +
          Encodes the bytes into a single line string with no padding. +
          +
          +
          Parameters:
          +
          buf - The bytes to encode.
          +
          Returns:
          +
          The encoding.
          +
          +
        • +
        + + + +
          +
        • +

          encode

          +
          public static java.lang.String encode(byte[] buf,
                                                 int linelen)
          -
          Encodes the buffer into a String with the given line length. Lines will be padded to the - given length.
          -
          -
          Parameters:
          -
          buf - The bytes to encode.
          -
          linelen - A number greater than zero limits the number of characters before an - interleaving newline.
          -
          Returns:
          -
          The encoding.
          -
          -
        • -
        - - - -
          -
        • -

          encodeUrl

          -
          public static java.lang.String encodeUrl(byte[] bytes)
          -
          Encodes to a URL safe base64 string. Replaces / with _ and + with -.
          -
        • -
        -
      • -
      -
    • -
    -
    +
    Encodes the buffer into a String with the given line length. + Lines will be padded to the + given length. +
    +
    +
    Parameters:
    +
    buf - The bytes to encode.
    +
    linelen - A number greater than zero limits the number of + characters before an + interleaving newline. +
    +
    Returns:
    +
    The encoding.
    +
    +
  • +
+ + + +
    +
  • +

    encodeUrl

    +
    public static java.lang.String encodeUrl(byte[] bytes)
    +
    Encodes to a URL safe base64 string. Replaces / with _ and + with + -. +
    +
  • +
+ + + + +
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/io/DSIReader.Token.html b/docs/javadoc/org/iot/dsa/io/DSIReader.Token.html index 8e3b16e4..e30a9f6d 100644 --- a/docs/javadoc/org/iot/dsa/io/DSIReader.Token.html +++ b/docs/javadoc/org/iot/dsa/io/DSIReader.Token.html @@ -1,12 +1,13 @@ - + - -DSIReader.Token (dslink-core 0.15.0 API) - - - + + DSIReader.Token (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.io
-

Enum DSIReader.Token

+
org.iot.dsa.io
+

Enum DSIReader.Token

-
    -
  • java.lang.Object
  • -
  • -
      -
    • java.lang.Enum<DSIReader.Token>
    • -
    • -
        -
      • org.iot.dsa.io.DSIReader.Token
      • -
      -
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    java.io.Serializable, java.lang.Comparable<DSIReader.Token>
    -
    -
    -
    Enclosing interface:
    -
    DSIReader
    -
    -
    -
    -
    public static enum DSIReader.Token
    -extends java.lang.Enum<DSIReader.Token>
    -
    Represents the state of the reader, and determines which getter should be called next.
    -
  • -
-
-
-
    -
  • - - - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - -
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static DSIReader.TokenvalueOf(java.lang.String name) -
      Returns the enum constant of this type with the specified name.
      -
      static DSIReader.Token[]values() -
      Returns an array containing the constants of this enum type, in -the order they are declared.
      -
      -
        -
      • - - -

        Methods inherited from class java.lang.Enum

        -clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • -
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -getClass, notify, notifyAll, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - - - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        values

        -
        public static DSIReader.Token[] values()
        -
        Returns an array containing the constants of this enum type, in -the order they are declared. This method may be used to iterate -over the constants as follows: -
        +  
          +
        • java.lang.Object
        • +
        • +
            +
          • java.lang.Enum<DSIReader.Token> +
          • +
          • +
              +
            • org.iot.dsa.io.DSIReader.Token
            • +
            +
          • +
          +
        • +
        +
        +
          +
        • +
          +
          All Implemented Interfaces:
          +
          java.io.Serializable, java.lang.Comparable<DSIReader.Token> +
          +
          +
          +
          Enclosing interface:
          +
          DSIReader
          +
          +
          +
          +
          public static enum DSIReader.Token
          +extends java.lang.Enum<DSIReader.Token>
          +
          Represents the state of the reader, and determines which getter should be + called next. +
          +
        • +
        +
        +
        +
          +
        • + + + +
            +
          • + + +

            Method Summary

            + + + + + + + + + + + + + + +
            All Methods Static Methods Concrete Methods 
            Modifier and TypeMethod and Description
            static DSIReader.TokenvalueOf(java.lang.String name) +
            Returns the enum constant of this type with the specified + name. +
            +
            static DSIReader.Token[]values() +
            Returns an array containing the constants of this enum type, in + the order they are declared. +
            +
            +
              +
            • + + +

              Methods inherited from class java.lang.Enum

              + clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, + ordinal, toString, valueOf
            • +
            +
              +
            • + + +

              Methods inherited from class java.lang.Object

              + getClass, notify, notifyAll, wait, wait, wait
            • +
            +
          • +
          +
        • +
        +
        +
        +
          +
        • + + + +
            +
          • + + +

            Method Detail

            + + + +
              +
            • +

              values

              +
              public static DSIReader.Token[] values()
              +
              Returns an array containing the constants of this enum type, in + the order they are declared. This method may be used to iterate + over the constants as follows: +
               for (DSIReader.Token c : DSIReader.Token.values())
                   System.out.println(c);
              -
              -
              -
              Returns:
              -
              an array containing the constants of this enum type, in the order they are declared
              -
              -
            • -
            - - - -
              -
            • -

              valueOf

              -
              public static DSIReader.Token valueOf(java.lang.String name)
              -
              Returns the enum constant of this type with the specified name. -The string must match exactly an identifier used to declare an -enum constant in this type. (Extraneous whitespace characters are -not permitted.)
              -
              -
              Parameters:
              -
              name - the name of the enum constant to be returned.
              -
              Returns:
              -
              the enum constant with the specified name
              -
              Throws:
              -
              java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
              -
              java.lang.NullPointerException - if the argument is null
              -
              -
            • -
            -
          • -
          -
        • -
        -
        +
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are + declared +
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static DSIReader.Token valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. + The string must match exactly an identifier used to declare an + enum constant in this type. (Extraneous whitespace characters are + not permitted.) +
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no + constant with the specified name +
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/io/DSIReader.html b/docs/javadoc/org/iot/dsa/io/DSIReader.html index b64689d2..7472153d 100644 --- a/docs/javadoc/org/iot/dsa/io/DSIReader.html +++ b/docs/javadoc/org/iot/dsa/io/DSIReader.html @@ -1,12 +1,13 @@ - + - -DSIReader (dslink-core 0.15.0 API) - - - + + DSIReader (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.io
-

Interface DSIReader

+
org.iot.dsa.io
+

Interface DSIReader

-
-
    -
  • -
    -
    All Superinterfaces:
    -
    java.lang.AutoCloseable, java.io.Closeable
    -
    -
    -
    All Known Implementing Classes:
    -
    AbstractReader, JsonReader, MsgpackReader
    -
    -
    -
    -
    public interface DSIReader
    +  
    +
      +
    • +
      +
      All Superinterfaces:
      +
      java.lang.AutoCloseable, java.io.Closeable
      +
      +
      +
      All Known Implementing Classes:
      +
      AbstractReader, JsonReader, MsgpackReader
      +
      +
      +
      +
      public interface DSIReader
       extends java.io.Closeable
      -
      A decoder that can be used to get an entire graph in pieces, or one large group, or somewhere in - between. To get an entire graph, call getElement(), getMap() or getList(). Otherwise, use the - next() method to iterate the elements of the input. +
      A decoder that can be used to get an entire graph in pieces, or one large + group, or somewhere in + between. To get an entire graph, call getElement(), getMap() or getList(). Otherwise, use + the + next() method to iterate the elements of the input. -

      +

      - When next() returns: + When next() returns: -

        +
          -
        • ROOT - The initial state, not in a list or map, call next() or getElement(). +
        • ROOT - The initial state, not in a list or map, call next() or getElement(). -
        • BEGIN_LIST - Call getList() to decodeKeys the entire list, or call next again to get the - first element of the list (or END_LIST if empty). +
        • BEGIN_LIST - Call getList() to decodeKeys the entire list, or call next again to get + the + first element of the list (or END_LIST if empty). -
        • BEGIN_MAP - Call getMap() to decodeKeys the entire map, or call next again to get the first - key of the map (or END_MAP if empty). +
        • BEGIN_MAP - Call getMap() to decodeKeys the entire map, or call next again to get + the first + key of the map (or END_MAP if empty). -
        • END_INPUT - Parsing is finished, close the reader. +
        • END_INPUT - Parsing is finished, close the reader. -
        • END_LIST - The current list is complete, call next again. +
        • END_LIST - The current list is complete, call next again. -
        • END_MAP - The current map is complete, call next again. +
        • END_MAP - The current map is complete, call next again. -
        • BOOLEAN,DOUBLE,LONG,NULL,STRING - Call getElement() or the corresponding getter. +
        • BOOLEAN,DOUBLE,LONG,NULL,STRING - Call getElement() or the corresponding getter. -
        +
      -

      +

      - Be aware that if the underlying encoding (such as JSON) doesn't provide a mechanism to - differentiate between data types (such as numbers), values might not get as the same type they - were encoded.

      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Nested Class Summary

        - - - - - - - - - - -
        Nested Classes 
        Modifier and TypeInterface and Description
        static class DSIReader.Token -
        Represents the state of the reader, and determines which getter should be called next.
        -
        -
      • -
      - -
        -
      • - - -

        Method Summary

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        All Methods Instance Methods Abstract Methods 
        Modifier and TypeMethod and Description
        voidclose() -
        Close the input.
        -
        booleangetBoolean() -
        Returns the value when last() == BOOLEAN.
        -
        byte[]getBytes() -
        Returns the value when last() == BYTES.
        -
        doublegetDouble() -
        Returns the value when last() == DOUBLE.
        -
        DSElementgetElement() -
        Returns the DSElement when last() == raw type or ROOT.
        -
        DSListgetList() -
        This should only be called when last() == BEGIN_LIST and it will decodeKeys the entire - list.
        -
        longgetLong() -
        Returns the value when last() == LONG.
        -
        DSMapgetMap() -
        This should only be called when last() == BEGIN_MAP and it will decodeKeys the entire map.
        -
        java.lang.StringgetString() -
        Returns the value when last() == STRING.
        -
        DSIReader.Tokenlast() -
        The last value returned from next().
        -
        DSIReader.Tokennext() -
        Advances the reader to the next item and returns the token representing it's current state.
        -
        DSIReaderreset() -
        Sets last() == ROOT.
        -
        -
      • -
      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Method Detail

        - - - -
          -
        • -

          close

          -
          void close()
          -
          Close the input.
          -
          -
          Specified by:
          -
          close in interface java.lang.AutoCloseable
          -
          Specified by:
          -
          close in interface java.io.Closeable
          -
          -
        • -
        - - - -
          -
        • -

          getBoolean

          -
          boolean getBoolean()
          -
          Returns the value when last() == BOOLEAN.
          -
        • -
        - - - -
          -
        • -

          getBytes

          -
          byte[] getBytes()
          -
          Returns the value when last() == BYTES.
          -
        • -
        - - - -
          -
        • -

          getDouble

          -
          double getDouble()
          -
          Returns the value when last() == DOUBLE.
          -
        • -
        - - - -
          -
        • -

          getElement

          -
          DSElement getElement()
          -
          Returns the DSElement when last() == raw type or ROOT.
          -
        • -
        - - - -
          -
        • -

          getLong

          -
          long getLong()
          -
          Returns the value when last() == LONG.
          -
        • -
        - - - -
          -
        • -

          getList

          -
          DSList getList()
          -
          This should only be called when last() == BEGIN_LIST and it will decodeKeys the entire - list. Call next rather than this method to get the list in pieces.
          -
        • -
        - - - -
          -
        • -

          getMap

          -
          DSMap getMap()
          -
          This should only be called when last() == BEGIN_MAP and it will decodeKeys the entire map. - Call next rather than this method get the map in pieces.
          -
        • -
        - - - -
          -
        • -

          getString

          -
          java.lang.String getString()
          -
          Returns the value when last() == STRING.
          -
        • -
        - - - -
          -
        • -

          last

          -
          DSIReader.Token last()
          -
          The last value returned from next(). At the beginning of a document, before next has been - called, this will return ROOT.
          -
        • -
        - - - -
          -
        • -

          next

          -
          DSIReader.Token next()
          -
          Advances the reader to the next item and returns the token representing it's current state.
          -
        • -
        - - - -
          -
        • -

          reset

          -
          DSIReader reset()
          -
          Sets last() == ROOT.
          -
        • -
        -
      • -
      -
    • -
    -
    + Be aware that if the underlying encoding (such as JSON) doesn't provide a mechanism to + differentiate between data types (such as numbers), values might not get as the same + type they + were encoded.
+ + +
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeInterface and Description
      static class DSIReader.Token +
      Represents the state of the reader, and determines which getter + should be called next. +
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      voidclose() +
      Close the input.
      +
      booleangetBoolean() +
      Returns the value when last() == BOOLEAN.
      +
      byte[]getBytes() +
      Returns the value when last() == BYTES.
      +
      doublegetDouble() +
      Returns the value when last() == DOUBLE.
      +
      DSElement + getElement() +
      Returns the DSElement when last() == raw type or ROOT.
      +
      DSList + getList() +
      This should only be called when last() == BEGIN_LIST and it + will decodeKeys the entire + list. +
      +
      longgetLong() +
      Returns the value when last() == LONG.
      +
      DSMap + getMap() +
      This should only be called when last() == BEGIN_MAP and it will + decodeKeys the entire map. +
      +
      java.lang.StringgetString() +
      Returns the value when last() == STRING.
      +
      DSIReader.Token + last() +
      The last value returned from next().
      +
      DSIReader.Token + next() +
      Advances the reader to the next item and returns the token + representing it's current state. +
      +
      DSIReader + reset() +
      Sets last() == ROOT.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        close

        +
        void close()
        +
        Close the input.
        +
        +
        Specified by:
        +
        close in interface java.lang.AutoCloseable +
        +
        Specified by:
        +
        close in interface java.io.Closeable
        +
        +
      • +
      + + + +
        +
      • +

        getBoolean

        +
        boolean getBoolean()
        +
        Returns the value when last() == BOOLEAN.
        +
      • +
      + + + +
        +
      • +

        getBytes

        +
        byte[] getBytes()
        +
        Returns the value when last() == BYTES.
        +
      • +
      + + + +
        +
      • +

        getDouble

        +
        double getDouble()
        +
        Returns the value when last() == DOUBLE.
        +
      • +
      + + + +
        +
      • +

        getElement

        +
        DSElement getElement()
        +
        Returns the DSElement when last() == raw type or ROOT.
        +
      • +
      + + + +
        +
      • +

        getLong

        +
        long getLong()
        +
        Returns the value when last() == LONG.
        +
      • +
      + + + +
        +
      • +

        getList

        +
        DSList getList()
        +
        This should only be called when last() == BEGIN_LIST and it will + decodeKeys the entire + list. Call next rather than this method to get the list in pieces. +
        +
      • +
      + + + +
        +
      • +

        getMap

        +
        DSMap getMap()
        +
        This should only be called when last() == BEGIN_MAP and it will + decodeKeys the entire map. + Call next rather than this method get the map in pieces. +
        +
      • +
      + + + +
        +
      • +

        getString

        +
        java.lang.String getString()
        +
        Returns the value when last() == STRING.
        +
      • +
      + + + +
        +
      • +

        last

        +
        DSIReader.Token last()
        +
        The last value returned from next(). At the beginning of a + document, before next has been + called, this will return ROOT. +
        +
      • +
      + + + +
        +
      • +

        next

        +
        DSIReader.Token next()
        +
        Advances the reader to the next item and returns the token + representing it's current state. +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        DSIReader reset()
        +
        Sets last() == ROOT.
        +
      • +
      +
    • +
    +
  • +
+
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/io/DSIWriter.html b/docs/javadoc/org/iot/dsa/io/DSIWriter.html index 4da4f7af..64d5b20f 100644 --- a/docs/javadoc/org/iot/dsa/io/DSIWriter.html +++ b/docs/javadoc/org/iot/dsa/io/DSIWriter.html @@ -1,12 +1,13 @@ - + - -DSIWriter (dslink-core 0.15.0 API) - - - + + DSIWriter (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.io
-

Interface DSIWriter

+
org.iot.dsa.io
+

Interface DSIWriter

-
-
    -
  • -
    -
    All Superinterfaces:
    -
    java.lang.AutoCloseable, java.io.Closeable
    -
    -
    -
    All Known Implementing Classes:
    -
    AbstractJsonWriter, AbstractWriter, JsonAppender, JsonWriter, MsgpackWriter
    -
    -
    -
    -
    public interface DSIWriter
    +  
    +
      +
    • +
      +
      All Superinterfaces:
      +
      java.lang.AutoCloseable, java.io.Closeable
      +
      +
      +
      All Known Implementing Classes:
      +
      AbstractJsonWriter, AbstractWriter, + JsonAppender, JsonWriter, MsgpackWriter
      +
      +
      +
      +
      public interface DSIWriter
       extends java.io.Closeable
      -
      An encoder that can be used to encode large graphs with or without object instances. +
      An encoder that can be used to encode large graphs with or without object + instances. -

      +

      - To simply encode a DSMap or DSList, use the value(DSElement) method. + To simply encode a DSMap or DSList, use the value(DSElement) method. - For example: + For example: -

        +
          -
        • new JsonWriter(out).value(myMap).close(); +
        • new JsonWriter(out).value(myMap).close(); -
        +
      -

      +

      - Otherwise, you can stream data struct without using any DSIObject instances: + Otherwise, you can stream data struct without using any DSIObject instances: -

        +
          -
        • out.newMap().key("a").value(1).key("b").value(2).key("c").value(3).endMap(); +
        • out.newMap().key("a").value(1).key("b").value(2).key("c").value(3).endMap(); -
        +
      -

      +

      - Be aware that if the underlying encoding (such as JSON) doesn't provide a mechanism to - differentiate between data types (such as numbers), values might not get as the same type they - were encoded.

      -
    • -
    -
    -
    - -
    -
    -
      -
    • - -
        -
      • - - -

        Method Detail

        - - - -
          -
        • -

          beginList

          -
          DSIWriter beginList()
          -
          Start a new list and return this.
          -
          -
          Throws:
          -
          java.lang.IllegalStateException - when improperly called.
          -
          -
        • -
        - - - -
          -
        • -

          beginList

          -
          DSIWriter beginList(int size)
          -
          Start a new list of the given size and return this.
          -
          -
          Parameters:
          -
          size - Less than zero means the size is unknown.
          -
          Throws:
          -
          java.lang.IllegalStateException - when improperly called.
          -
          -
        • -
        - - - -
          -
        • -

          beginMap

          -
          DSIWriter beginMap()
          -
          Start a new map and return this.
          -
          -
          Throws:
          -
          java.lang.IllegalStateException - when improperly called.
          -
          -
        • -
        - - - -
          -
        • -

          beginMap

          -
          DSIWriter beginMap(int size)
          -
          Start a new map of the given size and return this.
          -
          -
          Parameters:
          -
          size - Less than zero means the size is unknown.
          -
          Throws:
          -
          java.lang.IllegalStateException - when improperly called.
          -
          -
        • -
        - - - -
          -
        • -

          close

          -
          void close()
          -
          Close the stream. IOExceptions will be wrapped in runtime exceptions.
          -
          -
          Specified by:
          -
          close in interface java.lang.AutoCloseable
          -
          Specified by:
          -
          close in interface java.io.Closeable
          -
          -
        • -
        - - - -
          -
        • -

          endList

          -
          DSIWriter endList()
          -
          End the current list.
          -
          -
          Throws:
          -
          java.lang.IllegalStateException - when improperly called.
          -
          -
        • -
        - - - -
          -
        • -

          endMap

          -
          DSIWriter endMap()
          -
          End the current map.
          -
          -
          Throws:
          -
          java.lang.IllegalStateException - when improperly called.
          -
          -
        • -
        - - - -
          -
        • -

          flush

          -
          DSIWriter flush()
          -
          Flush the stream. IOExceptions will be wrapped in runtime exceptions.
          -
        • -
        - - - -
          -
        • -

          key

          -
          DSIWriter key(java.lang.CharSequence key)
          -
          Write a key in the current map. Cannot be called in a list, must be followed by a call to - one of the value methods.
          -
          -
          Throws:
          -
          java.lang.IllegalStateException - when improperly called.
          -
          -
        • -
        - - - -
          -
        • -

          length

          -
          int length()
          -
          If the writer is buffering output, this returns the size of that buffer.
          -
        • -
        - - - -
          -
        • -

          reset

          -
          DSIWriter reset()
          -
          Clears the state of the writer.
          -
        • -
        - - - -
          -
        • -

          value

          -
          DSIWriter value(DSElement arg)
          -
          Write a value to the map or list. If in a map, this must have been preceded by a call to - key(String). This can be used to encode an entire graph.
          -
          -
          Throws:
          -
          java.lang.IllegalStateException - when improperly called.
          -
          -
        • -
        - - - -
          -
        • -

          value

          -
          DSIWriter value(boolean arg)
          -
          Write a value to the map or list. If in a map, this must have been preceded by a call to - key(String).
          -
          -
          Throws:
          -
          java.lang.IllegalStateException - when improperly called.
          -
          -
        • -
        - - - -
          -
        • -

          value

          -
          DSIWriter value(byte[] arg)
          -
          Write a value to the map or list. If in a map, this must have been preceded by a call to - key(String).
          -
          -
          Throws:
          -
          java.lang.IllegalStateException - when improperly called.
          -
          -
        • -
        - - - -
          -
        • -

          value

          -
          DSIWriter value(double arg)
          -
          Write a value to the map or list. If in a map, this must have been preceded by a call to - key(String).
          -
          -
          Throws:
          -
          java.lang.IllegalStateException - when improperly called.
          -
          -
        • -
        - - - -
          -
        • -

          value

          -
          DSIWriter value(int arg)
          -
          Write a value to the map or list. If in a map, this must have been preceded by a call to - key(String).
          -
          -
          Throws:
          -
          java.lang.IllegalStateException - when improperly called.
          -
          -
        • -
        - - - -
          -
        • -

          value

          -
          DSIWriter value(long arg)
          -
          Write a value to the map or list. If in a map, this must have been preceded by a call to - key(String).
          -
          -
          Throws:
          -
          java.lang.IllegalStateException - when improperly called.
          -
          -
        • -
        - - - -
          -
        • -

          value

          -
          DSIWriter value(java.lang.String arg)
          -
          Write a value to the map or list. If in a map, this must have been preceded by a call to - key(String).
          -
          -
          Throws:
          -
          java.lang.IllegalStateException - when improperly called.
          -
          -
        • -
        -
      • -
      -
    • -
    -
    + Be aware that if the underlying encoding (such as JSON) doesn't provide a mechanism to + differentiate between data types (such as numbers), values might not get as the same + type they + were encoded.
+ + +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        beginList

        +
        DSIWriter beginList()
        +
        Start a new list and return this.
        +
        +
        Throws:
        +
        java.lang.IllegalStateException - when improperly called.
        +
        +
      • +
      + + + +
        +
      • +

        beginList

        +
        DSIWriter beginList(int size)
        +
        Start a new list of the given size and return this.
        +
        +
        Parameters:
        +
        size - Less than zero means the size is unknown.
        +
        Throws:
        +
        java.lang.IllegalStateException - when improperly called.
        +
        +
      • +
      + + + +
        +
      • +

        beginMap

        +
        DSIWriter beginMap()
        +
        Start a new map and return this.
        +
        +
        Throws:
        +
        java.lang.IllegalStateException - when improperly called.
        +
        +
      • +
      + + + +
        +
      • +

        beginMap

        +
        DSIWriter beginMap(int size)
        +
        Start a new map of the given size and return this.
        +
        +
        Parameters:
        +
        size - Less than zero means the size is unknown.
        +
        Throws:
        +
        java.lang.IllegalStateException - when improperly called.
        +
        +
      • +
      + + + +
        +
      • +

        close

        +
        void close()
        +
        Close the stream. IOExceptions will be wrapped in runtime + exceptions. +
        +
        +
        Specified by:
        +
        close in interface java.lang.AutoCloseable +
        +
        Specified by:
        +
        close in interface java.io.Closeable
        +
        +
      • +
      + + + +
        +
      • +

        endList

        +
        DSIWriter endList()
        +
        End the current list.
        +
        +
        Throws:
        +
        java.lang.IllegalStateException - when improperly called.
        +
        +
      • +
      + + + +
        +
      • +

        endMap

        +
        DSIWriter endMap()
        +
        End the current map.
        +
        +
        Throws:
        +
        java.lang.IllegalStateException - when improperly called.
        +
        +
      • +
      + + + +
        +
      • +

        flush

        +
        DSIWriter flush()
        +
        Flush the stream. IOExceptions will be wrapped in runtime + exceptions. +
        +
      • +
      + + + +
        +
      • +

        key

        +
        DSIWriter key(java.lang.CharSequence key)
        +
        Write a key in the current map. Cannot be called in a list, must + be followed by a call to + one of the value methods. +
        +
        +
        Throws:
        +
        java.lang.IllegalStateException - when improperly called.
        +
        +
      • +
      + + + +
        +
      • +

        length

        +
        int length()
        +
        If the writer is buffering output, this returns the size of that + buffer. +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        DSIWriter reset()
        +
        Clears the state of the writer.
        +
      • +
      + + + +
        +
      • +

        value

        +
        DSIWriter value(DSElement arg)
        +
        Write a value to the map or list. If in a map, this must have + been preceded by a call to + key(String). This can be used to encode an entire graph. +
        +
        +
        Throws:
        +
        java.lang.IllegalStateException - when improperly called.
        +
        +
      • +
      + + + +
        +
      • +

        value

        +
        DSIWriter value(boolean arg)
        +
        Write a value to the map or list. If in a map, this must have + been preceded by a call to + key(String). +
        +
        +
        Throws:
        +
        java.lang.IllegalStateException - when improperly called.
        +
        +
      • +
      + + + +
        +
      • +

        value

        +
        DSIWriter value(byte[] arg)
        +
        Write a value to the map or list. If in a map, this must have + been preceded by a call to + key(String). +
        +
        +
        Throws:
        +
        java.lang.IllegalStateException - when improperly called.
        +
        +
      • +
      + + + +
        +
      • +

        value

        +
        DSIWriter value(double arg)
        +
        Write a value to the map or list. If in a map, this must have + been preceded by a call to + key(String). +
        +
        +
        Throws:
        +
        java.lang.IllegalStateException - when improperly called.
        +
        +
      • +
      + + + +
        +
      • +

        value

        +
        DSIWriter value(int arg)
        +
        Write a value to the map or list. If in a map, this must have + been preceded by a call to + key(String). +
        +
        +
        Throws:
        +
        java.lang.IllegalStateException - when improperly called.
        +
        +
      • +
      + + + +
        +
      • +

        value

        +
        DSIWriter value(long arg)
        +
        Write a value to the map or list. If in a map, this must have + been preceded by a call to + key(String). +
        +
        +
        Throws:
        +
        java.lang.IllegalStateException - when improperly called.
        +
        +
      • +
      + + + +
        +
      • +

        value

        +
        DSIWriter value(java.lang.String arg)
        +
        Write a value to the map or list. If in a map, this must have + been preceded by a call to + key(String). +
        +
        +
        Throws:
        +
        java.lang.IllegalStateException - when improperly called.
        +
        +
      • +
      +
    • +
    +
  • +
+
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/io/NodeDecoder.html b/docs/javadoc/org/iot/dsa/io/NodeDecoder.html index eaa4e070..97c08352 100644 --- a/docs/javadoc/org/iot/dsa/io/NodeDecoder.html +++ b/docs/javadoc/org/iot/dsa/io/NodeDecoder.html @@ -1,12 +1,13 @@ - + - -NodeDecoder (dslink-core 0.15.0 API) - - - + + NodeDecoder (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.io
-

Class NodeDecoder

+
org.iot.dsa.io
+

Class NodeDecoder

-
    -
  • java.lang.Object
  • -
  • -
      -
    • org.iot.dsa.io.NodeDecoder
    • -
    -
  • -
-
-
    -
  • -
    -
    -
    public class NodeDecoder
    +  
      +
    • java.lang.Object
    • +
    • +
        +
      • org.iot.dsa.io.NodeDecoder
      • +
      +
    • +
    +
    +
      +
    • +
      +
      +
      public class NodeDecoder
       extends java.lang.Object
      -
      Decodes a node (tree) that was encoded with NodeEncoder. +
      Decodes a node (tree) that was encoded with NodeEncoder. -

      +

      - This is for storing the configuration database, not for DSA interop.

      -
      -
      See Also:
      -
      NodeEncoder
      -
      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Method Summary

        - - - - - - - - - - -
        All Methods Static Methods Concrete Methods 
        Modifier and TypeMethod and Description
        static DSNodedecode(DSIReader in) -
        Reads a node tree from the given input.
        -
        -
          -
        • - - -

          Methods inherited from class java.lang.Object

          -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
        • -
        -
      • -
      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Method Detail

        - - - -
          -
        • -

          decode

          -
          public static DSNode decode(DSIReader in)
          -
          Reads a node tree from the given input.
          -
        • -
        -
      • -
      -
    • -
    -
    + This is for storing the configuration database, not for DSA interop.
+
+
See Also:
+
NodeEncoder +
+
+ + +
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static DSNode + decode(DSIReader in) +
      Reads a node tree from the given input.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        + clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, + wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        decode

        +
        public static DSNode decode(DSIReader in)
        +
        Reads a node tree from the given input.
        +
      • +
      +
    • +
    +
  • +
+
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/io/NodeEncoder.html b/docs/javadoc/org/iot/dsa/io/NodeEncoder.html index e3108225..afc5d225 100644 --- a/docs/javadoc/org/iot/dsa/io/NodeEncoder.html +++ b/docs/javadoc/org/iot/dsa/io/NodeEncoder.html @@ -1,12 +1,13 @@ - + - -NodeEncoder (dslink-core 0.15.0 API) - - - + + NodeEncoder (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.io
-

Class NodeEncoder

+
org.iot.dsa.io
+

Class NodeEncoder

-
    -
  • java.lang.Object
  • -
  • -
      -
    • org.iot.dsa.io.NodeEncoder
    • -
    -
  • -
-
-
    -
  • -
    -
    -
    public class NodeEncoder
    +  
      +
    • java.lang.Object
    • +
    • +
        +
      • org.iot.dsa.io.NodeEncoder
      • +
      +
    • +
    +
    +
      +
    • +
      +
      +
      public class NodeEncoder
       extends java.lang.Object
      -
      Encodes a node tree using a compact JSON schema. Defaults are omitted and class names are - tokenized to minimize size. Use NodeDecoder for deserialization. +
      Encodes a node tree using a compact JSON schema. Defaults are omitted and + class names are + tokenized to minimize size. Use NodeDecoder for deserialization. -

      +

      - This is for saving a configuration database, not for DSA interop.

      -
      -
      See Also:
      -
      NodeDecoder
      -
      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Method Summary

        - - - - - - - - - - -
        All Methods Static Methods Concrete Methods 
        Modifier and TypeMethod and Description
        static DSIWriterencode(DSIWriter out, - DSNode node) -
        Writes the node tree to the given writer.
        -
        -
          -
        • - - -

          Methods inherited from class java.lang.Object

          -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
        • -
        -
      • -
      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Method Detail

        - - - -
          -
        • -

          encode

          -
          public static DSIWriter encode(DSIWriter out,
          -                               DSNode node)
          -
          Writes the node tree to the given writer. Flushes but does not close the writer.
          -
          -
          Parameters:
          -
          out - Where to write the node, also the return value (unclosed).
          -
          node - What to encode.
          -
          Returns:
          -
          The writer parameter, flushed, but not closed.
          -
          -
        • -
        -
      • -
      -
    • -
    -
    + This is for saving a configuration database, not for DSA interop.
+
+
See Also:
+
NodeDecoder +
+
+ + +
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static DSIWriterencode(DSIWriter out, + DSNode node) +
      Writes the node tree to the given writer.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        + clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, + wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        encode

        +
        public static DSIWriter encode(DSIWriter out,
        +                               DSNode node)
        +
        Writes the node tree to the given writer. Flushes but does not + close the writer. +
        +
        +
        Parameters:
        +
        out - Where to write the node, also the return value (unclosed). +
        +
        node - What to encode.
        +
        Returns:
        +
        The writer parameter, flushed, but not closed.
        +
        +
      • +
      +
    • +
    +
  • +
+
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/io/package-frame.html b/docs/javadoc/org/iot/dsa/io/package-frame.html index 409ff783..fa48900e 100644 --- a/docs/javadoc/org/iot/dsa/io/package-frame.html +++ b/docs/javadoc/org/iot/dsa/io/package-frame.html @@ -1,33 +1,43 @@ - + - -org.iot.dsa.io (dslink-core 0.15.0 API) - - - + + org.iot.dsa.io (dslink-core 0.15.0 API) + + + -

org.iot.dsa.io

+

org.iot.dsa.io +

-

Interfaces

- -

Classes

- -

Enums

- +

Interfaces

+ +

Classes

+ +

Enums

+
diff --git a/docs/javadoc/org/iot/dsa/io/package-summary.html b/docs/javadoc/org/iot/dsa/io/package-summary.html index 6f007d2d..5249de06 100644 --- a/docs/javadoc/org/iot/dsa/io/package-summary.html +++ b/docs/javadoc/org/iot/dsa/io/package-summary.html @@ -1,12 +1,13 @@ - + - -org.iot.dsa.io (dslink-core 0.15.0 API) - - - + + org.iot.dsa.io (dslink-core 0.15.0 API) + + + + + + + + +
-

Package org.iot.dsa.io

-
-
Node serialization and streaming abstraction for JSON and MsgPack.
-
-

See: Description

+

Package org.iot.dsa.io

+
+
Node serialization and streaming abstraction for JSON and MsgPack.
+
+

See: Description

-
    -
  • - - - - - - - - - - - - - - - - -
    Interface Summary 
    InterfaceDescription
    DSIReader -
    A decoder that can be used to get an entire graph in pieces, or one large group, or somewhere in - between.
    -
    DSIWriter -
    An encoder that can be used to encode large graphs with or without object instances.
    -
    -
  • -
  • - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Class Summary 
    ClassDescription
    AbstractReader -
    Basic implementation of DSReader.
    -
    AbstractWriter -
    Basic implementation of DSWriter.
    -
    DSBase64 -
    Thread-safe Base64 encoder and decoder.
    -
    NodeDecoder -
    Decodes a node (tree) that was encoded with NodeEncoder.
    -
    NodeEncoder -
    Encodes a node tree using a compact JSON schema.
    -
    -
  • -
  • - - - - - - - - - - - - -
    Enum Summary 
    EnumDescription
    DSIReader.Token -
    Represents the state of the reader, and determines which getter should be called next.
    -
    -
  • -
- - - -

Package org.iot.dsa.io Description

-
Node serialization and streaming abstraction for JSON and MsgPack.
+
    +
  • + + + + + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    DSIReader +
    A decoder that can be used to get an entire graph in pieces, or one + large group, or somewhere in + between. +
    +
    DSIWriter +
    An encoder that can be used to encode large graphs with or without + object instances. +
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    AbstractReader +
    Basic implementation of DSReader.
    +
    AbstractWriter +
    Basic implementation of DSWriter.
    +
    DSBase64 +
    Thread-safe Base64 encoder and decoder.
    +
    NodeDecoder +
    Decodes a node (tree) that was encoded with NodeEncoder.
    +
    NodeEncoder +
    Encodes a node tree using a compact JSON schema.
    +
    +
  • +
  • + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    DSIReader.Token +
    Represents the state of the reader, and determines which getter + should be called next. +
    +
    +
  • +
+ + + +

Package org.iot.dsa.io Description

+
Node serialization and streaming abstraction for JSON and MsgPack.
+ + + + + + diff --git a/docs/javadoc/org/iot/dsa/io/package-tree.html b/docs/javadoc/org/iot/dsa/io/package-tree.html index 0f8bdbb5..cfaab144 100644 --- a/docs/javadoc/org/iot/dsa/io/package-tree.html +++ b/docs/javadoc/org/iot/dsa/io/package-tree.html @@ -1,12 +1,13 @@ - + - -org.iot.dsa.io Class Hierarchy (dslink-core 0.15.0 API) - - - + + org.iot.dsa.io Class Hierarchy (dslink-core 0.15.0 API) + + + + + + + + +
-

Hierarchy For Package org.iot.dsa.io

-Package Hierarchies: - +

Hierarchy For Package org.iot.dsa.io

+ Package Hierarchies: +
-

Class Hierarchy

- -

Interface Hierarchy

-
    -
  • java.lang.AutoCloseable - -
  • -
-

Enum Hierarchy

-
    -
  • java.lang.Object -
      -
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) - -
    • -
    -
  • -
+

Class Hierarchy

+ +

Interface Hierarchy

+
    +
  • java.lang.AutoCloseable + +
  • +
+

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, + java.io.Serializable) + +
    • +
    +
  • +
+ + + + + + diff --git a/docs/javadoc/org/iot/dsa/node/DSBool.html b/docs/javadoc/org/iot/dsa/node/DSBool.html index f827712b..77c8718a 100644 --- a/docs/javadoc/org/iot/dsa/node/DSBool.html +++ b/docs/javadoc/org/iot/dsa/node/DSBool.html @@ -1,12 +1,13 @@ - + - -DSBool (dslink-core 0.15.0 API) - - - + + DSBool (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.node
-

Class DSBool

+
org.iot.dsa.node
+

Class DSBool

- -
- +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        TRUE

        +
        public static final DSBool TRUE
        +
      • +
      + + + +
        +
      • +

        FALSE

        +
        public static final DSBool FALSE
        +
      • +
      + + + +
        +
      • +

        NULL

        +
        public static final DSBool NULL
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        equals

        +
        public boolean equals(java.lang.Object arg)
        +
        +
        Overrides:
        +
        equals in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        isBoolean

        +
        public boolean isBoolean()
        +
        Description copied from class: DSElement +
        +
        Whether or not the object represents a boolean.
        +
        +
        Overrides:
        +
        isBoolean in + class DSElement
        +
        +
      • +
      + + + +
        +
      • +

        isNull

        +
        public boolean isNull()
        +
        Description copied from class: DSElement +
        +
        Whether or not the object represents null.
        +
        +
        Specified by:
        +
        isNull in + interface DSIObject +
        +
        Specified by:
        +
        isNull in + interface DSIValue +
        +
        Overrides:
        +
        isNull in + class DSElement
        +
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        +
        Overrides:
        +
        hashCode in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        toBoolean

        +
        public boolean toBoolean()
        +
        Description copied from class: DSElement +
        +
        Attempts to return a boolean value. Numerics will return false + for 0 and true for anything + else. Strings should return true for "true" or "1" and false for "false" or "0". + Anything + else will throws a ClassCastException. +
        +
        +
        Specified by:
        +
        toBoolean in + interface DSIBoolean +
        +
        Overrides:
        +
        toBoolean in + class DSElement
        +
        +
      • +
      + + + +
        +
      • +

        toDouble

        +
        public double toDouble()
        +
        0 or 1.
        +
        +
        Overrides:
        +
        toDouble in + class DSElement
        +
        +
      • +
      + + + +
        +
      • +

        toFloat

        +
        public float toFloat()
        +
        0 or 1.
        +
        +
        Overrides:
        +
        toFloat in + class DSElement
        +
        +
      • +
      + + + +
        +
      • +

        toInt

        +
        public int toInt()
        +
        0 or 1.
        +
        +
        Overrides:
        +
        toInt in + class DSElement
        +
        +
      • +
      + + + +
        +
      • +

        toLong

        +
        public long toLong()
        +
        0 or 1.
        +
        +
        Overrides:
        +
        toLong in + class DSElement
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        Description copied from class: DSValue +
        +
        If isNull(), returns "null", otherwise returns + toElement().toString() +
        +
        +
        Overrides:
        +
        toString in + class DSValue
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static DSBool valueOf(boolean arg)
        +
        Will return either TRUE or FALSE.
        +
      • +
      + + + + + + + +
        +
      • +

        valueOf

        +
        public static DSBool valueOf(java.lang.String arg)
        +
        Will return NULL, TRUE or FALSE.
        +
        +
        Throws:
        +
        java.lang.IllegalArgumentException - If the string cannot be + decoded. +
        +
        +
      • +
      +
    • +
    +
  • +
+
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/node/DSInfo.html b/docs/javadoc/org/iot/dsa/node/DSInfo.html index e5e4c88f..a26ff364 100644 --- a/docs/javadoc/org/iot/dsa/node/DSInfo.html +++ b/docs/javadoc/org/iot/dsa/node/DSInfo.html @@ -1,12 +1,13 @@ - + - -DSInfo (dslink-core 0.15.0 API) - - - + + DSInfo (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.node
-

Class DSInfo

+
org.iot.dsa.node
+

Class DSInfo

-
    -
  • java.lang.Object
  • -
  • -
      -
    • org.iot.dsa.node.DSInfo
    • -
    -
  • -
-
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    ApiObject
    -
    -
    -
    -
    public class DSInfo
    +  
      +
    • java.lang.Object
    • +
    • +
        +
      • org.iot.dsa.node.DSInfo
      • +
      +
    • +
    +
    +
      +
    • +
      +
      All Implemented Interfaces:
      +
      ApiObject
      +
      +
      +
      +
      public class DSInfo
       extends java.lang.Object
      -implements ApiObject
      -
      All node children have corresponding DSInfo instances. This type serves two purposes: +implements ApiObject
    +
    All node children have corresponding DSInfo instances. This type serves + two purposes: -

    +

    -

      +
        -
      • It carries some meta-data about the relationship between the parent node and the child. +
      • It carries some meta-data about the relationship between the parent node and the + child. -
      • It tracks whether or not the child matches a declared default. +
      • It tracks whether or not the child matches a declared default. -
      +
    -

    +

    - Important things for developers to know about DSInfo are: + Important things for developers to know about DSInfo are: -

    +

    -

      +
        -
      • You can configure state such as transient, readonly and hidden. +
      • You can configure state such as transient, readonly and hidden. -
      • You can declare fields in the your Java class for default infos to avoid looking up the child - every time it is needed. This is can be used to create fast getters and setters. +
      • You can declare fields in the your Java class for default infos to avoid looking up + the child + every time it is needed. This is can be used to create fast getters and setters. -
      +
    -

    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      DSInfocopy() 
      voiddecodeState(DSElement state) 
      DSElementencodeState() 
      booleanequals(java.lang.Object arg) 
      booleanequalsDefault() -
      True if this proxies a default and the state and value match the default.
      -
      booleanequalsDefaultState() -
      True if the state matches the default state.
      -
      booleanequalsDefaultType() -
      True if this proxies a default and the value type matches the default.
      -
      booleanequalsDefaultValue() -
      True if this proxies a default and the value matches the default.
      -
      DSActiongetAction() -
      The action, should only be called if isAction() returns true.
      -
      java.util.Iterator<ApiObject>getChildren() -
      Iterator of child objects, should only be called if hasChildren() returns true.
      -
      DSIObjectgetDefaultObject() -
      If this represents a dynamic child, this just returns the current value.
      -
      DSElementgetElement() -
      A convenience that casts getObject().
      -
      voidgetMetadata(DSMap bucket) 
      java.lang.StringgetName() -
      The display name.
      -
      DSNodegetNode() -
      A convenience that casts getObject().
      -
      DSIObjectgetObject() 
      DSNodegetParent() 
      DSIValuegetValue() -
      A convenience that casts getObject().
      -
      booleanhasChildren() -
      True if getChildren() can be called.
      -
      inthashCode() 
      booleanhasNext() -
      True if there is another info after this one.
      -
      booleanisAction() -
      True if the object is an action.
      -
      booleanisAdmin() -
      Whether or not this object requires configuration permission to read/write.
      -
      booleanisDefaultOnCopy() -
      Whether or not the current value, or the default value is copied.
      -
      booleanisDynamic() -
      Whether or not this info represents a declared default.
      -
      booleanisEqual(DSInfo arg) -
      True if the flags and target object are equal (not identical if the target is a node).
      -
      booleanisHidden() -
      Whether or not an object is visible to clients.
      -
      booleanisIdentical(DSInfo arg) -
      True if the flags and target object are identical.
      -
      booleanisNode() -
      Whether or not the object is a DSNode.
      -
      booleanisReadOnly() -
      Whether or not an object can be written by a client.
      -
      booleanisTransient() -
      Whether or not an object is persistent.
      -
      booleanisValue() -
      True if getValue() can be called.
      -
      DSInfonext() -
      The next info in the parent node.
      -
      DSInfonextAction() -
      The next DSInfo in the parent that is an action, or null.
      -
      DSInfonextNode() -
      The next DSInfo in the parent that is a node, or null.
      -
      DSInfonextValue() -
      The next DSInfo in the parent that is a value, or null.
      -
      DSInfosetAdmin(boolean admin) 
      DSInfosetHidden(boolean hidden) 
      DSInfosetReadOnly(boolean readOnly) 
      DSInfosetTransient(boolean trans) 
      -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        copy

        -
        public DSInfo copy()
        -
      • -
      - - - -
        -
      • -

        decodeState

        -
        public void decodeState(DSElement state)
        -
      • -
      - - - -
        -
      • -

        encodeState

        -
        public DSElement encodeState()
        -
      • -
      - - - -
        -
      • -

        equals

        -
        public boolean equals(java.lang.Object arg)
        -
        -
        Overrides:
        -
        equals in class java.lang.Object
        -
        -
      • -
      - - - -
        -
      • -

        equalsDefault

        -
        public boolean equalsDefault()
        -
        True if this proxies a default and the state and value match the default.
        -
      • -
      - - - -
        -
      • -

        equalsDefaultState

        -
        public boolean equalsDefaultState()
        -
        True if the state matches the default state.
        -
      • -
      - - - -
        -
      • -

        equalsDefaultType

        -
        public boolean equalsDefaultType()
        -
        True if this proxies a default and the value type matches the default.
        -
      • -
      - - - -
        -
      • -

        equalsDefaultValue

        -
        public boolean equalsDefaultValue()
        -
        True if this proxies a default and the value matches the default.
        -
      • -
      - - - -
        -
      • -

        getAction

        -
        public DSAction getAction()
        -
        Description copied from interface: ApiObject
        -
        The action, should only be called if isAction() returns true.
        -
        -
        Specified by:
        -
        getAction in interface ApiObject
        -
        -
      • -
      - - - -
        -
      • -

        getChildren

        -
        public java.util.Iterator<ApiObject> getChildren()
        -
        Description copied from interface: ApiObject
        -
        Iterator of child objects, should only be called if hasChildren() returns true.
        -
        -
        Specified by:
        -
        getChildren in interface ApiObject
        -
        -
      • -
      - - - -
        -
      • -

        getDefaultObject

        -
        public DSIObject getDefaultObject()
        -
        If this represents a dynamic child, this just returns the current value.
        -
      • -
      - - - -
        -
      • -

        getElement

        -
        public DSElement getElement()
        -
        A convenience that casts getObject().
        -
      • -
      - - - -
        -
      • -

        getName

        -
        public java.lang.String getName()
        -
        Description copied from interface: ApiObject
        -
        The display name.
        -
        -
        Specified by:
        -
        getName in interface ApiObject
        -
        -
      • -
      - - - - - - - -
        -
      • -

        getNode

        -
        public DSNode getNode()
        -
        A convenience that casts getObject().
        -
      • -
      - - - -
        -
      • -

        getObject

        -
        public DSIObject getObject()
        -
      • -
      - - - -
        -
      • -

        getParent

        -
        public DSNode getParent()
        -
      • -
      - - - -
        -
      • -

        getValue

        -
        public DSIValue getValue()
        -
        A convenience that casts getObject().
        -
        -
        Specified by:
        -
        getValue in interface ApiObject
        -
        -
      • -
      - - - -
        -
      • -

        hasChildren

        -
        public boolean hasChildren()
        -
        Description copied from interface: ApiObject
        -
        True if getChildren() can be called.
        -
        -
        Specified by:
        -
        hasChildren in interface ApiObject
        -
        -
      • -
      - - - -
        -
      • -

        hashCode

        -
        public int hashCode()
        -
        -
        Overrides:
        -
        hashCode in class java.lang.Object
        -
        -
      • -
      - - - -
        -
      • -

        hasNext

        -
        public boolean hasNext()
        -
        True if there is another info after this one.
        -
      • -
      - - - -
        -
      • -

        isAction

        -
        public boolean isAction()
        -
        Description copied from interface: ApiObject
        -
        True if the object is an action.
        -
        -
        Specified by:
        -
        isAction in interface ApiObject
        -
        -
      • -
      - - - -
        -
      • -

        isAdmin

        -
        public boolean isAdmin()
        -
        Description copied from interface: ApiObject
        -
        Whether or not this object requires configuration permission to read/write.
        -
        -
        Specified by:
        -
        isAdmin in interface ApiObject
        -
        -
      • -
      - - - -
        -
      • -

        isDefaultOnCopy

        -
        public boolean isDefaultOnCopy()
        -
        Whether or not the current value, or the default value is copied.
        -
      • -
      - - - -
        -
      • -

        isDynamic

        -
        public boolean isDynamic()
        -
        Whether or not this info represents a declared default.
        -
      • -
      - - - -
        -
      • -

        isEqual

        -
        public boolean isEqual(DSInfo arg)
        -
        True if the flags and target object are equal (not identical if the target is a node). Two - nodes are considered equal if they have the same children, although they may be ordered - differently.
        -
      • -
      - - - -
        -
      • -

        isHidden

        -
        public boolean isHidden()
        -
        Whether or not an object is visible to clients.
        -
        -
        Specified by:
        -
        isHidden in interface ApiObject
        -
        -
      • -
      - - - -
        -
      • -

        isIdentical

        -
        public boolean isIdentical(DSInfo arg)
        -
        True if the flags and target object are identical. Two nodes are identical if their children - are in the same order.
        -
      • -
      - - - -
        -
      • -

        isNode

        -
        public boolean isNode()
        -
        Whether or not the object is a DSNode.
        -
      • -
      - - - -
        -
      • -

        isReadOnly

        -
        public boolean isReadOnly()
        -
        Whether or not an object can be written by a client.
        -
        -
        Specified by:
        -
        isReadOnly in interface ApiObject
        -
        -
      • -
      - - - -
        -
      • -

        isTransient

        -
        public boolean isTransient()
        -
        Whether or not an object is persistent.
        -
      • -
      - - - -
        -
      • -

        isValue

        -
        public boolean isValue()
        -
        Description copied from interface: ApiObject
        -
        True if getValue() can be called.
        -
        -
        Specified by:
        -
        isValue in interface ApiObject
        -
        -
      • -
      - - - -
        -
      • -

        next

        -
        public DSInfo next()
        -
        The next info in the parent node.
        -
      • -
      - - - -
        -
      • -

        nextAction

        -
        public DSInfo nextAction()
        -
        The next DSInfo in the parent that is an action, or null.
        -
      • -
      - - - -
        -
      • -

        nextNode

        -
        public DSInfo nextNode()
        -
        The next DSInfo in the parent that is a node, or null.
        -
      • -
      - - - -
        -
      • -

        nextValue

        -
        public DSInfo nextValue()
        -
        The next DSInfo in the parent that is a value, or null.
        -
      • -
      - - - -
        -
      • -

        setAdmin

        -
        public DSInfo setAdmin(boolean admin)
        -
      • -
      - - - -
        -
      • -

        setHidden

        -
        public DSInfo setHidden(boolean hidden)
        -
      • -
      - - - -
        -
      • -

        setReadOnly

        -
        public DSInfo setReadOnly(boolean readOnly)
        -
      • -
      - - - -
        -
      • -

        setTransient

        -
        public DSInfo setTransient(boolean trans)
        -
      • -
      -
    • -
    -
  • -
-
+

+ + + +
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      DSInfo + copy()  +
      voiddecodeState(DSElement state)  +
      DSElement + encodeState()  +
      booleanequals(java.lang.Object arg)  +
      booleanequalsDefault() +
      True if this proxies a default and the state and value match + the default. +
      +
      booleanequalsDefaultState() +
      True if the state matches the default state.
      +
      booleanequalsDefaultType() +
      True if this proxies a default and the value type matches the + default. +
      +
      booleanequalsDefaultValue() +
      True if this proxies a default and the value matches the + default. +
      +
      DSActiongetAction() +
      The action, should only be called if isAction() returns true. +
      +
      java.util.Iterator<ApiObject>getChildren() +
      Iterator of child objects, should only be called if + hasChildren() returns true. +
      +
      DSIObject + getDefaultObject() +
      If this represents a dynamic child, this just returns the + current value. +
      +
      DSElement + getElement() +
      A convenience that casts getObject().
      +
      voidgetMetadata(DSMap bucket)  +
      java.lang.StringgetName() +
      The display name.
      +
      DSNode + getNode() +
      A convenience that casts getObject().
      +
      DSIObject + getObject()  +
      DSNode + getParent()  +
      DSIValue + getValue() +
      A convenience that casts getObject().
      +
      booleanhasChildren() +
      True if getChildren() can be called.
      +
      inthashCode()  +
      booleanhasNext() +
      True if there is another info after this one.
      +
      booleanisAction() +
      True if the object is an action.
      +
      booleanisAdmin() +
      Whether or not this object requires configuration permission to + read/write. +
      +
      booleanisDefaultOnCopy() +
      Whether or not the current value, or the default value is + copied. +
      +
      booleanisDynamic() +
      Whether or not this info represents a declared default.
      +
      booleanisEqual(DSInfo arg) +
      True if the flags and target object are equal (not identical if + the target is a node). +
      +
      booleanisHidden() +
      Whether or not an object is visible to clients.
      +
      booleanisIdentical(DSInfo arg) +
      True if the flags and target object are identical.
      +
      booleanisNode() +
      Whether or not the object is a DSNode.
      +
      booleanisReadOnly() +
      Whether or not an object can be written by a client.
      +
      booleanisTransient() +
      Whether or not an object is persistent.
      +
      booleanisValue() +
      True if getValue() can be called.
      +
      DSInfo + next() +
      The next info in the parent node.
      +
      DSInfo + nextAction() +
      The next DSInfo in the parent that is an action, or null.
      +
      DSInfo + nextNode() +
      The next DSInfo in the parent that is a node, or null.
      +
      DSInfo + nextValue() +
      The next DSInfo in the parent that is a value, or null.
      +
      DSInfo + setAdmin(boolean admin)  +
      DSInfo + setHidden(boolean hidden)  +
      DSInfo + setReadOnly(boolean readOnly)  +
      DSInfo + setTransient(boolean trans)  +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        + clone, finalize, getClass, notify, notifyAll, toString, wait, wait, + wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        copy

        +
        public DSInfo copy()
        +
      • +
      + + + +
        +
      • +

        decodeState

        +
        public void decodeState(DSElement state)
        +
      • +
      + + + +
        +
      • +

        encodeState

        +
        public DSElement encodeState()
        +
      • +
      + + + +
        +
      • +

        equals

        +
        public boolean equals(java.lang.Object arg)
        +
        +
        Overrides:
        +
        equals in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        equalsDefault

        +
        public boolean equalsDefault()
        +
        True if this proxies a default and the state and value match the + default. +
        +
      • +
      + + + +
        +
      • +

        equalsDefaultState

        +
        public boolean equalsDefaultState()
        +
        True if the state matches the default state.
        +
      • +
      + + + +
        +
      • +

        equalsDefaultType

        +
        public boolean equalsDefaultType()
        +
        True if this proxies a default and the value type matches the + default. +
        +
      • +
      + + + +
        +
      • +

        equalsDefaultValue

        +
        public boolean equalsDefaultValue()
        +
        True if this proxies a default and the value matches the + default. +
        +
      • +
      + + + +
        +
      • +

        getAction

        +
        public DSAction getAction()
        +
        Description copied from interface: ApiObject +
        +
        The action, should only be called if isAction() returns true. +
        +
        +
        Specified by:
        +
        getAction in + interface ApiObject
        +
        +
      • +
      + + + +
        +
      • +

        getChildren

        +
        public java.util.Iterator<ApiObject> getChildren()
        +
        Description copied from interface: ApiObject +
        +
        Iterator of child objects, should only be called if hasChildren() + returns true. +
        +
        +
        Specified by:
        +
        getChildren in + interface ApiObject
        +
        +
      • +
      + + + +
        +
      • +

        getDefaultObject

        +
        public DSIObject getDefaultObject()
        +
        If this represents a dynamic child, this just returns the current + value. +
        +
      • +
      + + + +
        +
      • +

        getElement

        +
        public DSElement getElement()
        +
        A convenience that casts getObject().
        +
      • +
      + + + +
        +
      • +

        getName

        +
        public java.lang.String getName()
        +
        Description copied from interface: ApiObject +
        +
        The display name.
        +
        +
        Specified by:
        +
        getName in + interface ApiObject
        +
        +
      • +
      + + + +
        +
      • +

        getMetadata

        +
        public void getMetadata(DSMap bucket)
        +
        +
        Specified by:
        +
        getMetadata in + interface ApiObject
        +
        +
      • +
      + + + +
        +
      • +

        getNode

        +
        public DSNode getNode()
        +
        A convenience that casts getObject().
        +
      • +
      + + + +
        +
      • +

        getObject

        +
        public DSIObject getObject()
        +
      • +
      + + + +
        +
      • +

        getParent

        +
        public DSNode getParent()
        +
      • +
      + + + +
        +
      • +

        getValue

        +
        public DSIValue getValue()
        +
        A convenience that casts getObject().
        +
        +
        Specified by:
        +
        getValue in + interface ApiObject
        +
        +
      • +
      + + + +
        +
      • +

        hasChildren

        +
        public boolean hasChildren()
        +
        Description copied from interface: ApiObject +
        +
        True if getChildren() can be called.
        +
        +
        Specified by:
        +
        hasChildren in + interface ApiObject
        +
        +
      • +
      + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        +
        Overrides:
        +
        hashCode in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        hasNext

        +
        public boolean hasNext()
        +
        True if there is another info after this one.
        +
      • +
      + + + +
        +
      • +

        isAction

        +
        public boolean isAction()
        +
        Description copied from interface: ApiObject +
        +
        True if the object is an action.
        +
        +
        Specified by:
        +
        isAction in + interface ApiObject
        +
        +
      • +
      + + + +
        +
      • +

        isAdmin

        +
        public boolean isAdmin()
        +
        Description copied from interface: ApiObject +
        +
        Whether or not this object requires configuration permission to + read/write. +
        +
        +
        Specified by:
        +
        isAdmin in + interface ApiObject
        +
        +
      • +
      + + + +
        +
      • +

        isDefaultOnCopy

        +
        public boolean isDefaultOnCopy()
        +
        Whether or not the current value, or the default value is + copied. +
        +
      • +
      + + + +
        +
      • +

        isDynamic

        +
        public boolean isDynamic()
        +
        Whether or not this info represents a declared default.
        +
      • +
      + + + +
        +
      • +

        isEqual

        +
        public boolean isEqual(DSInfo arg)
        +
        True if the flags and target object are equal (not identical if + the target is a node). Two + nodes are considered equal if they have the same children, although they may be + ordered + differently. +
        +
      • +
      + + + +
        +
      • +

        isHidden

        +
        public boolean isHidden()
        +
        Whether or not an object is visible to clients.
        +
        +
        Specified by:
        +
        isHidden in + interface ApiObject
        +
        +
      • +
      + + + +
        +
      • +

        isIdentical

        +
        public boolean isIdentical(DSInfo arg)
        +
        True if the flags and target object are identical. Two nodes are + identical if their children + are in the same order. +
        +
      • +
      + + + +
        +
      • +

        isNode

        +
        public boolean isNode()
        +
        Whether or not the object is a DSNode.
        +
      • +
      + + + +
        +
      • +

        isReadOnly

        +
        public boolean isReadOnly()
        +
        Whether or not an object can be written by a client.
        +
        +
        Specified by:
        +
        isReadOnly in + interface ApiObject
        +
        +
      • +
      + + + +
        +
      • +

        isTransient

        +
        public boolean isTransient()
        +
        Whether or not an object is persistent.
        +
      • +
      + + + +
        +
      • +

        isValue

        +
        public boolean isValue()
        +
        Description copied from interface: ApiObject +
        +
        True if getValue() can be called.
        +
        +
        Specified by:
        +
        isValue in + interface ApiObject
        +
        +
      • +
      + + + +
        +
      • +

        next

        +
        public DSInfo next()
        +
        The next info in the parent node.
        +
      • +
      + + + +
        +
      • +

        nextAction

        +
        public DSInfo nextAction()
        +
        The next DSInfo in the parent that is an action, or null.
        +
      • +
      + + + +
        +
      • +

        nextNode

        +
        public DSInfo nextNode()
        +
        The next DSInfo in the parent that is a node, or null.
        +
      • +
      + + + +
        +
      • +

        nextValue

        +
        public DSInfo nextValue()
        +
        The next DSInfo in the parent that is a value, or null.
        +
      • +
      + + + +
        +
      • +

        setAdmin

        +
        public DSInfo setAdmin(boolean admin)
        +
      • +
      + + + +
        +
      • +

        setHidden

        +
        public DSInfo setHidden(boolean hidden)
        +
      • +
      + + + +
        +
      • +

        setReadOnly

        +
        public DSInfo setReadOnly(boolean readOnly)
        +
      • +
      + + + +
        +
      • +

        setTransient

        +
        public DSInfo setTransient(boolean trans)
        +
      • +
      +
    • +
    +
  • +
+
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/node/DSInt.html b/docs/javadoc/org/iot/dsa/node/DSInt.html index 9ed4e21e..9771dc76 100644 --- a/docs/javadoc/org/iot/dsa/node/DSInt.html +++ b/docs/javadoc/org/iot/dsa/node/DSInt.html @@ -1,12 +1,13 @@ - + - -DSInt (dslink-core 0.15.0 API) - - - + + DSInt (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.node
-

Class DSInt

+
org.iot.dsa.node
+

Class DSInt

- -
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    DSINumber, DSIObject, DSIValue
    -
    -
    -
    -
    public class DSInt
    +  
    +  
    + -
    -
    -
      -
    • - -
        -
      • - - -

        Field Summary

        - - - - - - - - - - -
        Fields 
        Modifier and TypeField and Description
        static DSIntNULL 
        -
      • -
      - -
        -
      • - - -

        Method Summary

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        All Methods Static Methods Instance Methods Concrete Methods 
        Modifier and TypeMethod and Description
        booleanequals(java.lang.Object arg) -
        True if the argument is a DSINumber and the values are equal or they are both isNull.
        -
        DSValueTypegetValueType() -
        The DSA type mapping.
        -
        inthashCode() 
        booleanisDouble() -
        Whether or not the object represents a double.
        -
        booleanisEqual(java.lang.Object obj) -
        Equals implementation that doesn't require hashCodes to equal, primarily intended - so for comparing nodes.
        -
        booleanisFloat() -
        Whether or not the object represents a double.
        -
        booleanisInt() -
        Whether or not the object represents an int.
        -
        booleanisLong() -
        Whether or not the object represents a long.
        -
        booleanisNull() -
        Values should have an instance representing null.
        -
        doubletoDouble() -
        If not a double, will cast the underlying value.
        -
        DSElementtoElement() -
        The current value should convert itself to an element for DSA interop such as subscription - updates, and setting requests.
        -
        floattoFloat() -
        If not a float, will cast the underlying value.
        -
        inttoInt() -
        If not an int, will cast the underlying value.
        -
        longtoLong() -
        If not a long, will cast the underlying value.
        -
        java.lang.NumbertoNumber() -
        Returns the Java primitive wrapper.
        -
        java.lang.StringtoString() -
        If isNull(), returns "null", otherwise returns toElement().toString()
        -
        DSIntvalueOf(DSElement arg) -
        This should convert an element transmitted over DSA, such as subscription updates or set - requests.
        -
        static DSIntvalueOf(int arg) -
        Attempts to reuse some common values before creating a new instance.
        -
        static DSIntvalueOf(java.lang.String arg) -
        Checks for null, then uses Float.parseFloat()
        -
        - -
          -
        • - - -

          Methods inherited from class java.lang.Object

          -clone, finalize, getClass, notify, notifyAll, wait, wait, wait
        • -
        -
      • -
      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Field Detail

        - - - -
          -
        • -

          NULL

          -
          public static final DSInt NULL
          -
        • -
        -
      • -
      - -
        -
      • - - -

        Method Detail

        - - - -
          -
        • -

          equals

          -
          public boolean equals(java.lang.Object arg)
          -
          True if the argument is a DSINumber and the values are equal or they are both isNull.
          -
          -
          Overrides:
          -
          equals in class java.lang.Object
          -
          -
        • -
        - - - - - - - -
          -
        • -

          hashCode

          -
          public int hashCode()
          -
          -
          Overrides:
          -
          hashCode in class java.lang.Object
          -
          -
        • -
        - - - -
          -
        • -

          isDouble

          -
          public boolean isDouble()
          -
          Description copied from interface: DSINumber
          -
          Whether or not the object represents a double.
          -
          -
          Specified by:
          -
          isDouble in interface DSINumber
          -
          -
        • -
        - - - -
          -
        • -

          isEqual

          -
          public boolean isEqual(java.lang.Object obj)
          -
          Description copied from interface: DSIObject
          -
          Equals implementation that doesn't require hashCodes to equal, primarily intended - so for comparing nodes.
          -
          -
          Specified by:
          -
          isEqual in interface DSIObject
          -
          -
        • -
        - - - -
          -
        • -

          isFloat

          -
          public boolean isFloat()
          -
          Description copied from interface: DSINumber
          -
          Whether or not the object represents a double.
          -
          -
          Specified by:
          -
          isFloat in interface DSINumber
          -
          -
        • -
        - - - -
          -
        • -

          isInt

          -
          public boolean isInt()
          -
          Description copied from interface: DSINumber
          -
          Whether or not the object represents an int.
          -
          -
          Specified by:
          -
          isInt in interface DSINumber
          -
          -
        • -
        - - - -
          -
        • -

          isLong

          -
          public boolean isLong()
          -
          Description copied from interface: DSINumber
          -
          Whether or not the object represents a long.
          -
          -
          Specified by:
          -
          isLong in interface DSINumber
          -
          -
        • -
        - - - -
          -
        • -

          isNull

          -
          public boolean isNull()
          -
          Description copied from interface: DSIValue
          -
          Values should have an instance representing null. This will allow null defaults in nodes, - but the null instance can be used to properly decode incoming values such as set requests.
          -
          -
          Specified by:
          -
          isNull in interface DSIObject
          -
          Specified by:
          -
          isNull in interface DSIValue
          -
          -
        • -
        - - - -
          -
        • -

          toDouble

          -
          public double toDouble()
          -
          Description copied from interface: DSINumber
          -
          If not a double, will cast the underlying value.
          -
          -
          Specified by:
          -
          toDouble in interface DSINumber
          -
          -
        • -
        - - - -
          -
        • -

          toElement

          -
          public DSElement toElement()
          -
          Description copied from interface: DSIValue
          -
          The current value should convert itself to an element for DSA interop such as subscription - updates, and setting requests. This is not for configuration database serialization.
          -
          -
          Specified by:
          -
          toElement in interface DSIValue
          -
          -
        • -
        - - - -
          -
        • -

          toFloat

          -
          public float toFloat()
          -
          Description copied from interface: DSINumber
          -
          If not a float, will cast the underlying value.
          -
          -
          Specified by:
          -
          toFloat in interface DSINumber
          -
          -
        • -
        - - - -
          -
        • -

          toInt

          -
          public int toInt()
          -
          Description copied from interface: DSINumber
          -
          If not an int, will cast the underlying value.
          -
          -
          Specified by:
          -
          toInt in interface DSINumber
          -
          -
        • -
        - - - -
          -
        • -

          toLong

          -
          public long toLong()
          -
          Description copied from interface: DSINumber
          -
          If not a long, will cast the underlying value.
          -
          -
          Specified by:
          -
          toLong in interface DSINumber
          -
          -
        • -
        - - - -
          -
        • -

          toNumber

          -
          public java.lang.Number toNumber()
          -
          Description copied from interface: DSINumber
          -
          Returns the Java primitive wrapper.
          -
          -
          Specified by:
          -
          toNumber in interface DSINumber
          -
          -
        • -
        - - - -
          -
        • -

          toString

          -
          public java.lang.String toString()
          -
          Description copied from class: DSValue
          -
          If isNull(), returns "null", otherwise returns toElement().toString()
          -
          -
          Overrides:
          -
          toString in class DSValue
          -
          -
        • -
        - - - -
          -
        • -

          valueOf

          -
          public DSInt valueOf(DSElement arg)
          -
          Description copied from interface: DSIValue
          -
          This should convert an element transmitted over DSA, such as subscription updates or set - requests. This is not for configuration database deserialization.
          -
          -
          Specified by:
          -
          valueOf in interface DSIValue
          -
          -
        • -
        - - - -
          -
        • -

          valueOf

          -
          public static DSInt valueOf(int arg)
          -
          Attempts to reuse some common values before creating a new instance.
          -
        • -
        - - - -
          -
        • -

          valueOf

          -
          public static DSInt valueOf(java.lang.String arg)
          -
          Checks for null, then uses Float.parseFloat()
          -
        • -
        -
      • -
      -
    • -
    -
    +implements DSINumber
    +
    A Java int.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      static DSInt + NULL  +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      booleanequals(java.lang.Object arg) +
      True if the argument is a DSINumber and the values are equal or + they are both isNull. +
      +
      DSValueType + getValueType() +
      The DSA type mapping.
      +
      inthashCode()  +
      booleanisDouble() +
      Whether or not the object represents a double.
      +
      booleanisEqual(java.lang.Object obj) +
      Equals implementation that doesn't require hashCodes to equal, + primarily intended + so for comparing nodes. +
      +
      booleanisFloat() +
      Whether or not the object represents a double.
      +
      booleanisInt() +
      Whether or not the object represents an int.
      +
      booleanisLong() +
      Whether or not the object represents a long.
      +
      booleanisNull() +
      Values should have an instance representing null.
      +
      doubletoDouble() +
      If not a double, will cast the underlying value.
      +
      DSElement + toElement() +
      The current value should convert itself to an element for DSA + interop such as subscription + updates, and setting requests. +
      +
      floattoFloat() +
      If not a float, will cast the underlying value.
      +
      inttoInt() +
      If not an int, will cast the underlying value.
      +
      longtoLong() +
      If not a long, will cast the underlying value.
      +
      java.lang.NumbertoNumber() +
      Returns the Java primitive wrapper.
      +
      java.lang.StringtoString() +
      If isNull(), returns "null", otherwise returns + toElement().toString() +
      +
      DSInt + valueOf(DSElement arg) +
      This should convert an element transmitted over DSA, such as + subscription updates or set + requests. +
      +
      static DSInt + valueOf(int arg) +
      Attempts to reuse some common values before creating a new + instance. +
      +
      static DSInt + valueOf(java.lang.String arg) +
      Checks for null, then uses Float.parseFloat()
      +
      + +
        +
      • + + +

        Methods inherited from class java.lang.Object

        + clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        NULL

        +
        public static final DSInt NULL
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        equals

        +
        public boolean equals(java.lang.Object arg)
        +
        True if the argument is a DSINumber and the values are equal or + they are both isNull. +
        +
        +
        Overrides:
        +
        equals in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        getValueType

        +
        public DSValueType getValueType()
        +
        Description copied from interface: DSIValue +
        +
        The DSA type mapping.
        +
        +
        Specified by:
        +
        getValueType in + interface DSIValue +
        +
        +
      • +
      + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        +
        Overrides:
        +
        hashCode in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        isDouble

        +
        public boolean isDouble()
        +
        Description copied from interface: DSINumber +
        +
        Whether or not the object represents a double.
        +
        +
        Specified by:
        +
        isDouble in + interface DSINumber +
        +
        +
      • +
      + + + +
        +
      • +

        isEqual

        +
        public boolean isEqual(java.lang.Object obj)
        +
        Description copied from interface: DSIObject +
        +
        Equals implementation that doesn't require hashCodes to equal, + primarily intended + so for comparing nodes. +
        +
        +
        Specified by:
        +
        isEqual in + interface DSIObject +
        +
        +
      • +
      + + + +
        +
      • +

        isFloat

        +
        public boolean isFloat()
        +
        Description copied from interface: DSINumber +
        +
        Whether or not the object represents a double.
        +
        +
        Specified by:
        +
        isFloat in + interface DSINumber +
        +
        +
      • +
      + + + +
        +
      • +

        isInt

        +
        public boolean isInt()
        +
        Description copied from interface: DSINumber +
        +
        Whether or not the object represents an int.
        +
        +
        Specified by:
        +
        isInt in + interface DSINumber +
        +
        +
      • +
      + + + +
        +
      • +

        isLong

        +
        public boolean isLong()
        +
        Description copied from interface: DSINumber +
        +
        Whether or not the object represents a long.
        +
        +
        Specified by:
        +
        isLong in + interface DSINumber +
        +
        +
      • +
      + + + +
        +
      • +

        isNull

        +
        public boolean isNull()
        +
        Description copied from interface: DSIValue +
        +
        Values should have an instance representing null. This will allow + null defaults in nodes, + but the null instance can be used to properly decode incoming values such as set + requests. +
        +
        +
        Specified by:
        +
        isNull in + interface DSIObject +
        +
        Specified by:
        +
        isNull in + interface DSIValue +
        +
        +
      • +
      + + + +
        +
      • +

        toDouble

        +
        public double toDouble()
        +
        Description copied from interface: DSINumber +
        +
        If not a double, will cast the underlying value.
        +
        +
        Specified by:
        +
        toDouble in + interface DSINumber +
        +
        +
      • +
      + + + +
        +
      • +

        toElement

        +
        public DSElement toElement()
        +
        Description copied from interface: DSIValue +
        +
        The current value should convert itself to an element for DSA + interop such as subscription + updates, and setting requests. This is not for configuration database + serialization. +
        +
        +
        Specified by:
        +
        toElement in + interface DSIValue +
        +
        +
      • +
      + + + +
        +
      • +

        toFloat

        +
        public float toFloat()
        +
        Description copied from interface: DSINumber +
        +
        If not a float, will cast the underlying value.
        +
        +
        Specified by:
        +
        toFloat in + interface DSINumber +
        +
        +
      • +
      + + + +
        +
      • +

        toInt

        +
        public int toInt()
        +
        Description copied from interface: DSINumber +
        +
        If not an int, will cast the underlying value.
        +
        +
        Specified by:
        +
        toInt in + interface DSINumber +
        +
        +
      • +
      + + + +
        +
      • +

        toLong

        +
        public long toLong()
        +
        Description copied from interface: DSINumber +
        +
        If not a long, will cast the underlying value.
        +
        +
        Specified by:
        +
        toLong in + interface DSINumber +
        +
        +
      • +
      + + + +
        +
      • +

        toNumber

        +
        public java.lang.Number toNumber()
        +
        Description copied from interface: DSINumber +
        +
        Returns the Java primitive wrapper.
        +
        +
        Specified by:
        +
        toNumber in + interface DSINumber +
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        Description copied from class: DSValue +
        +
        If isNull(), returns "null", otherwise returns + toElement().toString() +
        +
        +
        Overrides:
        +
        toString in + class DSValue
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public DSInt valueOf(DSElement arg)
        +
        Description copied from interface: DSIValue +
        +
        This should convert an element transmitted over DSA, such as + subscription updates or set + requests. This is not for configuration database deserialization. +
        +
        +
        Specified by:
        +
        valueOf in + interface DSIValue +
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static DSInt valueOf(int arg)
        +
        Attempts to reuse some common values before creating a new + instance. +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static DSInt valueOf(java.lang.String arg)
        +
        Checks for null, then uses Float.parseFloat()
        +
      • +
      +
    • +
    +
  • +
+
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/node/DSList.html b/docs/javadoc/org/iot/dsa/node/DSList.html index 03bad3de..9948d017 100644 --- a/docs/javadoc/org/iot/dsa/node/DSList.html +++ b/docs/javadoc/org/iot/dsa/node/DSList.html @@ -1,12 +1,13 @@ - + - -DSList (dslink-core 0.15.0 API) - - - + + DSList (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.node
-

Class DSList

+
org.iot.dsa.node
+

Class DSList

- -
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    java.lang.Iterable<DSElement>, DSIObject, DSIValue
    -
    -
    -
    -
    public class DSList
    +  
    +  
    +
    +
    Indexed collection of elements. -

    +

    - This can be mounted in the node tree. However, the parent node will not know when it has been - modified, so the modifier is responsible for calling DSNode.childChanged(DSInfo). + This can be mounted in the node tree. However, the parent node will not know when it has + been + modified, so the modifier is responsible for calling DSNode.childChanged(DSInfo). -

    +

    - This is not thread safe.

    -
  • -
-
-
- -
-
-
    -
  • - -
      -
    • - - -

      Field Detail

      - - - -
        -
      • -

        list

        -
        protected java.util.ArrayList list
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        DSList

        -
        public DSList()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        add

        -
        public DSList add(DSElement val)
        -
        Adds the value and returns this.
        -
        -
        Parameters:
        -
        val - Can be null, and can not be an already parented group.
        -
        Returns:
        -
        this
        -
        -
      • -
      - - - -
        -
      • -

        add

        -
        public DSList add(boolean val)
        -
        Appends the primitive and returns this.
        -
      • -
      - - - -
        -
      • -

        add

        -
        public DSList add(double val)
        -
        Appends the primitive and returns this.
        -
      • -
      - - - -
        -
      • -

        add

        -
        public DSList add(long val)
        -
        Appends the primitive and returns this.
        -
      • -
      - - - -
        -
      • -

        add

        -
        public DSList add(java.lang.String val)
        -
        Appends the primitive and returns this.
        -
      • -
      - - - -
        -
      • -

        add

        -
        public DSList add(int val)
        -
        Appends the primitive and returns this.
        -
      • -
      - - - -
        -
      • -

        addAll

        -
        public DSList addAll(DSList list)
        -
        Add all elements of the argument to this list and returns this.
        -
      • -
      - - - -
        -
      • -

        addList

        -
        public DSList addList()
        -
        Appends a new list and returns it. This is going to cause trouble, but the the primary usage - won't be to add an empty list.
        -
      • -
      - - - -
        -
      • -

        addMap

        -
        public DSMap addMap()
        -
        Appends a new map and returns it.
        -
      • -
      - - - -
        -
      • -

        addNull

        -
        public DSList addNull()
        -
        Appends null and returns this.
        -
      • -
      - - - -
        -
      • -

        clear

        -
        public DSList clear()
        -
        Description copied from class: DSGroup
        -
        Removes all items.
        -
        -
        Specified by:
        -
        clear in class DSGroup
        -
        Returns:
        -
        This
        -
        -
      • -
      - - - -
        -
      • -

        contains

        -
        public boolean contains(DSElement value)
        -
      • -
      - - - -
        -
      • -

        copy

        -
        public DSList copy()
        -
        Description copied from class: DSElement
        -
        If an object is mutable (list or map) then this should clone it, immutable objects can simply - return themselves.
        -
        -
        Specified by:
        -
        copy in interface DSIObject
        -
        Overrides:
        -
        copy in class DSElement
        -
        -
      • -
      - - - - - - - -
        -
      • -

        get

        -
        public DSElement get(int idx)
        -
        Description copied from class: DSGroup
        -
        Returns the value at the given index.
        -
        -
        Specified by:
        -
        get in class DSGroup
        -
        -
      • -
      - - - - - - - - - - - -
        -
      • -

        isList

        -
        public boolean isList()
        -
        Returns true.
        -
        -
        Overrides:
        -
        isList in class DSElement
        -
        -
      • -
      - - - - - - - -
        -
      • -

        iterator

        -
        public java.util.Iterator<DSElement> iterator()
        -
        Returns an iterator that does not implement remove.
        -
        -
        Specified by:
        -
        iterator in interface java.lang.Iterable<DSElement>
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public DSList put(int idx,
        -                  DSElement val)
        -
        Replaces a value and returns this.
        -
        -
        Parameters:
        -
        val - Can be null.
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public DSList put(int idx,
        +            This is not thread safe.
+ + +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        list

        +
        protected java.util.ArrayList list
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DSList

        +
        public DSList()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        add

        +
        public DSList add(DSElement val)
        +
        Adds the value and returns this.
        +
        +
        Parameters:
        +
        val - Can be null, and can not be an already parented group.
        +
        Returns:
        +
        this
        +
        +
      • +
      + + + +
        +
      • +

        add

        +
        public DSList add(boolean val)
        +
        Appends the primitive and returns this.
        +
      • +
      + + + +
        +
      • +

        add

        +
        public DSList add(double val)
        +
        Appends the primitive and returns this.
        +
      • +
      + + + +
        +
      • +

        add

        +
        public DSList add(long val)
        +
        Appends the primitive and returns this.
        +
      • +
      + + + +
        +
      • +

        add

        +
        public DSList add(java.lang.String val)
        +
        Appends the primitive and returns this.
        +
      • +
      + + + +
        +
      • +

        add

        +
        public DSList add(int val)
        +
        Appends the primitive and returns this.
        +
      • +
      + + + +
        +
      • +

        addAll

        +
        public DSList addAll(DSList list)
        +
        Add all elements of the argument to this list and returns this. +
        +
      • +
      + + + +
        +
      • +

        addList

        +
        public DSList addList()
        +
        Appends a new list and returns it. This is going to cause + trouble, but the the primary usage + won't be to add an empty list. +
        +
      • +
      + + + +
        +
      • +

        addMap

        +
        public DSMap addMap()
        +
        Appends a new map and returns it.
        +
      • +
      + + + +
        +
      • +

        addNull

        +
        public DSList addNull()
        +
        Appends null and returns this.
        +
      • +
      + + + +
        +
      • +

        clear

        +
        public DSList clear()
        +
        Description copied from class: DSGroup +
        +
        Removes all items.
        +
        +
        Specified by:
        +
        clear in + class DSGroup
        +
        Returns:
        +
        This
        +
        +
      • +
      + + + +
        +
      • +

        contains

        +
        public boolean contains(DSElement value)
        +
      • +
      + + + +
        +
      • +

        copy

        +
        public DSList copy()
        +
        Description copied from class: DSElement +
        +
        If an object is mutable (list or map) then this should clone it, + immutable objects can simply + return themselves. +
        +
        +
        Specified by:
        +
        copy in + interface DSIObject +
        +
        Overrides:
        +
        copy in + class DSElement
        +
        +
      • +
      + + + + + + + +
        +
      • +

        get

        +
        public DSElement get(int idx)
        +
        Description copied from class: DSGroup +
        +
        Returns the value at the given index.
        +
        +
        Specified by:
        +
        get in + class DSGroup
        +
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        isList

        +
        public boolean isList()
        +
        Returns true.
        +
        +
        Overrides:
        +
        isList in + class DSElement
        +
        +
      • +
      + + + + + + + +
        +
      • +

        iterator

        +
        public java.util.Iterator<DSElement> iterator()
        +
        Returns an iterator that does not implement remove.
        +
        +
        Specified by:
        +
        iterator in interface java.lang.Iterable<DSElement>
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public DSList put(int idx,
        +                  DSElement val)
        +
        Replaces a value and returns this.
        +
        +
        Parameters:
        +
        val - Can be null.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public DSList put(int idx,
                           boolean val)
        -
        Primitive setter, returns this.
        -
      • -
      - - - -
        -
      • -

        put

        -
        public DSList put(int idx,
        +                
        Primitive setter, returns this.
        +
      • +
      + + + +
        +
      • +

        put

        +
        public DSList put(int idx,
                           double val)
        -
        Primitive setter, returns this.
        -
      • -
      - - - -
        -
      • -

        put

        -
        public DSList put(int idx,
        +                
        Primitive setter, returns this.
        +
      • +
      + + + +
        +
      • +

        put

        +
        public DSList put(int idx,
                           int val)
        -
        Primitive setter, returns this.
        -
      • -
      - - - -
        -
      • -

        put

        -
        public DSList put(int idx,
        +                
        Primitive setter, returns this.
        +
      • +
      + + + +
        +
      • +

        put

        +
        public DSList put(int idx,
                           long val)
        -
        Primitive setter, returns this.
        -
      • -
      - - - -
        -
      • -

        put

        -
        public DSList put(int idx,
        +                
        Primitive setter, returns this.
        +
      • +
      + + + +
        +
      • +

        put

        +
        public DSList put(int idx,
                           java.lang.String val)
        -
        Primitive setter, returns this.
        -
      • -
      - - - -
        -
      • -

        remove

        -
        public DSElement remove(int idx)
        -
        Description copied from class: DSGroup
        -
        Removes the value at the given index and returns it.
        -
        -
        Specified by:
        -
        remove in class DSGroup
        -
        Returns:
        -
        The value removed.
        -
        -
      • -
      - - - -
        -
      • -

        size

        -
        public int size()
        -
        Description copied from class: DSGroup
        -
        The number of items is the group.
        -
        -
        Specified by:
        -
        size in class DSGroup
        -
        -
      • -
      - - - -
        -
      • -

        toList

        -
        public DSList toList()
        -
        Description copied from class: DSElement
        -
        Lists return themselves, everything else results in an exception.
        -
        -
        Overrides:
        -
        toList in class DSElement
        -
        -
      • -
      - - - - - - - - - - - -
        -
      • -

        valueOf

        -
        public static DSList valueOf(java.lang.Double... values)
        -
      • -
      - - - -
        -
      • -

        valueOf

        -
        public static DSList valueOf(java.lang.Long... values)
        -
      • -
      - - - -
        -
      • -

        valueOf

        -
        public static DSList valueOf(java.lang.String... values)
        -
      • -
      -
    • -
    -
  • -
-
+
Primitive setter, returns this.
+ + + + + +
    +
  • +

    remove

    +
    public DSElement remove(int idx)
    +
    Description copied from class: DSGroup +
    +
    Removes the value at the given index and returns it.
    +
    +
    Specified by:
    +
    remove in + class DSGroup
    +
    Returns:
    +
    The value removed.
    +
    +
  • +
+ + + +
    +
  • +

    size

    +
    public int size()
    +
    Description copied from class: DSGroup +
    +
    The number of items is the group.
    +
    +
    Specified by:
    +
    size in + class DSGroup
    +
    +
  • +
+ + + +
    +
  • +

    toList

    +
    public DSList toList()
    +
    Description copied from class: DSElement +
    +
    Lists return themselves, everything else results in an + exception. +
    +
    +
    Overrides:
    +
    toList in + class DSElement
    +
    +
  • +
+ + + + + + + + + + + +
    +
  • +

    valueOf

    +
    public static DSList valueOf(java.lang.Double... values)
    +
  • +
+ + + +
    +
  • +

    valueOf

    +
    public static DSList valueOf(java.lang.Long... values)
    +
  • +
+ + + +
    +
  • +

    valueOf

    +
    public static DSList valueOf(java.lang.String... values)
    +
  • +
+ + + + + + + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/node/DSLong.html b/docs/javadoc/org/iot/dsa/node/DSLong.html index fa9cb7f7..3eea3c1c 100644 --- a/docs/javadoc/org/iot/dsa/node/DSLong.html +++ b/docs/javadoc/org/iot/dsa/node/DSLong.html @@ -1,12 +1,13 @@ - + - -DSLong (dslink-core 0.15.0 API) - - - + + DSLong (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.node
-

Class DSLong

+
org.iot.dsa.node
+

Class DSLong

- -
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    DSINumber, DSIObject, DSIValue
    -
    -
    -
    -
    public class DSLong
    +  
    +  
    + -
    -
    - -
    -
    -
      -
    • - -
        -
      • - - -

        Field Detail

        - - - -
          -
        • -

          NULL

          -
          public static final DSLong NULL
          -
        • -
        -
      • -
      - -
        -
      • - - -

        Method Detail

        - - - -
          -
        • -

          equals

          -
          public boolean equals(java.lang.Object arg)
          -
          True if the argument is a DSINumber and the values are equal or they are both isNull.
          -
          -
          Overrides:
          -
          equals in class java.lang.Object
          -
          -
        • -
        - - - - - - - - - - - -
          -
        • -

          hashCode

          -
          public int hashCode()
          -
          -
          Overrides:
          -
          hashCode in class java.lang.Object
          -
          -
        • -
        - - - -
          -
        • -

          isLong

          -
          public boolean isLong()
          -
          Description copied from class: DSElement
          -
          Whether or not the object represents a long.
          -
          -
          Specified by:
          -
          isLong in interface DSINumber
          -
          Overrides:
          -
          isLong in class DSElement
          -
          -
        • -
        - - - -
          -
        • -

          isNull

          -
          public boolean isNull()
          -
          Description copied from class: DSElement
          -
          Whether or not the object represents null.
          -
          -
          Specified by:
          -
          isNull in interface DSIObject
          -
          Specified by:
          -
          isNull in interface DSIValue
          -
          Overrides:
          -
          isNull in class DSElement
          -
          -
        • -
        - - - -
          -
        • -

          isNumber

          -
          public boolean isNumber()
          -
          Description copied from class: DSElement
          -
          Whether or not the object represents a number.
          -
          -
          Overrides:
          -
          isNumber in class DSElement
          -
          -
        • -
        - - - -
          -
        • -

          toBoolean

          -
          public boolean toBoolean()
          -
          Description copied from class: DSElement
          -
          Attempts to return a boolean value. Numerics will return false for 0 and true for anything - else. Strings should return true for "true" or "1" and false for "false" or "0". Anything - else will throws a ClassCastException.
          -
          -
          Overrides:
          -
          toBoolean in class DSElement
          -
          -
        • -
        - - - -
          -
        • -

          toDouble

          -
          public double toDouble()
          -
          Description copied from class: DSElement
          -
          Attempts to return a double value. Numerics of other types will cast the results. Booleans - will return 0 for false and 1 for true. Strings will attempt to parseRequest the numeric - which may result in a parseRequest exception. Anything else will throw a - ClassCastException.
          -
          -
          Specified by:
          -
          toDouble in interface DSINumber
          -
          Overrides:
          -
          toDouble in class DSElement
          -
          -
        • -
        - - - -
          -
        • -

          toFloat

          -
          public float toFloat()
          -
          Description copied from class: DSElement
          -
          Attempts to return a float value. Numerics of other types will cast the results. Booleans - will return 0 for false and 1 for true. Strings will attempt to parseRequest the numeric - which may result in a parseRequest exception. Anything else will throw a - ClassCastException.
          -
          -
          Specified by:
          -
          toFloat in interface DSINumber
          -
          Overrides:
          -
          toFloat in class DSElement
          -
          -
        • -
        - - - -
          -
        • -

          toInt

          -
          public int toInt()
          -
          Description copied from class: DSElement
          -
          Attempts to return an int value. Numerics of other types will cast the results. Booleans - will return 0 for false and 1 for true. Strings will attempt to parseRequest the numeric - which may result in a parseRequest exception. Anything else will throw a - ClassCastException.
          -
          -
          Specified by:
          -
          toInt in interface DSINumber
          -
          Overrides:
          -
          toInt in class DSElement
          -
          -
        • -
        - - - -
          -
        • -

          toLong

          -
          public long toLong()
          -
          Description copied from class: DSElement
          -
          Attempts to return a long value. Numerics of other types will cast the results. Booleans - will return 0 for false and 1 for true. Strings will attempt to parseRequest the numeric - which may result in a parseRequest exception. Anything else will throw a - ClassCastException.
          -
          -
          Specified by:
          -
          toLong in interface DSINumber
          -
          Overrides:
          -
          toLong in class DSElement
          -
          -
        • -
        - - - -
          -
        • -

          toNumber

          -
          public java.lang.Number toNumber()
          -
          Description copied from interface: DSINumber
          -
          Returns the Java primitive wrapper.
          -
          -
          Specified by:
          -
          toNumber in interface DSINumber
          -
          -
        • -
        - - - -
          -
        • -

          toString

          -
          public java.lang.String toString()
          -
          Description copied from class: DSValue
          -
          If isNull(), returns "null", otherwise returns toElement().toString()
          -
          -
          Overrides:
          -
          toString in class DSValue
          -
          -
        • -
        - - - - - - - -
          -
        • -

          valueOf

          -
          public static DSLong valueOf(long arg)
          -
          Attempts to reuse some common values before creating a new instance.
          -
        • -
        - - - -
          -
        • -

          valueOf

          -
          public static DSLong valueOf(java.lang.String arg)
          -
          Checks for null, then uses Float.parseFloat()
          -
        • -
        -
      • -
      -
    • -
    -
    +implements DSINumber
    +
    A 64 bit integer (a Java long).
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        NULL

        +
        public static final DSLong NULL
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        equals

        +
        public boolean equals(java.lang.Object arg)
        +
        True if the argument is a DSINumber and the values are equal or + they are both isNull. +
        +
        +
        Overrides:
        +
        equals in class java.lang.Object
        +
        +
      • +
      + + + + + + + + + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        +
        Overrides:
        +
        hashCode in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        isLong

        +
        public boolean isLong()
        +
        Description copied from class: DSElement +
        +
        Whether or not the object represents a long.
        +
        +
        Specified by:
        +
        isLong in + interface DSINumber +
        +
        Overrides:
        +
        isLong in + class DSElement
        +
        +
      • +
      + + + +
        +
      • +

        isNull

        +
        public boolean isNull()
        +
        Description copied from class: DSElement +
        +
        Whether or not the object represents null.
        +
        +
        Specified by:
        +
        isNull in + interface DSIObject +
        +
        Specified by:
        +
        isNull in + interface DSIValue +
        +
        Overrides:
        +
        isNull in + class DSElement
        +
        +
      • +
      + + + +
        +
      • +

        isNumber

        +
        public boolean isNumber()
        +
        Description copied from class: DSElement +
        +
        Whether or not the object represents a number.
        +
        +
        Overrides:
        +
        isNumber in + class DSElement
        +
        +
      • +
      + + + +
        +
      • +

        toBoolean

        +
        public boolean toBoolean()
        +
        Description copied from class: DSElement +
        +
        Attempts to return a boolean value. Numerics will return false + for 0 and true for anything + else. Strings should return true for "true" or "1" and false for "false" or "0". + Anything + else will throws a ClassCastException. +
        +
        +
        Overrides:
        +
        toBoolean in + class DSElement
        +
        +
      • +
      + + + +
        +
      • +

        toDouble

        +
        public double toDouble()
        +
        Description copied from class: DSElement +
        +
        Attempts to return a double value. Numerics of other types will + cast the results. Booleans + will return 0 for false and 1 for true. Strings will attempt to parseRequest the + numeric + which may result in a parseRequest exception. Anything else will throw a + ClassCastException. +
        +
        +
        Specified by:
        +
        toDouble in + interface DSINumber +
        +
        Overrides:
        +
        toDouble in + class DSElement
        +
        +
      • +
      + + + +
        +
      • +

        toFloat

        +
        public float toFloat()
        +
        Description copied from class: DSElement +
        +
        Attempts to return a float value. Numerics of other types will + cast the results. Booleans + will return 0 for false and 1 for true. Strings will attempt to parseRequest the + numeric + which may result in a parseRequest exception. Anything else will throw a + ClassCastException. +
        +
        +
        Specified by:
        +
        toFloat in + interface DSINumber +
        +
        Overrides:
        +
        toFloat in + class DSElement
        +
        +
      • +
      + + + +
        +
      • +

        toInt

        +
        public int toInt()
        +
        Description copied from class: DSElement +
        +
        Attempts to return an int value. Numerics of other types will + cast the results. Booleans + will return 0 for false and 1 for true. Strings will attempt to parseRequest the + numeric + which may result in a parseRequest exception. Anything else will throw a + ClassCastException. +
        +
        +
        Specified by:
        +
        toInt in + interface DSINumber +
        +
        Overrides:
        +
        toInt in + class DSElement
        +
        +
      • +
      + + + +
        +
      • +

        toLong

        +
        public long toLong()
        +
        Description copied from class: DSElement +
        +
        Attempts to return a long value. Numerics of other types will + cast the results. Booleans + will return 0 for false and 1 for true. Strings will attempt to parseRequest the + numeric + which may result in a parseRequest exception. Anything else will throw a + ClassCastException. +
        +
        +
        Specified by:
        +
        toLong in + interface DSINumber +
        +
        Overrides:
        +
        toLong in + class DSElement
        +
        +
      • +
      + + + +
        +
      • +

        toNumber

        +
        public java.lang.Number toNumber()
        +
        Description copied from interface: DSINumber +
        +
        Returns the Java primitive wrapper.
        +
        +
        Specified by:
        +
        toNumber in + interface DSINumber +
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        Description copied from class: DSValue +
        +
        If isNull(), returns "null", otherwise returns + toElement().toString() +
        +
        +
        Overrides:
        +
        toString in + class DSValue
        +
        +
      • +
      + + + + + + + +
        +
      • +

        valueOf

        +
        public static DSLong valueOf(long arg)
        +
        Attempts to reuse some common values before creating a new + instance. +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static DSLong valueOf(java.lang.String arg)
        +
        Checks for null, then uses Float.parseFloat()
        +
      • +
      +
    • +
    +
  • +
+
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/node/DSMap.html b/docs/javadoc/org/iot/dsa/node/DSMap.html index 5321da59..cd97debb 100644 --- a/docs/javadoc/org/iot/dsa/node/DSMap.html +++ b/docs/javadoc/org/iot/dsa/node/DSMap.html @@ -1,12 +1,13 @@ - + - -DSMap (dslink-core 0.15.0 API) - - - + + DSMap (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.node
-

Class DSMap

+
org.iot.dsa.node
+

Class DSMap

- -
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    DSIObject, DSIValue
    -
    -
    -
    -
    public class DSMap
    +  
    +  
    +
      +
    • +
      +
      All Implemented Interfaces:
      +
      DSIObject, DSIValue
      +
      +
      +
      +
      public class DSMap
       extends DSGroup
      -
      String keyed collection of elements that preserves the order of addition. Keys and values can be - accessed via index. +
      String keyed collection of elements that preserves the order of addition. + Keys and values can be + accessed via index. -

      +

      - This can be mounted in the node tree. However, the parent node will not know when it has been - modified, so the modifier is responsible for calling DSNode.childChanged(DSInfo). + This can be mounted in the node tree. However, the parent node will not know when it has + been + modified, so the modifier is responsible for calling DSNode.childChanged(DSInfo). -

      +

      - This is not thread safe.

      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Nested Class Summary

        - - - - - - - - - - -
        Nested Classes 
        Modifier and TypeClass and Description
        static class DSMap.Entry -
        Allows values to be accessed quickly by index in the list, rather than having to do a key - lookup in the map.
        -
        -
      • -
      - -
        -
      • - - -

        Field Summary

        - - - - - - - - - - - - - - -
        Fields 
        Modifier and TypeField and Description
        protected java.util.List<DSMap.Entry>keys -
        For preserving order.
        -
        protected java.util.Map<java.lang.String,DSMap.Entry>map 
        -
      • -
      - -
        -
      • - - -

        Constructor Summary

        - - - - - - - - -
        Constructors 
        Constructor and Description
        DSMap() 
        -
      • -
      - -
        -
      • - - -

        Method Summary

        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        All Methods Instance Methods Concrete Methods 
        Modifier and TypeMethod and Description
        DSMapclear() -
        Removes all items.
        -
        booleancontains(java.lang.String key) 
        DSElementcopy() -
        If an object is mutable (list or map) then this should clone it, immutable objects can simply - return themselves.
        -
        booleanequals(java.lang.Object arg) 
        DSElementget(int idx) -
        Returns the value at the given index.
        -
        DSElementget(java.lang.String key) -
        Returns the value for the given key.
        -
        booleanget(java.lang.String key, - boolean def) -
        Optional getter, returns the provided default if the value mapped to the key is null or not - convertible.
        -
        doubleget(java.lang.String key, - double def) -
        Optional getter, returns the provided default if the value mapped to the key is null.
        -
        intget(java.lang.String key, - int def) -
        Optional getter, returns the provided default if the value mapped to the key is null or not - convertible.
        -
        longget(java.lang.String key, - long def) -
        Optional getter, returns the provided default if the value mapped to the key is null or not - convertible.
        -
        java.lang.Stringget(java.lang.String key, - java.lang.String def) -
        Optional getter, returns the provided default if the value mapped to the key is null.
        -
        booleangetBoolean(java.lang.String key) -
        Primitive getter.
        -
        doublegetDouble(java.lang.String key) -
        Primitive getter.
        -
        DSElementTypegetElementType() -
        For switch statements.
        -
        DSMap.EntrygetEntry(int index) 
        DSMap.EntrygetEntry(java.lang.String key) 
        intgetInt(java.lang.String key) -
        Primitive getter.
        -
        java.lang.StringgetKey(int idx) -
        Returns the key at the given index.
        -
        DSListgetList(java.lang.String key) -
        Return the list, or null.
        -
        longgetLong(java.lang.String key) -
        Primitive getter.
        -
        DSMapgetMap(java.lang.String key) -
        Returns the map value for the given key, or null.
        -
        java.lang.StringgetString(java.lang.String key) -
        Returns the String value for the given key, or null.
        -
        DSValueTypegetValueType() -
        The DSA value type mapping.
        -
        inthashCode() 
        intindexOf(java.lang.String key) -
        Index of the given key, or -1.
        -
        booleanisMap() -
        Returns true.
        -
        booleanisNull() -
        Returns false.
        -
        booleanisNull(java.lang.String key) -
        Returns true if the key isn't in the map, or it's value is null.
        -
        DSMapput(java.lang.String key, - boolean val) -
        Primitive setter, returns this.
        -
        DSMapput(java.lang.String key, - double val) -
        Primitive setter, returns this.
        -
        DSMapput(java.lang.String key, - DSElement val) -
        Adds or replaces the value for the given key and returns this.
        -
        DSMapput(java.lang.String key, - int val) -
        Primitive setter, returns this.
        -
        DSMapput(java.lang.String key, - long val) -
        Primitive setter, returns this.
        -
        DSMapput(java.lang.String key, - java.lang.String val) -
        Primitive setter, returns this.
        -
        DSMapput(java.lang.String key, - java.lang.Throwable val) -
        Puts a String representing the stack trace into the map.
        -
        DSMapputAll(DSMap toAdd) -
        Adds / overwrites entries in this map with those from the given.
        -
        DSListputList(java.lang.String key) -
        Puts a new list for given key and returns it.
        -
        DSMapputMap(java.lang.String key) -
        Puts a new map for given key and returns it.
        -
        DSMapputNull(java.lang.String key) -
        Puts a null value for given key and returns this.
        -
        DSElementremove(int idx) -
        Removes the value at the given index and returns it.
        -
        DSElementremove(java.lang.String key) -
        Removes the key-value pair and returns the removed value.
        -
        intsize() -
        The number of items is the group.
        -
        DSMaptoElement() -
        Returns this.
        -
        DSMaptoMap() -
        Maps return themselves, everything else results in an exception.
        -
        DSMapvalueOf(DSElement element) -
        Returns the argument.
        -
        - - -
          -
        • - - -

          Methods inherited from class java.lang.Object

          -clone, finalize, getClass, notify, notifyAll, wait, wait, wait
        • -
        -
      • -
      -
    • -
    -
    -
    -
      -
    • - -
        -
      • - - -

        Field Detail

        - - - -
          -
        • -

          keys

          -
          protected java.util.List<DSMap.Entry> keys
          -
          For preserving order.
          -
        • -
        - - - -
          -
        • -

          map

          -
          protected java.util.Map<java.lang.String,DSMap.Entry> map
          -
        • -
        -
      • -
      - -
        -
      • - - -

        Constructor Detail

        - - - -
          -
        • -

          DSMap

          -
          public DSMap()
          -
        • -
        -
      • -
      - -
        -
      • - - -

        Method Detail

        - - - -
          -
        • -

          clear

          -
          public DSMap clear()
          -
          Description copied from class: DSGroup
          -
          Removes all items.
          -
          -
          Specified by:
          -
          clear in class DSGroup
          -
          Returns:
          -
          This
          -
          -
        • -
        - - - -
          -
        • -

          contains

          -
          public boolean contains(java.lang.String key)
          -
        • -
        - - - -
          -
        • -

          copy

          -
          public DSElement copy()
          -
          Description copied from class: DSElement
          -
          If an object is mutable (list or map) then this should clone it, immutable objects can simply - return themselves.
          -
          -
          Specified by:
          -
          copy in interface DSIObject
          -
          Overrides:
          -
          copy in class DSElement
          -
          -
        • -
        - - - -
          -
        • -

          equals

          -
          public boolean equals(java.lang.Object arg)
          -
          -
          Overrides:
          -
          equals in class DSGroup
          -
          -
        • -
        - - - -
          -
        • -

          get

          -
          public DSElement get(int idx)
          -
          Description copied from class: DSGroup
          -
          Returns the value at the given index.
          -
          -
          Specified by:
          -
          get in class DSGroup
          -
          -
        • -
        - - - -
          -
        • -

          get

          -
          public DSElement get(java.lang.String key)
          -
          Returns the value for the given key.
          -
          -
          Returns:
          -
          Possibly null.
          -
          -
        • -
        - - - -
          -
        • -

          get

          -
          public boolean get(java.lang.String key,
          +            This is not thread safe.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClass and Description
      static class DSMap.Entry +
      Allows values to be accessed quickly by index in the list, + rather than having to do a key + lookup in the map. +
      +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      protected java.util.List<DSMap.Entry>keys +
      For preserving order.
      +
      protected java.util.Map<java.lang.String,DSMap.Entry>map  +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      DSMap()  +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      DSMap + clear() +
      Removes all items.
      +
      booleancontains(java.lang.String key)  +
      DSElement + copy() +
      If an object is mutable (list or map) then this should clone + it, immutable objects can simply + return themselves. +
      +
      booleanequals(java.lang.Object arg)  +
      DSElement + get(int idx) +
      Returns the value at the given index.
      +
      DSElement + get(java.lang.String key) +
      Returns the value for the given key.
      +
      booleanget(java.lang.String key, + boolean def) +
      Optional getter, returns the provided default if the value + mapped to the key is null or not + convertible. +
      +
      doubleget(java.lang.String key, + double def) +
      Optional getter, returns the provided default if the value + mapped to the key is null. +
      +
      intget(java.lang.String key, + int def) +
      Optional getter, returns the provided default if the value + mapped to the key is null or not + convertible. +
      +
      longget(java.lang.String key, + long def) +
      Optional getter, returns the provided default if the value + mapped to the key is null or not + convertible. +
      +
      java.lang.Stringget(java.lang.String key, + java.lang.String def) +
      Optional getter, returns the provided default if the value + mapped to the key is null. +
      +
      booleangetBoolean(java.lang.String key) +
      Primitive getter.
      +
      doublegetDouble(java.lang.String key) +
      Primitive getter.
      +
      DSElementType + getElementType() +
      For switch statements.
      +
      DSMap.Entry + getEntry(int index)  +
      DSMap.Entry + getEntry(java.lang.String key)  +
      intgetInt(java.lang.String key) +
      Primitive getter.
      +
      java.lang.StringgetKey(int idx) +
      Returns the key at the given index.
      +
      DSList + getList(java.lang.String key) +
      Return the list, or null.
      +
      longgetLong(java.lang.String key) +
      Primitive getter.
      +
      DSMap + getMap(java.lang.String key) +
      Returns the map value for the given key, or null.
      +
      java.lang.StringgetString(java.lang.String key) +
      Returns the String value for the given key, or null.
      +
      DSValueType + getValueType() +
      The DSA value type mapping.
      +
      inthashCode()  +
      intindexOf(java.lang.String key) +
      Index of the given key, or -1.
      +
      booleanisMap() +
      Returns true.
      +
      booleanisNull() +
      Returns false.
      +
      booleanisNull(java.lang.String key) +
      Returns true if the key isn't in the map, or it's value is + null. +
      +
      DSMap + put(java.lang.String key, + boolean val) +
      Primitive setter, returns this.
      +
      DSMap + put(java.lang.String key, + double val) +
      Primitive setter, returns this.
      +
      DSMap + put(java.lang.String key, + DSElement val) +
      Adds or replaces the value for the given key and returns + this. +
      +
      DSMap + put(java.lang.String key, + int val) +
      Primitive setter, returns this.
      +
      DSMap + put(java.lang.String key, + long val) +
      Primitive setter, returns this.
      +
      DSMap + put(java.lang.String key, + java.lang.String val) +
      Primitive setter, returns this.
      +
      DSMap + put(java.lang.String key, + java.lang.Throwable val) +
      Puts a String representing the stack trace into the map.
      +
      DSMap + putAll(DSMap toAdd) +
      Adds / overwrites entries in this map with those from the + given. +
      +
      DSList + putList(java.lang.String key) +
      Puts a new list for given key and returns it.
      +
      DSMap + putMap(java.lang.String key) +
      Puts a new map for given key and returns it.
      +
      DSMap + putNull(java.lang.String key) +
      Puts a null value for given key and returns this.
      +
      DSElement + remove(int idx) +
      Removes the value at the given index and returns it.
      +
      DSElement + remove(java.lang.String key) +
      Removes the key-value pair and returns the removed value.
      +
      intsize() +
      The number of items is the group.
      +
      DSMap + toElement() +
      Returns this.
      +
      DSMap + toMap() +
      Maps return themselves, everything else results in an + exception. +
      +
      DSMap + valueOf(DSElement element) +
      Returns the argument.
      +
      + + +
        +
      • + + +

        Methods inherited from class java.lang.Object

        + clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        keys

        +
        protected java.util.List<DSMap.Entry> keys
        +
        For preserving order.
        +
      • +
      + + + +
        +
      • +

        map

        +
        protected java.util.Map<java.lang.String,DSMap.Entry> map
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DSMap

        +
        public DSMap()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        clear

        +
        public DSMap clear()
        +
        Description copied from class: DSGroup +
        +
        Removes all items.
        +
        +
        Specified by:
        +
        clear in + class DSGroup
        +
        Returns:
        +
        This
        +
        +
      • +
      + + + +
        +
      • +

        contains

        +
        public boolean contains(java.lang.String key)
        +
      • +
      + + + +
        +
      • +

        copy

        +
        public DSElement copy()
        +
        Description copied from class: DSElement +
        +
        If an object is mutable (list or map) then this should clone it, + immutable objects can simply + return themselves. +
        +
        +
        Specified by:
        +
        copy in + interface DSIObject +
        +
        Overrides:
        +
        copy in + class DSElement
        +
        +
      • +
      + + + +
        +
      • +

        equals

        +
        public boolean equals(java.lang.Object arg)
        +
        +
        Overrides:
        +
        equals in + class DSGroup
        +
        +
      • +
      + + + +
        +
      • +

        get

        +
        public DSElement get(int idx)
        +
        Description copied from class: DSGroup +
        +
        Returns the value at the given index.
        +
        +
        Specified by:
        +
        get in + class DSGroup
        +
        +
      • +
      + + + +
        +
      • +

        get

        +
        public DSElement get(java.lang.String key)
        +
        Returns the value for the given key.
        +
        +
        Returns:
        +
        Possibly null.
        +
        +
      • +
      + + + +
        +
      • +

        get

        +
        public boolean get(java.lang.String key,
                            boolean def)
        -
        Optional getter, returns the provided default if the value mapped to the key is null or not - convertible.
        -
      • -
      - - - -
        -
      • -

        get

        -
        public double get(java.lang.String key,
        +                
        Optional getter, returns the provided default if the value mapped + to the key is null or not + convertible. +
        +
      • +
      + + + +
        +
      • +

        get

        +
        public double get(java.lang.String key,
                           double def)
        -
        Optional getter, returns the provided default if the value mapped to the key is null.
        -
      • -
      - - - -
        -
      • -

        get

        -
        public int get(java.lang.String key,
        +                
        Optional getter, returns the provided default if the value mapped + to the key is null. +
        +
      • +
      + + + +
        +
      • +

        get

        +
        public int get(java.lang.String key,
                        int def)
        -
        Optional getter, returns the provided default if the value mapped to the key is null or not - convertible.
        -
      • -
      - - - -
        -
      • -

        get

        -
        public long get(java.lang.String key,
        +                
        Optional getter, returns the provided default if the value mapped + to the key is null or not + convertible. +
        +
      • +
      + + + +
        +
      • +

        get

        +
        public long get(java.lang.String key,
                         long def)
        -
        Optional getter, returns the provided default if the value mapped to the key is null or not - convertible.
        -
      • -
      - - - -
        -
      • -

        get

        -
        public java.lang.String get(java.lang.String key,
        +                
        Optional getter, returns the provided default if the value mapped + to the key is null or not + convertible. +
        +
      • +
      + + + +
        +
      • +

        get

        +
        public java.lang.String get(java.lang.String key,
                                     java.lang.String def)
        -
        Optional getter, returns the provided default if the value mapped to the key is null.
        -
      • -
      - - - -
        -
      • -

        getBoolean

        -
        public boolean getBoolean(java.lang.String key)
        -
        Primitive getter.
        -
      • -
      - - - -
        -
      • -

        getDouble

        -
        public double getDouble(java.lang.String key)
        -
        Primitive getter.
        -
      • -
      - - - - - - - -
        -
      • -

        getEntry

        -
        public DSMap.Entry getEntry(int index)
        -
      • -
      - - - -
        -
      • -

        getEntry

        -
        public DSMap.Entry getEntry(java.lang.String key)
        -
      • -
      - - - -
        -
      • -

        getList

        -
        public DSList getList(java.lang.String key)
        -
        Return the list, or null.
        -
        -
        Returns:
        -
        Possibly null.
        -
        -
      • -
      - - - -
        -
      • -

        getLong

        -
        public long getLong(java.lang.String key)
        -
        Primitive getter.
        -
      • -
      - - - -
        -
      • -

        getInt

        -
        public int getInt(java.lang.String key)
        -
        Primitive getter.
        -
      • -
      - - - -
        -
      • -

        getKey

        -
        public java.lang.String getKey(int idx)
        -
        Returns the key at the given index.
        -
      • -
      - - - -
        -
      • -

        getMap

        -
        public DSMap getMap(java.lang.String key)
        -
        Returns the map value for the given key, or null.
        -
        -
        Returns:
        -
        Possibly null.
        -
        -
      • -
      - - - -
        -
      • -

        getString

        -
        public java.lang.String getString(java.lang.String key)
        -
        Returns the String value for the given key, or null.
        -
        -
        Returns:
        -
        Possibly null.
        -
        -
      • -
      - - - - - - - -
        -
      • -

        hashCode

        -
        public int hashCode()
        -
        -
        Overrides:
        -
        hashCode in class DSGroup
        -
        -
      • -
      - - - -
        -
      • -

        isMap

        -
        public boolean isMap()
        -
        Returns true.
        -
        -
        Overrides:
        -
        isMap in class DSElement
        -
        -
      • -
      - - - - - - - -
        -
      • -

        isNull

        -
        public boolean isNull(java.lang.String key)
        -
        Returns true if the key isn't in the map, or it's value is null.
        -
      • -
      - - - -
        -
      • -

        indexOf

        -
        public int indexOf(java.lang.String key)
        -
        Index of the given key, or -1.
        -
      • -
      - - - -
        -
      • -

        put

        -
        public DSMap put(java.lang.String key,
        -                 DSElement val)
        -
        Adds or replaces the value for the given key and returns this.
        -
        -
        Parameters:
        -
        key - Must not be null.
        -
        val - Can be null, and can not be an already parented group.
        -
        Returns:
        -
        this
        -
        -
      • -
      - - - -
        -
      • -

        put

        -
        public DSMap put(java.lang.String key,
        +                
        Optional getter, returns the provided default if the value mapped + to the key is null. +
        +
      • +
      + + + +
        +
      • +

        getBoolean

        +
        public boolean getBoolean(java.lang.String key)
        +
        Primitive getter.
        +
      • +
      + + + +
        +
      • +

        getDouble

        +
        public double getDouble(java.lang.String key)
        +
        Primitive getter.
        +
      • +
      + + + + + + + +
        +
      • +

        getEntry

        +
        public DSMap.Entry getEntry(int index)
        +
      • +
      + + + +
        +
      • +

        getEntry

        +
        public DSMap.Entry getEntry(java.lang.String key)
        +
      • +
      + + + +
        +
      • +

        getList

        +
        public DSList getList(java.lang.String key)
        +
        Return the list, or null.
        +
        +
        Returns:
        +
        Possibly null.
        +
        +
      • +
      + + + +
        +
      • +

        getLong

        +
        public long getLong(java.lang.String key)
        +
        Primitive getter.
        +
      • +
      + + + +
        +
      • +

        getInt

        +
        public int getInt(java.lang.String key)
        +
        Primitive getter.
        +
      • +
      + + + +
        +
      • +

        getKey

        +
        public java.lang.String getKey(int idx)
        +
        Returns the key at the given index.
        +
      • +
      + + + +
        +
      • +

        getMap

        +
        public DSMap getMap(java.lang.String key)
        +
        Returns the map value for the given key, or null.
        +
        +
        Returns:
        +
        Possibly null.
        +
        +
      • +
      + + + +
        +
      • +

        getString

        +
        public java.lang.String getString(java.lang.String key)
        +
        Returns the String value for the given key, or null.
        +
        +
        Returns:
        +
        Possibly null.
        +
        +
      • +
      + + + + + + + +
        +
      • +

        hashCode

        +
        public int hashCode()
        +
        +
        Overrides:
        +
        hashCode in + class DSGroup
        +
        +
      • +
      + + + +
        +
      • +

        isMap

        +
        public boolean isMap()
        +
        Returns true.
        +
        +
        Overrides:
        +
        isMap in + class DSElement
        +
        +
      • +
      + + + + + + + +
        +
      • +

        isNull

        +
        public boolean isNull(java.lang.String key)
        +
        Returns true if the key isn't in the map, or it's value is + null. +
        +
      • +
      + + + +
        +
      • +

        indexOf

        +
        public int indexOf(java.lang.String key)
        +
        Index of the given key, or -1.
        +
      • +
      + + + +
        +
      • +

        put

        +
        public DSMap put(java.lang.String key,
        +                 DSElement val)
        +
        Adds or replaces the value for the given key and returns this. +
        +
        +
        Parameters:
        +
        key - Must not be null.
        +
        val - Can be null, and can not be an already parented group.
        +
        Returns:
        +
        this
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public DSMap put(java.lang.String key,
                          boolean val)
        -
        Primitive setter, returns this.
        -
      • -
      - - - -
        -
      • -

        put

        -
        public DSMap put(java.lang.String key,
        +                
        Primitive setter, returns this.
        +
      • +
      + + + +
        +
      • +

        put

        +
        public DSMap put(java.lang.String key,
                          double val)
        -
        Primitive setter, returns this.
        -
      • -
      - - - -
        -
      • -

        put

        -
        public DSMap put(java.lang.String key,
        +                
        Primitive setter, returns this.
        +
      • +
      + + + +
        +
      • +

        put

        +
        public DSMap put(java.lang.String key,
                          int val)
        -
        Primitive setter, returns this.
        -
      • -
      - - - -
        -
      • -

        put

        -
        public DSMap put(java.lang.String key,
        +                
        Primitive setter, returns this.
        +
      • +
      + + + +
        +
      • +

        put

        +
        public DSMap put(java.lang.String key,
                          long val)
        -
        Primitive setter, returns this.
        -
      • -
      - - - -
        -
      • -

        put

        -
        public DSMap put(java.lang.String key,
        +                
        Primitive setter, returns this.
        +
      • +
      + + + +
        +
      • +

        put

        +
        public DSMap put(java.lang.String key,
                          java.lang.String val)
        -
        Primitive setter, returns this.
        -
      • -
      - - - -
        -
      • -

        put

        -
        public DSMap put(java.lang.String key,
        +                
        Primitive setter, returns this.
        +
      • +
      + + + +
        +
      • +

        put

        +
        public DSMap put(java.lang.String key,
                          java.lang.Throwable val)
        -
        Puts a String representing the stack trace into the map.
        -
      • -
      - - - -
        -
      • -

        putAll

        -
        public DSMap putAll(DSMap toAdd)
        -
        Adds / overwrites entries in this map with those from the given.
        -
        -
        Returns:
        -
        This
        -
        -
      • -
      - - - -
        -
      • -

        putList

        -
        public DSList putList(java.lang.String key)
        -
        Puts a new list for given key and returns it.
        -
      • -
      - - - -
        -
      • -

        putMap

        -
        public DSMap putMap(java.lang.String key)
        -
        Puts a new map for given key and returns it.
        -
      • -
      - - - -
        -
      • -

        putNull

        -
        public DSMap putNull(java.lang.String key)
        -
        Puts a null value for given key and returns this.
        -
      • -
      - - - -
        -
      • -

        remove

        -
        public DSElement remove(int idx)
        -
        Description copied from class: DSGroup
        -
        Removes the value at the given index and returns it.
        -
        -
        Specified by:
        -
        remove in class DSGroup
        -
        Returns:
        -
        The value removed.
        -
        -
      • -
      - - - -
        -
      • -

        remove

        -
        public DSElement remove(java.lang.String key)
        -
        Removes the key-value pair and returns the removed value.
        -
        -
        Returns:
        -
        Possibly null.
        -
        -
      • -
      - - - -
        -
      • -

        size

        -
        public int size()
        -
        Description copied from class: DSGroup
        -
        The number of items is the group.
        -
        -
        Specified by:
        -
        size in class DSGroup
        -
        -
      • -
      - - - - - - - -
        -
      • -

        toMap

        -
        public DSMap toMap()
        -
        Description copied from class: DSElement
        -
        Maps return themselves, everything else results in an exception.
        -
        -
        Overrides:
        -
        toMap in class DSElement
        -
        -
      • -
      - - - - -
    • -
    -
  • -
-
+
Puts a String representing the stack trace into the map.
+ + + + + +
    +
  • +

    putAll

    +
    public DSMap putAll(DSMap toAdd)
    +
    Adds / overwrites entries in this map with those from the + given. +
    +
    +
    Returns:
    +
    This
    +
    +
  • +
+ + + +
    +
  • +

    putList

    +
    public DSList putList(java.lang.String key)
    +
    Puts a new list for given key and returns it.
    +
  • +
+ + + +
    +
  • +

    putMap

    +
    public DSMap putMap(java.lang.String key)
    +
    Puts a new map for given key and returns it.
    +
  • +
+ + + +
    +
  • +

    putNull

    +
    public DSMap putNull(java.lang.String key)
    +
    Puts a null value for given key and returns this.
    +
  • +
+ + + +
    +
  • +

    remove

    +
    public DSElement remove(int idx)
    +
    Description copied from class: DSGroup +
    +
    Removes the value at the given index and returns it.
    +
    +
    Specified by:
    +
    remove in + class DSGroup
    +
    Returns:
    +
    The value removed.
    +
    +
  • +
+ + + +
    +
  • +

    remove

    +
    public DSElement remove(java.lang.String key)
    +
    Removes the key-value pair and returns the removed value.
    +
    +
    Returns:
    +
    Possibly null.
    +
    +
  • +
+ + + +
    +
  • +

    size

    +
    public int size()
    +
    Description copied from class: DSGroup +
    +
    The number of items is the group.
    +
    +
    Specified by:
    +
    size in + class DSGroup
    +
    +
  • +
+ + + + + + + +
    +
  • +

    toMap

    +
    public DSMap toMap()
    +
    Description copied from class: DSElement +
    +
    Maps return themselves, everything else results in an + exception. +
    +
    +
    Overrides:
    +
    toMap in + class DSElement
    +
    +
  • +
+ + + + + + + + +
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/node/DSNode.html b/docs/javadoc/org/iot/dsa/node/DSNode.html index 93972df2..f0134f3c 100644 --- a/docs/javadoc/org/iot/dsa/node/DSNode.html +++ b/docs/javadoc/org/iot/dsa/node/DSNode.html @@ -1,12 +1,13 @@ - + - -DSNode (dslink-core 0.15.0 API) - - - + + DSNode (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.node
-

Class DSNode

+
org.iot.dsa.node
+

Class DSNode

- -
-
    -
  • -
    -
    All Implemented Interfaces:
    -
    java.lang.Iterable<DSInfo>, DSIObject
    -
    -
    -
    Direct Known Subclasses:
    -
    DSLink, DSLinkConnection, DSMainNode, DSValueNode
    -
    -
    -
    -
    public class DSNode
    -extends DSLogger
    -implements DSIObject, java.lang.Iterable<DSInfo>
    -
    The organizational unit of the node tree. Most links will bind their specific logic by - subclassing DSNode and utilizing the lifecycle callbacks. -

    - To create a node subclass, you should understand the following concepts: -

    -

      -
    • Constructors -
    • Defaults -
    • Node Lifecycle and Callbacks -
    • Subscriptions -
    • Values -
    • Actions -
    • DSInfo -
    -

    -

    Constructors

    -

    - DSNode sub-classes must support the public no-arg constructor. This is how they will be - instantiated when deserializing the configuration database. -

    -

    Defaults

    -

    - Every subtype of DSNode has a private default instance, all other instances of any particular - type are copies of the default instance. You should never perform application logic unless your - node is running (started or stable) because of this. -

    - If a DSNode subtype needs to have specific child nodes or values (most will), it should override - the declareDefaults method. The method should: -

    -

      -
    • Call super.declareDefaults(); -
    • Call DSNode.declareDefault(String name, DSIObject child) for each non-removable child. Do - not add dynamic children in declareDefaults, because if they are removed, they will be re-added - the next time the link is restarted. -
    -

    - During node serialization (configuration database, not DSA interop), children that match their - declared default are omitted. This has two benefits: -

    -

      -
    • Smaller node database means faster serialization / deserialization. -
    • Default values can be modified and all existing database will be automatically upgraded the - next time the updated class loaded. -
    -

    -

    Lifecycle

    -

    - It is important to know the node lifecycle. Your nodes should not execute any application logic - unless they are running (started or stable). -

    - Stopped -

    - A node is instantiated in the stopped state. If a node tree has been persisted, will be be fully - restored in the stopped state. DSNode.onStopped will not be called, it is only called when nodes - transition from running to stopped. -

    - When nodes are removed from a running parent node, they will be stopped. DSNode.onStopped will - be called after all child nodes have been stopped. -

    - When a link is stopped, an attempt to stop the tree will be made, but it cannot be guaranteed. -

    - Started -

    - After the node tree is fully deserialized it will be started. A node's onStart method will be - called after all of its child nodes have been started. The only guarantee is that all child - nodes have been started. -

    - Nodes will also started when they are added to an already running parent node. -

    - Stable -

    - Stable is called after the entire tree has been started. The first time the node tree is loaded, - there is a stable delay of 5 seconds. This is configurable as stableDelay in - slink.json. -

    - Nodes added to an already stable parent will have onStart and onStable called immediately. -

    - When in doubt of whether to use onStarted or onStable, use onStable. -

    - Other Callbacks -

    - When a node is stable, there are several other callbacks for various state changes. All - callbacks begin with **on** such as onChildAdded(). -

    -

    Subscriptions

    -

    - Nodes should suspend, or minimize activity when nothing is interested in them. For example, if - nothing is interested in a point, it is best to not poll the point on the foreign system. -

    - To do this you use the following APIs: -

    -

      -
    • DSNode.onSubscribed - Called when the node transitions from unsubscribed to subscribed. This - is not called for subsequent subscribers once in the subscribed state. -
    • DSNode.onUnsubscribed - Called when the node transitions from subscribed to unsubscribed. If - there are multiple subscribers, this is only called when the last one unsubscribes. -
    • DSNode.isSubscribed - Tells the caller whether or not the node is subscribed. -
    -

    -

    Values

    -

    - Values mostly represent leaf members of the node tree. There are two types of values: -

    -

      -
    • DSElement - These map to the JSON type system and represent leaf members of the node tree. -
    • DSIValue - These don't map to the JSON type system, and it is possible for nodes to implement - this interface. This allows for values to have children. -
    -

    - Many values are singleton instances. This is for efficiency, the same value instance (e.g. - DSBoolean.TRUE) can be stored in many nodes. Singleton values must be immutable. -

    - Whenever possible, values should also have NULL instance. Rather than storing a generic null, - this helps the system decode the proper type such as when a requester is attempting to set a - value. -

    -

    Actions

    -

    - Add actions to your node to allow requester invocation using org.iot.dsa.node.action.DSAction. -

    - Override DSNode.onInvoke to handle invocations. The reason for this is complicated but it is - possible to subclass DSAction, just carefully read the javadoc if you do. Be sure to call - super.onInvoke() when overriding that method. -

    -

    DSInfo

    -

    - All node children have corresponding DSInfo instances. This type serves two purposes: -

    -

      -
    • It carries some meta-data about the relationship between the parent node and the child. -
    • It tracks whether or not the child matches a declared default. -
    -

    - Important things for developers to know about DSInfo are: -

    -

      -
    • You can configure state such as transient, readonly and hidden. -
    • You can declare fields in the your Java class for default info instances to avoid looking up - the child every time it is needed. This is can be used to create fast getters and setters. -
    -

    -
  • -
-
-
-
    -
  • - - - -
      -
    • - - -

      Constructor Summary

      - - - - - - - - -
      Constructors 
      Constructor and Description
      DSNode() 
      -
    • -
    - -
      -
    • - - -

      Method Summary

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      DSInfoadd(java.lang.String name, - DSIObject object) -
      Adds the named child only if the name is not already in use.
      -
      intchildCount() -
      The number of children.
      -
      DSNodeclear() -
      Removes non-permanent children.
      -
      booleancontains(java.lang.String key) -
      Whether or not this node has a child with the given name.
      -
      DSNodecopy() -
      Returns a clone of this node and its subtree.
      -
      protected DSInfodeclareDefault(java.lang.String name, - DSIObject value) -
      Use this in the declareDefaults method to create a non-removable child.
      -
      protected voiddeclareDefaults() -
      The is only called once for each class.
      -
      protected voidfire(DSTopic topic, - DSIEvent event, - DSInfo child) -
      Notifies subscribers of the event.
      -
      protected voidfire(DSTopic topic, - DSIEvent event, - DSInfo child, - java.lang.Object... params) -
      Notifies subscribers of the event.
      -
      DSIObjectget(java.lang.String name) -
      Returns the child value with the given name, or null.
      -
      DSElementgetElement(java.lang.String name) -
      A convenience for (DSElement) get(name).
      -
      DSIObjectgetFirst() -
      The first child, or null.
      -
      DSInfogetFirstInfo() -
      The first child info, or null.
      -
      DSInfogetFirstNodeInfo() -
      The info for the first child node, or null.
      -
      DSInfogetInfo() -
      DSInfo for this node in its parent, or null if un-parented.
      -
      DSInfogetInfo(java.lang.String name) -
      Returns the info for the child with the given name, or null.
      -
      DSIObjectgetLast() -
      The last child, or null.
      -
      DSInfogetLastInfo() -
      The last child info, or null.
      -
      java.util.logging.LoggergetLogger() -
      Ascends the tree until a logger is found.
      -
      voidgetMetadata(DSInfo info, - DSMap bucket) -
      Override point, add any meta data for the given info to the provided bucket.
      -
      java.lang.StringgetName() -
      Returns the name of this node in its parent, or null if un-parented.
      -
      DSNodegetNode(java.lang.String name) -
      A convenience for (DSNode) get(name).
      -
      DSNodegetParent() -
      Returns the parent node, or null.
      -
      java.lang.StringgetPath() -
      The DSA path, properly encoded.
      -
      DSIValuegetValue(java.lang.String name) -
      A convenience for (DSIValue) get(name).
      -
      protected booleanisDefaultInstance() -
      True if this is the default instance for the type.
      -
      booleanisEqual(java.lang.Object arg) -
      True if the argument is a node with the same children, although their order can be - different.
      -
      booleanisIdentical(java.lang.Object arg) -
      True if the argument is a node with the same children in the exact same order.
      -
      protected static booleanisNode(java.lang.Object obj) -
      Convenience for instanceof DSNode.
      -
      booleanisNull() -
      Returns false.
      -
      booleanisRunning() -
      A convenience for !isStopped().
      -
      booleanisStable() -
      True after stable is called, children are stable before their parents.
      -
      booleanisStarted() -
      True after start is called, children are started before their parents.
      -
      booleanisStopped() -
      True after stop is called, children are stopped before their parents.
      -
      booleanisSubscribed() -
      True if there are any subscribers.
      -
      booleanisSubscribed(DSInfo child, - DSTopic topic) -
      True if there are any subscriptions with the matching child and topic.
      -
      booleanisSubscribed(DSTopic topic) -
      True if there any subscriptions for the given topic.
      -
      java.util.Iterator<DSInfo>iterateNodes() -
      Returns an info iterator of child DSNodes.
      -
      java.util.Iterator<DSInfo>iterateValues() -
      Returns an info iterator of child DSIValues.
      -
      java.util.Iterator<DSInfo>iterator() -
      Returns an info iterator of all children.
      -
      protected voidonChildAdded(DSInfo info) -
      Called when the given child is added and in the stable state.
      -
      protected voidonChildChanged(DSInfo info) -
      Called when the given child is changed and in the stable state.
      -
      protected voidonChildRemoved(DSInfo info) -
      Called when the given child is removed and in the stable state.
      -
      protected voidonInfoChanged(DSInfo info) -
      Called when the given info is modified and in the stable state.
      -
      ActionResultonInvoke(DSInfo actionInfo, - ActionInvocation invocation) -
      Override point, called by the default implementation of DSAction.invoke.
      -
      voidonSet(DSInfo info, - DSIValue value) -
      Override point, called when a value being set.
      -
      voidonSet(DSIValue value) -
      Override point, called only when a DSNode subclass implements DSIValue is being set.
      -
      protected voidonStable() -
      Called once this node is stable, but before stable is called on children.
      -
      protected voidonStarted() -
      Called once this node and its entire subtree is started.
      -
      protected voidonStopped() -
      Called once this node and its entire subtree is stopped.
      -
      protected voidonSubscribe(DSTopic topic, - DSInfo child, - DSISubscriber subscriber) -
      Called for every subscription.
      -
      protected voidonSubscribed() -
      Called when this node transitions from having no subscriptions to having a subscription of - any kind.
      -
      protected voidonSubscribed(DSTopic topic, - DSInfo child) -
      Called when the child and topic pair transitions from having no subscriptions to have a - subscription.
      -
      protected voidonUnsubscribe(DSTopic topic, - DSInfo child, - DSISubscriber subscriber) -
      Called for every unsubscribe.
      -
      protected voidonUnsubscribed() -
      Called when this node transitions to having no subscriptions of any kind.
      -
      protected voidonUnsubscribed(DSTopic topic, - DSInfo child) -
      Called when the child and topic pair transitions to having no subscriptions.
      -
      DSNodeput(DSInfo info, - DSIObject object) -
      Replaces the child.
      -
      DSInfoput(java.lang.String name, - boolean arg) -
      A convenience for put(String, DSIObject)
      -
      DSInfoput(java.lang.String name, - double arg) -
      A convenience for put(String, DSIObject)
      -
      DSInfoput(java.lang.String name, - DSIObject object) -
      Adds or replaces the named child.
      -
      DSInfoput(java.lang.String name, - float arg) -
      A convenience for put(String, DSIObject)
      -
      DSInfoput(java.lang.String name, - int arg) -
      A convenience for put(String, DSIObject)
      -
      DSInfoput(java.lang.String name, - long arg) -
      A convenience for put(String, DSIObject)
      -
      DSInfoput(java.lang.String name, - java.lang.String arg) -
      A convenience for put(String, DSIObject)
      -
      DSNoderemove(DSInfo info) -
      Removes the child.
      -
      DSInforemove(java.lang.String name) -
      Remove the named child if it is contained.
      -
      voidstable() -
      Called after the entire subtree is started.
      -
      voidstart() -
      Sets the state to starting.
      -
      voidstop() -
      Sets the state to stopped.
      -
      voidsubscribe(DSTopic topic, - DSInfo child, - DSISubscriber subscriber) -
      Subscribes the child and topic.
      -
      protected static DSNodetoNode(java.lang.Object obj) -
      A convenience that casts the argument to a node.
      -
      voidunsubscribe(DSTopic topic, - DSInfo child, - DSISubscriber subscriber) -
      Unsubscribes the tuple.
      -
      protected voidvalidateChild(DSIObject obj) -
      Override point, throw a meaningful IllegalArgumentException if the child is not allowed
      -
      protected voidvalidateParent(DSNode node) -
      Override point, throw a meaningful IllegalArgumentException if the parent is not allowed
      -
      - -
        -
      • - - -

        Methods inherited from class java.lang.Object

        -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • -
      -
        -
      • - - -

        Methods inherited from interface java.lang.Iterable

        -forEach, spliterator
      • -
      -
    • -
    -
  • -
-
-
-
    -
  • - -
      -
    • - - -

      Field Detail

      - - - -
        -
      • -

        INFO_TOPIC

        -
        public static final DSTopic INFO_TOPIC
        -
      • -
      - - - -
        -
      • -

        VALUE_TOPIC

        -
        public static final DSTopic VALUE_TOPIC
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Constructor Detail

      - - - -
        -
      • -

        DSNode

        -
        public DSNode()
        -
      • -
      -
    • -
    - -
      -
    • - - -

      Method Detail

      - - - -
        -
      • -

        add

        -
        public DSInfo add(java.lang.String name,
        -                  DSIObject object)
        -
        Adds the named child only if the name is not already in use.
        -
        -
        Parameters:
        -
        name - The name must not currently be in use.
        -
        object - The object to add, nodes must not already be parented.
        -
        Returns:
        -
        Info for the newly added child.
        -
        Throws:
        -
        java.lang.IllegalArgumentException - If the name is in use or the value is a node that is already - parented.
        -
        -
      • -
      - - - -
        -
      • -

        childCount

        -
        public int childCount()
        -
        The number of children.
        -
      • -
      - - - -
        -
      • -

        clear

        -
        public DSNode clear()
        -
        Removes non-permanent children.
        -
        -
        Returns:
        -
        this
        -
        -
      • -
      - - - -
        -
      • -

        contains

        -
        public boolean contains(java.lang.String key)
        -
        Whether or not this node has a child with the given name.
        -
      • -
      - - - -
        -
      • -

        copy

        -
        public DSNode copy()
        -
        Returns a clone of this node and its subtree.
        -
        -
        Specified by:
        -
        copy in interface DSIObject
        -
        -
      • -
      - - - -
        -
      • -

        declareDefault

        -
        protected DSInfo declareDefault(java.lang.String name,
        -                                DSIObject value)
        -
        Use this in the declareDefaults method to create a non-removable child. This is only called - on the default instance. Runtime instances clone the declared defaults found on the default - instance.
        -
        -
        Returns:
        -
        Info for the newly created child.
        -
        See Also:
        -
        declareDefaults()
        -
        -
      • -
      - - - -
        -
      • -

        declareDefaults

        -
        protected void declareDefaults()
        -
        The is only called once for each class. It's purpose is to define the default children of - the node subtype. Use the declareDefault method to add non-removable children that all - runtime instances should have. Be sure to call super.declareDefaults().
        -
        -
        See Also:
        -
        To create non-removable children.
        -
        -
      • -
      - - - -
        -
      • -

        fire

        -
        protected void fire(DSTopic topic,
        -                    DSIEvent event,
        -                    DSInfo child)
        -
        Notifies subscribers of the event.
        -
        -
        Parameters:
        -
        topic - Must not be null.
        -
        event - Must not be null.
        -
        child - Can be null.
        -
        -
      • -
      - - - -
        -
      • -

        fire

        -
        protected void fire(DSTopic topic,
        -                    DSIEvent event,
        -                    DSInfo child,
        +  
        +  
        +
          +
        • +
          +
          All Implemented Interfaces:
          +
          java.lang.Iterable<DSInfo>, DSIObject
          +
          +
          +
          Direct Known Subclasses:
          +
          DSLink, DSLinkConnection, DSMainNode, DSValueNode
          +
          +
          +
          +
          public class DSNode
          +extends DSLogger
          +implements DSIObject, java.lang.Iterable<DSInfo>
          +
          The organizational unit of the node tree. Most links will bind their + specific logic by + subclassing DSNode and utilizing the lifecycle callbacks. +

          + To create a node subclass, you should understand the following concepts: +

          +

            +
          • Constructors +
          • Defaults +
          • Node Lifecycle and Callbacks +
          • Subscriptions +
          • Values +
          • Actions +
          • DSInfo +
          +

          +

          Constructors

          +

          + DSNode sub-classes must support the public no-arg constructor. This is how they will be + instantiated when deserializing the configuration database. +

          +

          Defaults

          +

          + Every subtype of DSNode has a private default instance, all other instances of any + particular + type are copies of the default instance. You should never perform application logic + unless your + node is running (started or stable) because of this. +

          + If a DSNode subtype needs to have specific child nodes or values (most will), it should + override + the declareDefaults method. The method should: +

          +

            +
          • Call super.declareDefaults(); +
          • Call DSNode.declareDefault(String name, DSIObject child) for each non-removable + child. Do + not add dynamic children in declareDefaults, because if they are removed, they will be + re-added + the next time the link is restarted. +
          +

          + During node serialization (configuration database, not DSA interop), children that match + their + declared default are omitted. This has two benefits: +

          +

            +
          • Smaller node database means faster serialization / deserialization. +
          • Default values can be modified and all existing database will be automatically + upgraded the + next time the updated class loaded. +
          +

          +

          Lifecycle

          +

          + It is important to know the node lifecycle. Your nodes should not execute any + application logic + unless they are running (started or stable). +

          + Stopped +

          + A node is instantiated in the stopped state. If a node tree has been persisted, will be + be fully + restored in the stopped state. DSNode.onStopped will not be called, it is only called + when nodes + transition from running to stopped. +

          + When nodes are removed from a running parent node, they will be stopped. + DSNode.onStopped will + be called after all child nodes have been stopped. +

          + When a link is stopped, an attempt to stop the tree will be made, but it cannot be + guaranteed. +

          + Started +

          + After the node tree is fully deserialized it will be started. A node's onStart method + will be + called after all of its child nodes have been started. The only guarantee is that all + child + nodes have been started. +

          + Nodes will also started when they are added to an already running parent node. +

          + Stable +

          + Stable is called after the entire tree has been started. The first time the node tree is + loaded, + there is a stable delay of 5 seconds. This is configurable as stableDelay in + slink.json. +

          + Nodes added to an already stable parent will have onStart and onStable called + immediately. +

          + When in doubt of whether to use onStarted or onStable, use onStable. +

          + Other Callbacks +

          + When a node is stable, there are several other callbacks for various state changes. All + callbacks begin with **on** such as onChildAdded(). +

          +

          Subscriptions

          +

          + Nodes should suspend, or minimize activity when nothing is interested in them. For + example, if + nothing is interested in a point, it is best to not poll the point on the foreign + system. +

          + To do this you use the following APIs: +

          +

            +
          • DSNode.onSubscribed - Called when the node transitions from unsubscribed to + subscribed. This + is not called for subsequent subscribers once in the subscribed state. +
          • DSNode.onUnsubscribed - Called when the node transitions from subscribed to + unsubscribed. If + there are multiple subscribers, this is only called when the last one unsubscribes. +
          • DSNode.isSubscribed - Tells the caller whether or not the node is subscribed. +
          +

          +

          Values

          +

          + Values mostly represent leaf members of the node tree. There are two types of values: +

          +

            +
          • DSElement - These map to the JSON type system and represent leaf members of the node + tree. +
          • DSIValue - These don't map to the JSON type system, and it is possible for nodes to + implement + this interface. This allows for values to have children. +
          +

          + Many values are singleton instances. This is for efficiency, the same value instance + (e.g. + DSBoolean.TRUE) can be stored in many nodes. Singleton values must be immutable. +

          + Whenever possible, values should also have NULL instance. Rather than storing a generic + null, + this helps the system decode the proper type such as when a requester is attempting to + set a + value. +

          +

          Actions

          +

          + Add actions to your node to allow requester invocation using + org.iot.dsa.node.action.DSAction. +

          + Override DSNode.onInvoke to handle invocations. The reason for this is complicated but + it is + possible to subclass DSAction, just carefully read the javadoc if you do. Be sure to + call + super.onInvoke() when overriding that method. +

          +

          DSInfo

          +

          + All node children have corresponding DSInfo instances. This type serves two purposes: +

          +

            +
          • It carries some meta-data about the relationship between the parent node and the + child. +
          • It tracks whether or not the child matches a declared default. +
          +

          + Important things for developers to know about DSInfo are: +

          +

            +
          • You can configure state such as transient, readonly and hidden. +
          • You can declare fields in the your Java class for default info instances to avoid + looking up + the child every time it is needed. This is can be used to create fast getters and + setters. +
          +

          +
        • +
        +
        +
        +
          +
        • + + + +
            +
          • + + +

            Constructor Summary

            + + + + + + + + +
            Constructors 
            Constructor and Description
            DSNode()  +
            +
          • +
          + +
            +
          • + + +

            Method Summary

            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            All Methods Static Methods Instance Methods Concrete Methods 
            Modifier and TypeMethod and Description
            DSInfo + add(java.lang.String name, + DSIObject object) +
            Adds the named child only if the name is not already in use. +
            +
            intchildCount() +
            The number of children.
            +
            DSNode + clear() +
            Removes non-permanent children.
            +
            booleancontains(java.lang.String key) +
            Whether or not this node has a child with the given name.
            +
            DSNode + copy() +
            Returns a clone of this node and its subtree.
            +
            protected DSInfodeclareDefault(java.lang.String name, + DSIObject value) +
            Use this in the declareDefaults method to create a + non-removable child. +
            +
            protected voiddeclareDefaults() +
            The is only called once for each class.
            +
            protected voidfire(DSTopic topic, + DSIEvent event, + DSInfo child) +
            Notifies subscribers of the event.
            +
            protected voidfire(DSTopic topic, + DSIEvent event, + DSInfo child, + java.lang.Object... params) +
            Notifies subscribers of the event.
            +
            DSIObject + get(java.lang.String name) +
            Returns the child value with the given name, or null.
            +
            DSElement + getElement(java.lang.String name) +
            A convenience for (DSElement) get(name).
            +
            DSIObject + getFirst() +
            The first child, or null.
            +
            DSInfo + getFirstInfo() +
            The first child info, or null.
            +
            DSInfo + getFirstNodeInfo() +
            The info for the first child node, or null.
            +
            DSInfo + getInfo() +
            DSInfo for this node in its parent, or null if un-parented. +
            +
            DSInfo + getInfo(java.lang.String name) +
            Returns the info for the child with the given name, or null. +
            +
            DSIObject + getLast() +
            The last child, or null.
            +
            DSInfo + getLastInfo() +
            The last child info, or null.
            +
            java.util.logging.LoggergetLogger() +
            Ascends the tree until a logger is found.
            +
            voidgetMetadata(DSInfo info, + DSMap bucket) +
            Override point, add any meta data for the given info to the + provided bucket. +
            +
            java.lang.StringgetName() +
            Returns the name of this node in its parent, or null if + un-parented. +
            +
            DSNode + getNode(java.lang.String name) +
            A convenience for (DSNode) get(name).
            +
            DSNode + getParent() +
            Returns the parent node, or null.
            +
            java.lang.StringgetPath() +
            The DSA path, properly encoded.
            +
            DSIValue + getValue(java.lang.String name) +
            A convenience for (DSIValue) get(name).
            +
            protected booleanisDefaultInstance() +
            True if this is the default instance for the type.
            +
            booleanisEqual(java.lang.Object arg) +
            True if the argument is a node with the same children, although + their order can be + different. +
            +
            booleanisIdentical(java.lang.Object arg) +
            True if the argument is a node with the same children in the + exact same order. +
            +
            protected static booleanisNode(java.lang.Object obj) +
            Convenience for instanceof DSNode.
            +
            booleanisNull() +
            Returns false.
            +
            booleanisRunning() +
            A convenience for !isStopped().
            +
            booleanisStable() +
            True after stable is called, children are stable before their + parents. +
            +
            booleanisStarted() +
            True after start is called, children are started before their + parents. +
            +
            booleanisStopped() +
            True after stop is called, children are stopped before their + parents. +
            +
            booleanisSubscribed() +
            True if there are any subscribers.
            +
            booleanisSubscribed(DSInfo child, + DSTopic topic) +
            True if there are any subscriptions with the matching child and + topic. +
            +
            booleanisSubscribed(DSTopic topic) +
            True if there any subscriptions for the given topic.
            +
            java.util.Iterator<DSInfo>iterateNodes() +
            Returns an info iterator of child DSNodes.
            +
            java.util.Iterator<DSInfo>iterateValues() +
            Returns an info iterator of child DSIValues.
            +
            java.util.Iterator<DSInfo>iterator() +
            Returns an info iterator of all children.
            +
            protected voidonChildAdded(DSInfo info) +
            Called when the given child is added and in the stable state. +
            +
            protected voidonChildChanged(DSInfo info) +
            Called when the given child is changed and in the stable + state. +
            +
            protected voidonChildRemoved(DSInfo info) +
            Called when the given child is removed and in the stable + state. +
            +
            protected voidonInfoChanged(DSInfo info) +
            Called when the given info is modified and in the stable + state. +
            +
            ActionResultonInvoke(DSInfo actionInfo, + ActionInvocation invocation) +
            Override point, called by the default implementation of + DSAction.invoke. +
            +
            voidonSet(DSInfo info, + DSIValue value) +
            Override point, called when a value being set.
            +
            voidonSet(DSIValue value) +
            Override point, called only when a DSNode subclass implements + DSIValue is being set. +
            +
            protected voidonStable() +
            Called once this node is stable, but before stable is called on + children. +
            +
            protected voidonStarted() +
            Called once this node and its entire subtree is started.
            +
            protected voidonStopped() +
            Called once this node and its entire subtree is stopped.
            +
            protected voidonSubscribe(DSTopic topic, + DSInfo child, + DSISubscriber subscriber) +
            Called for every subscription.
            +
            protected voidonSubscribed() +
            Called when this node transitions from having no subscriptions + to having a subscription of + any kind. +
            +
            protected voidonSubscribed(DSTopic topic, + DSInfo child) +
            Called when the child and topic pair transitions from having no + subscriptions to have a + subscription. +
            +
            protected voidonUnsubscribe(DSTopic topic, + DSInfo child, + DSISubscriber subscriber) +
            Called for every unsubscribe.
            +
            protected voidonUnsubscribed() +
            Called when this node transitions to having no subscriptions of + any kind. +
            +
            protected voidonUnsubscribed(DSTopic topic, + DSInfo child) +
            Called when the child and topic pair transitions to having no + subscriptions. +
            +
            DSNode + put(DSInfo info, + DSIObject object) +
            Replaces the child.
            +
            DSInfo + put(java.lang.String name, + boolean arg) +
            A convenience for put(String, DSIObject)
            +
            DSInfo + put(java.lang.String name, + double arg) +
            A convenience for put(String, DSIObject)
            +
            DSInfo + put(java.lang.String name, + DSIObject object) +
            Adds or replaces the named child.
            +
            DSInfo + put(java.lang.String name, + float arg) +
            A convenience for put(String, DSIObject)
            +
            DSInfo + put(java.lang.String name, + int arg) +
            A convenience for put(String, DSIObject)
            +
            DSInfo + put(java.lang.String name, + long arg) +
            A convenience for put(String, DSIObject)
            +
            DSInfo + put(java.lang.String name, + java.lang.String arg) +
            A convenience for put(String, DSIObject)
            +
            DSNode + remove(DSInfo info) +
            Removes the child.
            +
            DSInfo + remove(java.lang.String name) +
            Remove the named child if it is contained.
            +
            voidstable() +
            Called after the entire subtree is started.
            +
            voidstart() +
            Sets the state to starting.
            +
            voidstop() +
            Sets the state to stopped.
            +
            voidsubscribe(DSTopic topic, + DSInfo child, + DSISubscriber subscriber) +
            Subscribes the child and topic.
            +
            protected static DSNodetoNode(java.lang.Object obj) +
            A convenience that casts the argument to a node.
            +
            voidunsubscribe(DSTopic topic, + DSInfo child, + DSISubscriber subscriber) +
            Unsubscribes the tuple.
            +
            protected voidvalidateChild(DSIObject obj) +
            Override point, throw a meaningful IllegalArgumentException if + the child is not allowed +
            +
            protected voidvalidateParent(DSNode node) +
            Override point, throw a meaningful IllegalArgumentException if + the parent is not allowed +
            +
            + +
              +
            • + + +

              Methods inherited from class java.lang.Object

              + clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, + wait, wait, wait
            • +
            +
              +
            • + + +

              Methods inherited from interface java.lang.Iterable

              + forEach, spliterator
            • +
            +
          • +
          +
        • +
        +
        +
        +
          +
        • + +
            +
          • + + +

            Field Detail

            + + + +
              +
            • +

              INFO_TOPIC

              +
              public static final DSTopic INFO_TOPIC
              +
            • +
            + + + +
              +
            • +

              VALUE_TOPIC

              +
              public static final DSTopic VALUE_TOPIC
              +
            • +
            +
          • +
          + +
            +
          • + + +

            Constructor Detail

            + + + +
              +
            • +

              DSNode

              +
              public DSNode()
              +
            • +
            +
          • +
          + +
            +
          • + + +

            Method Detail

            + + + +
              +
            • +

              add

              +
              public DSInfo add(java.lang.String name,
              +                  DSIObject object)
              +
              Adds the named child only if the name is not already in use. +
              +
              +
              Parameters:
              +
              name - The name must not currently be in use.
              +
              object - The object to add, nodes must not already be parented. +
              +
              Returns:
              +
              Info for the newly added child.
              +
              Throws:
              +
              java.lang.IllegalArgumentException - If the name is in use or the + value is a node that is already + parented. +
              +
              +
            • +
            + + + +
              +
            • +

              childCount

              +
              public int childCount()
              +
              The number of children.
              +
            • +
            + + + +
              +
            • +

              clear

              +
              public DSNode clear()
              +
              Removes non-permanent children.
              +
              +
              Returns:
              +
              this
              +
              +
            • +
            + + + +
              +
            • +

              contains

              +
              public boolean contains(java.lang.String key)
              +
              Whether or not this node has a child with the given name.
              +
            • +
            + + + +
              +
            • +

              copy

              +
              public DSNode copy()
              +
              Returns a clone of this node and its subtree.
              +
              +
              Specified by:
              +
              copy in + interface DSIObject +
              +
              +
            • +
            + + + +
              +
            • +

              declareDefault

              +
              protected DSInfo declareDefault(java.lang.String name,
              +                                DSIObject value)
              +
              Use this in the declareDefaults method to create a non-removable + child. This is only called + on the default instance. Runtime instances clone the declared defaults found on + the default + instance. +
              +
              +
              Returns:
              +
              Info for the newly created child.
              +
              See Also:
              +
              declareDefaults() +
              +
              +
            • +
            + + + +
              +
            • +

              declareDefaults

              +
              protected void declareDefaults()
              +
              The is only called once for each class. It's purpose is to define + the default children of + the node subtype. Use the declareDefault method to add non-removable children that + all + runtime instances should have. Be sure to call super.declareDefaults(). +
              +
              +
              See Also:
              +
              To + create non-removable children.
              +
              +
            • +
            + + + +
              +
            • +

              fire

              +
              protected void fire(DSTopic topic,
              +                    DSIEvent event,
              +                    DSInfo child)
              +
              Notifies subscribers of the event.
              +
              +
              Parameters:
              +
              topic - Must not be null.
              +
              event - Must not be null.
              +
              child - Can be null.
              +
              +
            • +
            + + + +
              +
            • +

              fire

              +
              protected void fire(DSTopic topic,
              +                    DSIEvent event,
              +                    DSInfo child,
                                   java.lang.Object... params)
              -
              Notifies subscribers of the event.
              -
              -
              Parameters:
              -
              topic - Must not be null.
              -
              event - Must not be null.
              -
              child - Can be null.
              -
              params - Optional
              -
              -
            • -
            - - - -
              -
            • -

              get

              -
              public DSIObject get(java.lang.String name)
              -
              Returns the child value with the given name, or null.
              -
              -
              Returns:
              -
              Possibly null.
              -
              -
            • -
            - - - -
              -
            • -

              getElement

              -
              public DSElement getElement(java.lang.String name)
              -
              A convenience for (DSElement) get(name).
              -
            • -
            - - - -
              -
            • -

              getInfo

              -
              public DSInfo getInfo()
              -
              DSInfo for this node in its parent, or null if un-parented.
              -
            • -
            - - - -
              -
            • -

              getInfo

              -
              public DSInfo getInfo(java.lang.String name)
              -
              Returns the info for the child with the given name, or null.
              -
              -
              Returns:
              -
              Possibly null.
              -
              -
            • -
            - - - -
              -
            • -

              getFirst

              -
              public DSIObject getFirst()
              -
              The first child, or null.
              -
            • -
            - - - -
              -
            • -

              getFirstInfo

              -
              public DSInfo getFirstInfo()
              -
              The first child info, or null.
              -
            • -
            - - - -
              -
            • -

              getFirstNodeInfo

              -
              public DSInfo getFirstNodeInfo()
              -
              The info for the first child node, or null.
              -
            • -
            - - - -
              -
            • -

              getLast

              -
              public DSIObject getLast()
              -
              The last child, or null.
              -
            • -
            - - - -
              -
            • -

              getLastInfo

              -
              public DSInfo getLastInfo()
              -
              The last child info, or null.
              -
            • -
            - - - -
              -
            • -

              getLogger

              -
              public java.util.logging.Logger getLogger()
              -
              Ascends the tree until a logger is found. If overriding, call super.getLogger and set the - result as the parent logger of your new logger.
              -
              -
              Overrides:
              -
              getLogger in class DSLogger
              -
              -
            • -
            - - - -
              -
            • -

              getMetadata

              -
              public void getMetadata(DSInfo info,
              -                        DSMap bucket)
              -
              Override point, add any meta data for the given info to the provided bucket.
              -
            • -
            - - - -
              -
            • -

              getName

              -
              public java.lang.String getName()
              -
              Returns the name of this node in its parent, or null if un-parented.
              -
            • -
            - - - -
              -
            • -

              getNode

              -
              public DSNode getNode(java.lang.String name)
              -
              A convenience for (DSNode) get(name).
              -
            • -
            - - - -
              -
            • -

              getParent

              -
              public DSNode getParent()
              -
              Returns the parent node, or null.
              -
            • -
            - - - -
              -
            • -

              getPath

              -
              public java.lang.String getPath()
              -
              The DSA path, properly encoded.
              -
            • -
            - - - -
              -
            • -

              getValue

              -
              public DSIValue getValue(java.lang.String name)
              -
              A convenience for (DSIValue) get(name).
              -
            • -
            - - - -
              -
            • -

              isDefaultInstance

              -
              protected final boolean isDefaultInstance()
              -
              True if this is the default instance for the type.
              -
            • -
            - - - -
              -
            • -

              isEqual

              -
              public boolean isEqual(java.lang.Object arg)
              -
              True if the argument is a node with the same children, although their order can be - different.
              -
              -
              Specified by:
              -
              isEqual in interface DSIObject
              -
              -
            • -
            - - - -
              -
            • -

              isIdentical

              -
              public boolean isIdentical(java.lang.Object arg)
              -
              True if the argument is a node with the same children in the exact same order.
              -
            • -
            - - - -
              -
            • -

              isNode

              -
              protected static final boolean isNode(java.lang.Object obj)
              -
              Convenience for instanceof DSNode.
              -
            • -
            - - - -
              -
            • -

              isNull

              -
              public boolean isNull()
              -
              Returns false.
              -
              -
              Specified by:
              -
              isNull in interface DSIObject
              -
              -
            • -
            - - - -
              -
            • -

              isRunning

              -
              public boolean isRunning()
              -
              A convenience for !isStopped().
              -
            • -
            - - - -
              -
            • -

              isStable

              -
              public boolean isStable()
              -
              True after stable is called, children are stable before their parents.
              -
            • -
            - - - -
              -
            • -

              isStarted

              -
              public boolean isStarted()
              -
              True after start is called, children are started before their parents.
              -
            • -
            - - - -
              -
            • -

              isStopped

              -
              public boolean isStopped()
              -
              True after stop is called, children are stopped before their parents.
              -
            • -
            - - - -
              -
            • -

              isSubscribed

              -
              public boolean isSubscribed()
              -
              True if there are any subscribers.
              -
            • -
            - - - -
              -
            • -

              isSubscribed

              -
              public boolean isSubscribed(DSInfo child,
              -                            DSTopic topic)
              -
              True if there are any subscriptions with the matching child and topic.
              -
              -
              Parameters:
              -
              child - Can be null.
              -
              topic - Can be null.
              -
              -
            • -
            - - - -
              -
            • -

              isSubscribed

              -
              public boolean isSubscribed(DSTopic topic)
              -
              True if there any subscriptions for the given topic.
              -
            • -
            - - - -
              -
            • -

              iterateNodes

              -
              public java.util.Iterator<DSInfo> iterateNodes()
              -
              Returns an info iterator of child DSNodes.
              -
            • -
            - - - -
              -
            • -

              iterateValues

              -
              public java.util.Iterator<DSInfo> iterateValues()
              -
              Returns an info iterator of child DSIValues.
              -
            • -
            - - - -
              -
            • -

              iterator

              -
              public java.util.Iterator<DSInfo> iterator()
              -
              Returns an info iterator of all children.
              -
              -
              Specified by:
              -
              iterator in interface java.lang.Iterable<DSInfo>
              -
              -
            • -
            - - - -
              -
            • -

              onChildAdded

              -
              protected void onChildAdded(DSInfo info)
              -
              Called when the given child is added and in the stable state.
              -
            • -
            - - - -
              -
            • -

              onChildChanged

              -
              protected void onChildChanged(DSInfo info)
              -
              Called when the given child is changed and in the stable state.
              -
            • -
            - - - -
              -
            • -

              onChildRemoved

              -
              protected void onChildRemoved(DSInfo info)
              -
              Called when the given child is removed and in the stable state.
              -
            • -
            - - - -
              -
            • -

              onInfoChanged

              -
              protected void onInfoChanged(DSInfo info)
              -
              Called when the given info is modified and in the stable state.
              -
            • -
            - - - -
              -
            • -

              onInvoke

              -
              public ActionResult onInvoke(DSInfo actionInfo,
              -                             ActionInvocation invocation)
              -
              Override point, called by the default implementation of DSAction.invoke. You should call - super.onInvoke if you do not handle an incoming invocation. However, do not call super if - you do.
              -
              -
              Parameters:
              -
              actionInfo - Child info for the action, you can declare a field for the action info for - quick instance comparison.
              -
              invocation - Details about the incoming invoke as well as the mechanism to send updates - over an open stream.
              -
              Returns:
              -
              It is okay to return null if the action result type is void.
              -
              Throws:
              -
              java.lang.IllegalStateException - If the nothing handles an incoming invocation.
              -
              See Also:
              -
              DSAction.invoke(DSInfo, ActionInvocation)
              -
              -
            • -
            - - - -
              -
            • -

              onSet

              -
              public void onSet(DSInfo info,
              -                  DSIValue value)
              -
              Override point, called when a value being set. The default implementation calls put(info, - value). Throw an exception to report an error to the requester.
              -
              -
              Parameters:
              -
              info - The child being changed.
              -
              value - The new value.
              -
              See Also:
              -
              DSIResponder.onSet(InboundSetRequest)
              -
              -
            • -
            - - - -
              -
            • -

              onSet

              -
              public void onSet(DSIValue value)
              -
              Override point, called only when a DSNode subclass implements DSIValue is being set. This - will throw and IllegalStateException if not overridden. You should store the value of the - node as a child and call put in override implementation. Throw an exception to - report an error to the requester.
              -
              -
              Parameters:
              -
              value - The new value.
              -
              See Also:
              -
              DSIResponder.onSet(InboundSetRequest), -DSValueNode
              -
              -
            • -
            - - - -
              -
            • -

              onSubscribe

              -
              protected void onSubscribe(DSTopic topic,
              -                           DSInfo child,
              -                           DSISubscriber subscriber)
              -
              Called for every subscription.
              -
              -
              Parameters:
              -
              topic - Will not be null.
              -
              child - Can be null.
              -
              subscriber - Will not be null.
              -
              -
            • -
            - - - -
              -
            • -

              onSubscribed

              -
              protected void onSubscribed()
              -
              Called when this node transitions from having no subscriptions to having a subscription of - any kind.
              -
            • -
            - - - -
              -
            • -

              onSubscribed

              -
              protected void onSubscribed(DSTopic topic,
              -                            DSInfo child)
              -
              Called when the child and topic pair transitions from having no subscriptions to have a - subscription.
              -
              -
              Parameters:
              -
              child - Can be null, which indicates node subscriptions.
              -
              -
            • -
            - - - -
              -
            • -

              onStable

              -
              protected void onStable()
              -
              Called once this node is stable, but before stable is called on children.
              -
            • -
            - - - -
              -
            • -

              onStarted

              -
              protected void onStarted()
              -
              Called once this node and its entire subtree is started.
              -
            • -
            - - - -
              -
            • -

              onStopped

              -
              protected void onStopped()
              -
              Called once this node and its entire subtree is stopped.
              -
            • -
            - - - -
              -
            • -

              onUnsubscribe

              -
              protected void onUnsubscribe(DSTopic topic,
              -                             DSInfo child,
              -                             DSISubscriber subscriber)
              -
              Called for every unsubscribe.
              -
              -
              Parameters:
              -
              topic - Will not be null.
              -
              child - Can be null.
              -
              subscriber - Will not be null.
              -
              -
            • -
            - - - -
              -
            • -

              onUnsubscribed

              -
              protected void onUnsubscribed()
              -
              Called when this node transitions to having no subscriptions of any kind.
              -
            • -
            - - - -
              -
            • -

              onUnsubscribed

              -
              protected void onUnsubscribed(DSTopic topic,
              -                              DSInfo child)
              -
              Called when the child and topic pair transitions to having no subscriptions.
              -
              -
              Parameters:
              -
              topic - Can not be null.
              -
              child - Can be null.
              -
              -
            • -
            - - - -
              -
            • -

              put

              -
              public DSInfo put(java.lang.String name,
              -                  DSIObject object)
              -
              Adds or replaces the named child. If adding, add(String,DSIObject) will be called.
              -
              -
              Returns:
              -
              The info for the child.
              -
              -
            • -
            - - - -
              -
            • -

              put

              -
              public DSInfo put(java.lang.String name,
              +                
              Notifies subscribers of the event.
              +
              +
              Parameters:
              +
              topic - Must not be null.
              +
              event - Must not be null.
              +
              child - Can be null.
              +
              params - Optional
              +
              +
            • +
            + + + +
              +
            • +

              get

              +
              public DSIObject get(java.lang.String name)
              +
              Returns the child value with the given name, or null.
              +
              +
              Returns:
              +
              Possibly null.
              +
              +
            • +
            + + + +
              +
            • +

              getElement

              +
              public DSElement getElement(java.lang.String name)
              +
              A convenience for (DSElement) get(name).
              +
            • +
            + + + +
              +
            • +

              getInfo

              +
              public DSInfo getInfo()
              +
              DSInfo for this node in its parent, or null if un-parented.
              +
            • +
            + + + +
              +
            • +

              getInfo

              +
              public DSInfo getInfo(java.lang.String name)
              +
              Returns the info for the child with the given name, or null. +
              +
              +
              Returns:
              +
              Possibly null.
              +
              +
            • +
            + + + +
              +
            • +

              getFirst

              +
              public DSIObject getFirst()
              +
              The first child, or null.
              +
            • +
            + + + +
              +
            • +

              getFirstInfo

              +
              public DSInfo getFirstInfo()
              +
              The first child info, or null.
              +
            • +
            + + + +
              +
            • +

              getFirstNodeInfo

              +
              public DSInfo getFirstNodeInfo()
              +
              The info for the first child node, or null.
              +
            • +
            + + + +
              +
            • +

              getLast

              +
              public DSIObject getLast()
              +
              The last child, or null.
              +
            • +
            + + + +
              +
            • +

              getLastInfo

              +
              public DSInfo getLastInfo()
              +
              The last child info, or null.
              +
            • +
            + + + +
              +
            • +

              getLogger

              +
              public java.util.logging.Logger getLogger()
              +
              Ascends the tree until a logger is found. If overriding, call + super.getLogger and set the + result as the parent logger of your new logger. +
              +
              +
              Overrides:
              +
              getLogger in + class DSLogger +
              +
              +
            • +
            + + + +
              +
            • +

              getMetadata

              +
              public void getMetadata(DSInfo info,
              +                        DSMap bucket)
              +
              Override point, add any meta data for the given info to the + provided bucket. +
              +
            • +
            + + + +
              +
            • +

              getName

              +
              public java.lang.String getName()
              +
              Returns the name of this node in its parent, or null if + un-parented. +
              +
            • +
            + + + +
              +
            • +

              getNode

              +
              public DSNode getNode(java.lang.String name)
              +
              A convenience for (DSNode) get(name).
              +
            • +
            + + + +
              +
            • +

              getParent

              +
              public DSNode getParent()
              +
              Returns the parent node, or null.
              +
            • +
            + + + +
              +
            • +

              getPath

              +
              public java.lang.String getPath()
              +
              The DSA path, properly encoded.
              +
            • +
            + + + +
              +
            • +

              getValue

              +
              public DSIValue getValue(java.lang.String name)
              +
              A convenience for (DSIValue) get(name).
              +
            • +
            + + + +
              +
            • +

              isDefaultInstance

              +
              protected final boolean isDefaultInstance()
              +
              True if this is the default instance for the type.
              +
            • +
            + + + +
              +
            • +

              isEqual

              +
              public boolean isEqual(java.lang.Object arg)
              +
              True if the argument is a node with the same children, although + their order can be + different. +
              +
              +
              Specified by:
              +
              isEqual in + interface DSIObject +
              +
              +
            • +
            + + + +
              +
            • +

              isIdentical

              +
              public boolean isIdentical(java.lang.Object arg)
              +
              True if the argument is a node with the same children in the + exact same order. +
              +
            • +
            + + + +
              +
            • +

              isNode

              +
              protected static final boolean isNode(java.lang.Object obj)
              +
              Convenience for instanceof DSNode.
              +
            • +
            + + + +
              +
            • +

              isNull

              +
              public boolean isNull()
              +
              Returns false.
              +
              +
              Specified by:
              +
              isNull in + interface DSIObject +
              +
              +
            • +
            + + + +
              +
            • +

              isRunning

              +
              public boolean isRunning()
              +
              A convenience for !isStopped().
              +
            • +
            + + + +
              +
            • +

              isStable

              +
              public boolean isStable()
              +
              True after stable is called, children are stable before their + parents. +
              +
            • +
            + + + +
              +
            • +

              isStarted

              +
              public boolean isStarted()
              +
              True after start is called, children are started before their + parents. +
              +
            • +
            + + + +
              +
            • +

              isStopped

              +
              public boolean isStopped()
              +
              True after stop is called, children are stopped before their + parents. +
              +
            • +
            + + + +
              +
            • +

              isSubscribed

              +
              public boolean isSubscribed()
              +
              True if there are any subscribers.
              +
            • +
            + + + +
              +
            • +

              isSubscribed

              +
              public boolean isSubscribed(DSInfo child,
              +                            DSTopic topic)
              +
              True if there are any subscriptions with the matching child and + topic. +
              +
              +
              Parameters:
              +
              child - Can be null.
              +
              topic - Can be null.
              +
              +
            • +
            + + + +
              +
            • +

              isSubscribed

              +
              public boolean isSubscribed(DSTopic topic)
              +
              True if there any subscriptions for the given topic.
              +
            • +
            + + + +
              +
            • +

              iterateNodes

              +
              public java.util.Iterator<DSInfo> iterateNodes()
              +
              Returns an info iterator of child DSNodes.
              +
            • +
            + + + +
              +
            • +

              iterateValues

              +
              public java.util.Iterator<DSInfo> iterateValues()
              +
              Returns an info iterator of child DSIValues.
              +
            • +
            + + + +
              +
            • +

              iterator

              +
              public java.util.Iterator<DSInfo> iterator()
              +
              Returns an info iterator of all children.
              +
              +
              Specified by:
              +
              iterator in interface java.lang.Iterable<DSInfo>
              +
              +
            • +
            + + + +
              +
            • +

              onChildAdded

              +
              protected void onChildAdded(DSInfo info)
              +
              Called when the given child is added and in the stable state. +
              +
            • +
            + + + +
              +
            • +

              onChildChanged

              +
              protected void onChildChanged(DSInfo info)
              +
              Called when the given child is changed and in the stable state. +
              +
            • +
            + + + +
              +
            • +

              onChildRemoved

              +
              protected void onChildRemoved(DSInfo info)
              +
              Called when the given child is removed and in the stable state. +
              +
            • +
            + + + +
              +
            • +

              onInfoChanged

              +
              protected void onInfoChanged(DSInfo info)
              +
              Called when the given info is modified and in the stable state. +
              +
            • +
            + + + +
              +
            • +

              onInvoke

              +
              public ActionResult onInvoke(DSInfo actionInfo,
              +                             ActionInvocation invocation)
              +
              Override point, called by the default implementation of + DSAction.invoke. You should call + super.onInvoke if you do not handle an incoming invocation. However, do not call + super if + you do. +
              +
              +
              Parameters:
              +
              actionInfo - Child info for the action, you can declare a field + for the action info for + quick instance comparison. +
              +
              invocation - Details about the incoming invoke as well as the + mechanism to send updates + over an open stream. +
              +
              Returns:
              +
              It is okay to return null if the action result type is void.
              +
              Throws:
              +
              java.lang.IllegalStateException - If the nothing handles an + incoming invocation. +
              +
              See Also:
              +
              DSAction.invoke(DSInfo, + ActionInvocation)
              +
              +
            • +
            + + + +
              +
            • +

              onSet

              +
              public void onSet(DSInfo info,
              +                  DSIValue value)
              +
              Override point, called when a value being set. The default + implementation calls put(info, + value). Throw an exception to report an error to the requester. +
              +
              +
              Parameters:
              +
              info - The child being changed.
              +
              value - The new value.
              +
              See Also:
              +
              DSIResponder.onSet(InboundSetRequest) +
              +
              +
            • +
            + + + +
              +
            • +

              onSet

              +
              public void onSet(DSIValue value)
              +
              Override point, called only when a DSNode subclass implements + DSIValue is being set. This + will throw and IllegalStateException if not overridden. You should store the value + of the + node as a child and call put in override implementation. Throw an exception to + report an error to the requester. +
              +
              +
              Parameters:
              +
              value - The new value.
              +
              See Also:
              +
              DSIResponder.onSet(InboundSetRequest), + DSValueNode
              +
              +
            • +
            + + + +
              +
            • +

              onSubscribe

              +
              protected void onSubscribe(DSTopic topic,
              +                           DSInfo child,
              +                           DSISubscriber subscriber)
              +
              Called for every subscription.
              +
              +
              Parameters:
              +
              topic - Will not be null.
              +
              child - Can be null.
              +
              subscriber - Will not be null.
              +
              +
            • +
            + + + +
              +
            • +

              onSubscribed

              +
              protected void onSubscribed()
              +
              Called when this node transitions from having no subscriptions to + having a subscription of + any kind. +
              +
            • +
            + + + +
              +
            • +

              onSubscribed

              +
              protected void onSubscribed(DSTopic topic,
              +                            DSInfo child)
              +
              Called when the child and topic pair transitions from having no + subscriptions to have a + subscription. +
              +
              +
              Parameters:
              +
              child - Can be null, which indicates node subscriptions.
              +
              +
            • +
            + + + +
              +
            • +

              onStable

              +
              protected void onStable()
              +
              Called once this node is stable, but before stable is called on + children. +
              +
            • +
            + + + +
              +
            • +

              onStarted

              +
              protected void onStarted()
              +
              Called once this node and its entire subtree is started.
              +
            • +
            + + + +
              +
            • +

              onStopped

              +
              protected void onStopped()
              +
              Called once this node and its entire subtree is stopped.
              +
            • +
            + + + +
              +
            • +

              onUnsubscribe

              +
              protected void onUnsubscribe(DSTopic topic,
              +                             DSInfo child,
              +                             DSISubscriber subscriber)
              +
              Called for every unsubscribe.
              +
              +
              Parameters:
              +
              topic - Will not be null.
              +
              child - Can be null.
              +
              subscriber - Will not be null.
              +
              +
            • +
            + + + +
              +
            • +

              onUnsubscribed

              +
              protected void onUnsubscribed()
              +
              Called when this node transitions to having no subscriptions of + any kind. +
              +
            • +
            + + + +
              +
            • +

              onUnsubscribed

              +
              protected void onUnsubscribed(DSTopic topic,
              +                              DSInfo child)
              +
              Called when the child and topic pair transitions to having no + subscriptions. +
              +
              +
              Parameters:
              +
              topic - Can not be null.
              +
              child - Can be null.
              +
              +
            • +
            + + + +
              +
            • +

              put

              +
              public DSInfo put(java.lang.String name,
              +                  DSIObject object)
              +
              Adds or replaces the named child. If adding, + add(String,DSIObject) will be called. +
              +
              +
              Returns:
              +
              The info for the child.
              +
              +
            • +
            + + + +
              +
            • +

              put

              +
              public DSInfo put(java.lang.String name,
                                 boolean arg)
              -
              A convenience for put(String, DSIObject)
              -
              -
              Returns:
              -
              The info for the child.
              -
              -
            • -
            - - - -
              -
            • -

              put

              -
              public DSInfo put(java.lang.String name,
              +                
              A convenience for put(String, DSIObject)
              +
              +
              Returns:
              +
              The info for the child.
              +
              +
            • +
            + + + +
              +
            • +

              put

              +
              public DSInfo put(java.lang.String name,
                                 double arg)
              -
              A convenience for put(String, DSIObject)
              -
              -
              Returns:
              -
              The info for the child.
              -
              -
            • -
            - - - -
              -
            • -

              put

              -
              public DSInfo put(java.lang.String name,
              +                
              A convenience for put(String, DSIObject)
              +
              +
              Returns:
              +
              The info for the child.
              +
              +
            • +
            + + + +
              +
            • +

              put

              +
              public DSInfo put(java.lang.String name,
                                 float arg)
              -
              A convenience for put(String, DSIObject)
              -
              -
              Returns:
              -
              The info for the child.
              -
              -
            • -
            - - - -
              -
            • -

              put

              -
              public DSInfo put(java.lang.String name,
              +                
              A convenience for put(String, DSIObject)
              +
              +
              Returns:
              +
              The info for the child.
              +
              +
            • +
            + + + +
              +
            • +

              put

              +
              public DSInfo put(java.lang.String name,
                                 int arg)
              -
              A convenience for put(String, DSIObject)
              -
              -
              Returns:
              -
              The info for the child.
              -
              -
            • -
            - - - -
              -
            • -

              put

              -
              public DSInfo put(java.lang.String name,
              +                
              A convenience for put(String, DSIObject)
              +
              +
              Returns:
              +
              The info for the child.
              +
              +
            • +
            + + + +
              +
            • +

              put

              +
              public DSInfo put(java.lang.String name,
                                 long arg)
              -
              A convenience for put(String, DSIObject)
              -
              -
              Returns:
              -
              The info for the child.
              -
              -
            • -
            - - - -
              -
            • -

              put

              -
              public DSInfo put(java.lang.String name,
              +                
              A convenience for put(String, DSIObject)
              +
              +
              Returns:
              +
              The info for the child.
              +
              +
            • +
            + + + +
              +
            • +

              put

              +
              public DSInfo put(java.lang.String name,
                                 java.lang.String arg)
              -
              A convenience for put(String, DSIObject)
              -
              -
              Returns:
              -
              The info for the child.
              -
              -
            • -
            - - - -
              -
            • -

              put

              -
              public DSNode put(DSInfo info,
              -                  DSIObject object)
              -
              Replaces the child.
              -
              -
              Returns:
              -
              This
              -
              -
            • -
            - - - -
              -
            • -

              remove

              -
              public DSNode remove(DSInfo info)
              -
              Removes the child.
              -
              -
              Returns:
              -
              This
              -
              Throws:
              -
              java.lang.IllegalStateException - If the info is permanent or not a child of this node.
              -
              -
            • -
            - - - -
              -
            • -

              remove

              -
              public DSInfo remove(java.lang.String name)
              -
              Remove the named child if it is contained.
              -
              -
              Returns:
              -
              The removed info, or null.
              -
              Throws:
              -
              java.lang.IllegalStateException - If the info says its not removable.
              -
              -
            • -
            - - - -
              -
            • -

              stable

              -
              public final void stable()
              -
              Called after the entire subtree is started. Will call onStable after the entire subtree is - stable.
              -
            • -
            - - - -
              -
            • -

              start

              -
              public final void start()
              -
              Sets the state to starting. Calls onStarted once the entire subtree is started.
              -
            • -
            - - - -
              -
            • -

              stop

              -
              public final void stop()
              -
              Sets the state to stopped. Will call onStop before child nodes are stopped, and - onChildrenStopped after all child nodes are stopped.
              -
            • -
            - - - -
              -
            • -

              subscribe

              -
              public void subscribe(DSTopic topic,
              -                      DSInfo child,
              -                      DSISubscriber subscriber)
              -
              Subscribes the child and topic.
              -
              -
              Parameters:
              -
              topic - Can not be null.
              -
              child - Can be null, and cannot be a child node.
              -
              subscriber - Can not be null.
              -
              -
            • -
            - - - -
              -
            • -

              toNode

              -
              protected static DSNode toNode(java.lang.Object obj)
              -
              A convenience that casts the argument to a node.
              -
            • -
            - - - -
              -
            • -

              unsubscribe

              -
              public void unsubscribe(DSTopic topic,
              -                        DSInfo child,
              -                        DSISubscriber subscriber)
              -
              Unsubscribes the tuple.
              -
              -
              Parameters:
              -
              topic - Can not be null.
              -
              child - Can be null.
              -
              subscriber - Can not be null.
              -
              -
            • -
            - - - -
              -
            • -

              validateChild

              -
              protected void validateChild(DSIObject obj)
              -
              Override point, throw a meaningful IllegalArgumentException if the child is not allowed
              -
            • -
            - - - -
              -
            • -

              validateParent

              -
              protected void validateParent(DSNode node)
              -
              Override point, throw a meaningful IllegalArgumentException if the parent is not allowed
              -
            • -
            -
          • -
          -
        • -
        -
        +
        A convenience for put(String, DSIObject)
        +
        +
        Returns:
        +
        The info for the child.
        +
        +
      • +
      + + + +
        +
      • +

        put

        +
        public DSNode put(DSInfo info,
        +                  DSIObject object)
        +
        Replaces the child.
        +
        +
        Returns:
        +
        This
        +
        +
      • +
      + + + +
        +
      • +

        remove

        +
        public DSNode remove(DSInfo info)
        +
        Removes the child.
        +
        +
        Returns:
        +
        This
        +
        Throws:
        +
        java.lang.IllegalStateException - If the info is permanent or not + a child of this node. +
        +
        +
      • +
      + + + +
        +
      • +

        remove

        +
        public DSInfo remove(java.lang.String name)
        +
        Remove the named child if it is contained.
        +
        +
        Returns:
        +
        The removed info, or null.
        +
        Throws:
        +
        java.lang.IllegalStateException - If the info says its not + removable. +
        +
        +
      • +
      + + + +
        +
      • +

        stable

        +
        public final void stable()
        +
        Called after the entire subtree is started. Will call onStable + after the entire subtree is + stable. +
        +
      • +
      + + + +
        +
      • +

        start

        +
        public final void start()
        +
        Sets the state to starting. Calls onStarted once the entire + subtree is started. +
        +
      • +
      + + + +
        +
      • +

        stop

        +
        public final void stop()
        +
        Sets the state to stopped. Will call onStop before child nodes + are stopped, and + onChildrenStopped after all child nodes are stopped. +
        +
      • +
      + + + +
        +
      • +

        subscribe

        +
        public void subscribe(DSTopic topic,
        +                      DSInfo child,
        +                      DSISubscriber subscriber)
        +
        Subscribes the child and topic.
        +
        +
        Parameters:
        +
        topic - Can not be null.
        +
        child - Can be null, and cannot be a child node.
        +
        subscriber - Can not be null.
        +
        +
      • +
      + + + +
        +
      • +

        toNode

        +
        protected static DSNode toNode(java.lang.Object obj)
        +
        A convenience that casts the argument to a node.
        +
      • +
      + + + +
        +
      • +

        unsubscribe

        +
        public void unsubscribe(DSTopic topic,
        +                        DSInfo child,
        +                        DSISubscriber subscriber)
        +
        Unsubscribes the tuple.
        +
        +
        Parameters:
        +
        topic - Can not be null.
        +
        child - Can be null.
        +
        subscriber - Can not be null.
        +
        +
      • +
      + + + +
        +
      • +

        validateChild

        +
        protected void validateChild(DSIObject obj)
        +
        Override point, throw a meaningful IllegalArgumentException if + the child is not allowed +
        +
      • +
      + + + +
        +
      • +

        validateParent

        +
        protected void validateParent(DSNode node)
        +
        Override point, throw a meaningful IllegalArgumentException if + the parent is not allowed +
        +
      • +
      +
    • +
    +
  • +
+
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/node/DSNull.html b/docs/javadoc/org/iot/dsa/node/DSNull.html index f4e010d3..754ac73b 100644 --- a/docs/javadoc/org/iot/dsa/node/DSNull.html +++ b/docs/javadoc/org/iot/dsa/node/DSNull.html @@ -1,12 +1,13 @@ - + - -DSNull (dslink-core 0.15.0 API) - - - + + DSNull (dslink-core 0.15.0 API) + + + + + + +
+ + +
+ + +
-
org.iot.dsa.node
-

Class DSNull

+
org.iot.dsa.node
+

Class DSNull

- -
- +
+
+ +
+
+ +
+ + + +
+ + +
+ + + diff --git a/docs/javadoc/org/iot/dsa/package-frame.html b/docs/javadoc/org/iot/dsa/package-frame.html index 91aceff3..1b0b6180 100644 --- a/docs/javadoc/org/iot/dsa/package-frame.html +++ b/docs/javadoc/org/iot/dsa/package-frame.html @@ -1,21 +1,24 @@ - + - -org.iot.dsa (dslink-core 0.15.0 API) - - - + + org.iot.dsa (dslink-core 0.15.0 API) + + + -

org.iot.dsa

+

org.iot.dsa

-

Classes

- +

Classes

+
diff --git a/docs/javadoc/org/iot/dsa/package-summary.html b/docs/javadoc/org/iot/dsa/package-summary.html index 7d98503c..dc712613 100644 --- a/docs/javadoc/org/iot/dsa/package-summary.html +++ b/docs/javadoc/org/iot/dsa/package-summary.html @@ -1,12 +1,13 @@ - + - -org.iot.dsa (dslink-core 0.15.0 API) - - - + + org.iot.dsa (dslink-core 0.15.0 API) + + + + + + + + +
-

Package org.iot.dsa

-
-
Use the DSRuntime thread pool and timers.
-
-

See: Description

+

Package org.iot.dsa

+
+
Use the DSRuntime thread pool and timers.
+
+

See: Description

-
    -
  • - - - - - - - - - - - - - - - - -
    Class Summary 
    ClassDescription
    DSRuntime -
    DSA thread pool and timers.
    -
    DSRuntime.Timer -
    Can be used to inspect and cancel tasks passed to the run methods in DSRuntime.
    -
    -
  • -
- - - -

Package org.iot.dsa Description

-
Use the DSRuntime thread pool and timers.
+
    +
  • + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    DSRuntime +
    DSA thread pool and timers.
    +
    DSRuntime.Timer +
    Can be used to inspect and cancel tasks passed to the run methods in + DSRuntime. +
    +
    +
  • +
+ + + +

Package org.iot.dsa Description

+
Use the DSRuntime thread pool and timers.
+ + + + + + diff --git a/docs/javadoc/org/iot/dsa/package-tree.html b/docs/javadoc/org/iot/dsa/package-tree.html index 8feadfcb..5a8e3e47 100644 --- a/docs/javadoc/org/iot/dsa/package-tree.html +++ b/docs/javadoc/org/iot/dsa/package-tree.html @@ -1,12 +1,13 @@ - + - -org.iot.dsa Class Hierarchy (dslink-core 0.15.0 API) - - - + + org.iot.dsa Class Hierarchy (dslink-core 0.15.0 API) + + + + + + + + +
-

Hierarchy For Package org.iot.dsa

-Package Hierarchies: - +

Hierarchy For Package org.iot.dsa

+ Package Hierarchies: +
-

Class Hierarchy

- +

Class Hierarchy

+
    +
  • java.lang.Object + +
  • +
+ + + + + + diff --git a/docs/javadoc/overview-frame.html b/docs/javadoc/overview-frame.html index 06ddf63b..c50e13ba 100644 --- a/docs/javadoc/overview-frame.html +++ b/docs/javadoc/overview-frame.html @@ -1,33 +1,47 @@ - + - -Overview List (dslink-core 0.15.0 API) - - - + + Overview List (dslink-core 0.15.0 API) + + + - +

 

diff --git a/docs/javadoc/overview-summary.html b/docs/javadoc/overview-summary.html index aaaa162c..60812783 100644 --- a/docs/javadoc/overview-summary.html +++ b/docs/javadoc/overview-summary.html @@ -1,12 +1,13 @@ - + - -Overview (dslink-core 0.15.0 API) - - - + + Overview (dslink-core 0.15.0 API) + + +
- + - - - - - + + + + +
+ + + + + +
-

dslink-core 0.15.0 API

+

dslink-core 0.15.0 API

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Packages 
PackageDescription
org.iot.dsa -
Use the DSRuntime thread pool and timers.
-
org.iot.dsa.dslink -
DSLink is the main entry point for an application.
-
org.iot.dsa.dslink.requester -
API for implementing requesters without having to modeling everything in the node tree.
-
org.iot.dsa.dslink.responder -
API for implementing responders without having modeling everything in the node tree.
-
org.iot.dsa.io -
Node serialization and streaming abstraction for JSON and MsgPack.
-
org.iot.dsa.io.json 
org.iot.dsa.io.msgpack 
org.iot.dsa.logging -
Async handler for Java Util Logging that also manages log backups.
-
org.iot.dsa.node -
Persistent data model used to build the node tree of a link.
-
org.iot.dsa.node.action 
org.iot.dsa.node.event 
org.iot.dsa.security 
org.iot.dsa.time 
org.iot.dsa.util 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Packages 
PackageDescription
org.iot.dsa +
Use the DSRuntime thread pool and timers.
+
org.iot.dsa.dslink + +
DSLink is the main entry point for an application.
+
org.iot.dsa.dslink.requester + +
API for implementing requesters without having to modeling everything in + the node tree. +
+
org.iot.dsa.dslink.responder + +
API for implementing responders without having modeling everything in the + node tree. +
+
org.iot.dsa.io +
Node serialization and streaming abstraction for JSON and MsgPack.
+
org.iot.dsa.io.json 
org.iot.dsa.io.msgpack +  
org.iot.dsa.logging +
Async handler for Java Util Logging that also manages log backups.
+
org.iot.dsa.node +
Persistent data model used to build the node tree of a link.
+
org.iot.dsa.node.action +  
org.iot.dsa.node.event +  
org.iot.dsa.security 
org.iot.dsa.time 
org.iot.dsa.util 
- + - - - - - + + + + +
+ + + + + + diff --git a/docs/javadoc/overview-tree.html b/docs/javadoc/overview-tree.html index 87442173..74c8dcd8 100644 --- a/docs/javadoc/overview-tree.html +++ b/docs/javadoc/overview-tree.html @@ -1,12 +1,13 @@ - + - -Class Hierarchy (dslink-core 0.15.0 API) - - - + + Class Hierarchy (dslink-core 0.15.0 API) + + +
- + - - - - - + + + + +
+ + + + + +
-

Class Hierarchy

- -

Interface Hierarchy

- -

Enum Hierarchy

- +

Class Hierarchy

+ +

Interface Hierarchy

+ +

Enum Hierarchy

+
- + - - - - - + + + + +
+ + + + + + diff --git a/docs/javadoc/serialized-form.html b/docs/javadoc/serialized-form.html index d5e0d3a3..adf6d5e3 100644 --- a/docs/javadoc/serialized-form.html +++ b/docs/javadoc/serialized-form.html @@ -1,12 +1,13 @@ - + - -Serialized Form (dslink-core 0.15.0 API) - - - + + Serialized Form (dslink-core 0.15.0 API) + + + + + + + + +
-

Serialized Form

+

Serialized Form

- +
+ + + + + + diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/io/DSSynchronizedByteBuffer.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/io/DSSynchronizedByteBuffer.java deleted file mode 100644 index 50229e73..00000000 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/io/DSSynchronizedByteBuffer.java +++ /dev/null @@ -1,366 +0,0 @@ -package com.acuity.iot.dsa.dslink.io; - -import java.nio.ByteBuffer; - -/** - * A buffer for storing bytes being pushed from an input stream. Useful when bytes are - * coming in faster than can be processed. - * - * @author Aaron Hansen - */ -public class DSSynchronizedByteBuffer { - - /////////////////////////////////////////////////////////////////////////// - // Fields - /////////////////////////////////////////////////////////////////////////// - - private byte[] buffer; - private RuntimeException closeException; - private int length = 0; - private int offset = 0; - private boolean open = false; - private long timeout = 60000; - - ///////////////////////////////////////////////////////////////// - // Methods - Constructors - ///////////////////////////////////////////////////////////////// - - public DSSynchronizedByteBuffer() { - this(8192); - } - - public DSSynchronizedByteBuffer(int initialCapacity) { - buffer = new byte[initialCapacity]; - } - - ///////////////////////////////////////////////////////////////// - // Methods - In alphabetical order by method name. - ///////////////////////////////////////////////////////////////// - - /** - * The number of bytes available for reading. - */ - public int available() { - return length; - } - - public synchronized void clear() { - length = 0; - offset = 0; - notify(); - } - - /** - * Important for notifying waiting threads. - */ - public synchronized DSSynchronizedByteBuffer close() { - if (!open) { - return this; - } - open = false; - notify(); - return this; - } - - /** - * Important for notifying waiting threads. - */ - public synchronized DSSynchronizedByteBuffer close(RuntimeException toThrow) { - if (!open) { - return this; - } - this.closeException = toThrow; - open = false; - notify(); - return this; - } - - /** - * Number of millis the read methods will block before throwing an IOException. - * - * @return Zero or less is indefinite. - */ - public long getTimeout() { - return timeout; - } - - /** - * Increases the childCount of the buffer to at least the given. - */ - private void growBuffer(int minSize) { - int size = buffer.length; - while (size < minSize) { - size *= 2; - } - byte[] tmp = new byte[size]; - System.arraycopy(buffer, offset, tmp, 0, length); - buffer = tmp; - offset = 0; - } - - public boolean isOpen() { - return open; - } - - public int length() { - return length; - } - - public synchronized DSSynchronizedByteBuffer open() { - if (open) { - return this; - } - length = 0; - offset = 0; - open = true; - closeException = null; - notify(); - return this; - } - - /** - * Gets the bytes from the given buffer, which will be flipped, then cleared. - */ - public synchronized void put(ByteBuffer buf) { - if (!open) { - throw new DSIoException("Closed"); - } - int len = buf.position(); - int bufLen = buffer.length; - if ((len + length + offset) >= bufLen) { - if ((len + length) > bufLen) { //the buffer is too small - growBuffer(len + length); - } else { //offset must be > 0, shift everything to index 0 - System.arraycopy(buffer, offset, buffer, 0, length); - offset = 0; - } - } - buf.flip(); - buf.get(buffer, length + offset, len); - buf.clear(); - length += len; - notify(); - } - - /** - * Add the byte to the buffer for reading. - */ - public synchronized void put(byte b) { - if (!open) { - throw new DSIoException("Closed"); - } - int bufLen = buffer.length; - int msgLen = 1; - if ((msgLen + length + offset) >= bufLen) { - if ((msgLen + length) > bufLen) { - growBuffer(msgLen + length); - } else { //offset must be > 0 - System.arraycopy(buffer, offset, buffer, 0, length); - offset = 0; - } - } - buffer[length + offset] = b; - length++; - notify(); - } - - /** - * Add bytes to the buffer for reading. - * - * @param msg The data source. - */ - public synchronized void put(byte[] msg) { - put(msg, 0, msg.length); - } - - /** - * Add bytes to the buffer for reading. - * - * @param msg The data source. - * @param off The start offset in the buffer to put data. - * @param len The maximum number of bytes to read. - */ - public synchronized void put(byte[] msg, int off, int len) { - if (!open) { - throw new DSIoException("Closed"); - } - int bufLen = buffer.length; - if ((len + length + offset) >= bufLen) { - if ((len + length) > bufLen) { //the buffer is too small - growBuffer(len + length); - } else { //offset must be > 0, shift everything to index 0 - System.arraycopy(buffer, offset, buffer, 0, length); - offset = 0; - } - } - System.arraycopy(msg, off, buffer, length + offset, len); - length += len; - notify(); - } - - /** - * Overwrite bytes in the internal buffer (which begins at index 0). - * - * @param dest The internal destination offset. - * @param msg The data source. - * @param off The start offset in the msg to put data. - * @param len The maximum number of bytes to read. - */ - public synchronized void put(int dest, byte[] msg, int off, int len) { - if (!open) { - throw new DSIoException("Closed"); - } - if (offset > 0) { - System.arraycopy(buffer, offset, buffer, 0, length); - offset = 0; - } - int newLen = dest + len; - if (newLen >= buffer.length) { - growBuffer(newLen); - } - System.arraycopy(msg, off, buffer, dest, len); - if (newLen > length) { - length = newLen; - } - if ((dest + len) > length) { - length += len; - } - notify(); - } - - /** - * Returns the next incoming byte, or -1 when end of stream has been reached. - * - * @throws DSIoException if there are any issues. - */ - public synchronized int read() { - while (open && (length == 0)) { - try { - if (timeout > 0) { - wait(timeout); - } else { - wait(); - } - } catch (InterruptedException ignore) { - } - } - notify(); - if (!open) { - if (length == 0) { - if (closeException != null) { - throw closeException; - } - return -1; - } - } else if (length == 0) { - throw new DSIoException("Read timeout"); - } - int ret = buffer[offset]; - offset++; - length--; - return ret; - } - - /** - * Reads incoming bytes into the given buffer. - * - * @param buf The buffer into which data is read. - * @param off The start offset in the buffer to put data. - * @param len The maximum number of bytes to read. - * @return The number of bytes read or -1 for end of stream. - * @throws DSIoException if there are any issues. - */ - public synchronized int read(byte[] buf, int off, int len) { - while (open && (length < len)) { - try { - if (timeout > 0) { - wait(timeout); - } else { - wait(); - } - } catch (InterruptedException ignore) { - } - } - notify(); - if (!open) { - if (length == 0) { - if (closeException != null) { - throw closeException; - } - return -1; - } - } else if (length == 0) { - throw new DSIoException("Read timeout"); - } - len = Math.min(len, length); - System.arraycopy(buffer, offset, buf, off, len); - length -= len; - if (length == 0) { - offset = 0; - } else { - offset += len; - } - return len; - } - - /** - * Reads incoming bytes into the given buffer. - * - * @param buf The buffer into which data is read. - * @return The number of bytes read or -1 for end of stream. - * @throws DSIoException if there are any issues. - */ - public synchronized int read(ByteBuffer buf) { - while (open && (length == 0)) { - try { - if (timeout > 0) { - wait(timeout); - } else { - wait(); - } - } catch (InterruptedException ignore) { - } - } - notify(); - if (!open) { - if (length == 0) { - if (closeException != null) { - throw closeException; - } - return -1; - } - } else if (length == 0) { - throw new DSIoException("Read timeout"); - } - int len = Math.min(buf.remaining(), length); - buf.put(buffer, offset, len); - length -= len; - if (length == 0) { - offset = 0; - } else { - offset += len; - } - return len; - } - - /** - * Number of millis the read methods will block before throwing an DSIoException. - * - * @param timeout Zero or less for indefinite. - * @return This - */ - public DSSynchronizedByteBuffer setTimeout(long timeout) { - this.timeout = timeout; - return this; - } - - /** - * Returns a new array. - */ - public byte[] toByteArray() { - byte[] ret = new byte[length]; - read(ret, 0, length); - return ret; - } - -} diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/message/CloseMessage.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/message/CloseMessage.java index 48d679dc..89ab6b8a 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/message/CloseMessage.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/message/CloseMessage.java @@ -1,7 +1,5 @@ package com.acuity.iot.dsa.dslink.protocol.message; -import org.iot.dsa.io.DSIWriter; - /** * A close request or response. * diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/DS1Session.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/DS1Session.java index 36f7c9ba..1ae3996e 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/DS1Session.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/DS1Session.java @@ -424,7 +424,6 @@ public void writeResponse(OutboundMessage message) { message.write(getMessageWriter()); } - ///////////////////////////////////////////////////////////////// // Inner Classes ///////////////////////////////////////////////////////////////// diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1Responder.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1Responder.java index 5ec5f9d5..f1260dd9 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1Responder.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v1/responder/DS1Responder.java @@ -7,7 +7,6 @@ import com.acuity.iot.dsa.dslink.protocol.message.ErrorResponse; import com.acuity.iot.dsa.dslink.protocol.responder.DSResponder; import java.util.Map; -import java.util.logging.Level; import org.iot.dsa.DSRuntime; import org.iot.dsa.node.DSList; import org.iot.dsa.node.DSMap; diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/DS2MessageReader.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/DS2MessageReader.java index 2b213106..7b0aca08 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/DS2MessageReader.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/protocol_v2/DS2MessageReader.java @@ -146,10 +146,10 @@ public DS2MessageReader init(InputStream in) { public boolean isRequest() { switch (method) { - case MSG_CLOSE : - case MSG_INVOKE_REQ : - case MSG_LIST_REQ : - case MSG_OBSERVE_REQ : + case MSG_CLOSE: + case MSG_INVOKE_REQ: + case MSG_LIST_REQ: + case MSG_OBSERVE_REQ: return true; } return false; diff --git a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/responder/DSResponder.java b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/responder/DSResponder.java index 48ef298e..0a4c61cf 100644 --- a/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/responder/DSResponder.java +++ b/dslink-core/src/main/java/com/acuity/iot/dsa/dslink/protocol/responder/DSResponder.java @@ -88,6 +88,7 @@ public void onDisconnect() { public DSStream putRequest(Integer rid, DSStream request) { return inboundRequests.put(rid, request); } + public DSStream removeRequest(Integer rid) { return inboundRequests.remove(rid); } diff --git a/dslink-core/src/main/java/org/iot/dsa/dslink/DSLink.java b/dslink-core/src/main/java/org/iot/dsa/dslink/DSLink.java index 20c0cf32..fe9b48fc 100644 --- a/dslink-core/src/main/java/org/iot/dsa/dslink/DSLink.java +++ b/dslink-core/src/main/java/org/iot/dsa/dslink/DSLink.java @@ -14,18 +14,11 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import org.iot.dsa.DSRuntime; -import org.iot.dsa.dslink.responder.InboundInvokeRequest; -import org.iot.dsa.dslink.responder.InboundListRequest; -import org.iot.dsa.dslink.responder.InboundSetRequest; -import org.iot.dsa.dslink.responder.InboundSubscribeRequest; -import org.iot.dsa.dslink.responder.OutboundListResponse; -import org.iot.dsa.dslink.responder.SubscriptionCloseHandler; import org.iot.dsa.io.NodeDecoder; import org.iot.dsa.io.NodeEncoder; import org.iot.dsa.io.json.JsonReader; import org.iot.dsa.io.json.JsonWriter; import org.iot.dsa.logging.DSLogging; -import org.iot.dsa.node.DSIValue; import org.iot.dsa.node.DSInfo; import org.iot.dsa.node.DSNode; import org.iot.dsa.node.action.ActionInvocation; diff --git a/dslink-core/src/main/java/org/iot/dsa/node/DSNode.java b/dslink-core/src/main/java/org/iot/dsa/node/DSNode.java index 1f3eb9f0..7de04331 100644 --- a/dslink-core/src/main/java/org/iot/dsa/node/DSNode.java +++ b/dslink-core/src/main/java/org/iot/dsa/node/DSNode.java @@ -389,7 +389,8 @@ void dsInit() { /** * Notifies subscribers of the event. - * @param topic Must not be null. + * + * @param topic Must not be null. * @param event Must not be null. * @param child Can be null. */ @@ -399,7 +400,8 @@ protected void fire(DSTopic topic, DSIEvent event, DSInfo child) { /** * Notifies subscribers of the event. - * @param topic Must not be null. + * + * @param topic Must not be null. * @param event Must not be null. * @param child Can be null. * @param params Optional diff --git a/dslink-core/src/test/java/org/iot/dsa/dslink/DSByteBufferTest.java b/dslink-core/src/test/java/org/iot/dsa/dslink/DSByteBufferTest.java index 51ceabf1..b5f21c7f 100644 --- a/dslink-core/src/test/java/org/iot/dsa/dslink/DSByteBufferTest.java +++ b/dslink-core/src/test/java/org/iot/dsa/dslink/DSByteBufferTest.java @@ -82,8 +82,8 @@ public void comparisonTest() { Assert.assertEquals(dsry.length, jary.length); Assert.assertArrayEquals(dsry, jary); //short - javaBuf.putShort((short)123); - dsBuf.putShort((short)123); + javaBuf.putShort((short) 123); + dsBuf.putShort((short) 123); dsry = dsBuf.toByteArray(); jary = toByteArray(javaBuf); Assert.assertEquals(dsry.length, jary.length); diff --git a/dslink-core/src/test/java/org/iot/dsa/dslink/PerfTest.java b/dslink-core/src/test/java/org/iot/dsa/dslink/PerfTest.java index f3ed7971..d62f6c91 100644 --- a/dslink-core/src/test/java/org/iot/dsa/dslink/PerfTest.java +++ b/dslink-core/src/test/java/org/iot/dsa/dslink/PerfTest.java @@ -7,7 +7,6 @@ import org.iot.dsa.node.DSNode; import org.iot.dsa.node.DSString; import org.iot.dsa.node.action.DSAction; -import org.junit.Test; /** * @author Aaron Hansen diff --git a/dslink-core/src/test/java/org/iot/dsa/dslink/RequesterInvokeTest.java b/dslink-core/src/test/java/org/iot/dsa/dslink/RequesterInvokeTest.java index bc0df6e5..7a84cfc7 100644 --- a/dslink-core/src/test/java/org/iot/dsa/dslink/RequesterInvokeTest.java +++ b/dslink-core/src/test/java/org/iot/dsa/dslink/RequesterInvokeTest.java @@ -1,16 +1,10 @@ package org.iot.dsa.dslink; -import com.acuity.iot.dsa.dslink.protocol.protocol_v1.DS1LinkConnection; import com.acuity.iot.dsa.dslink.test.TestLink; -import com.acuity.iot.dsa.dslink.transport.DSBinaryTransport; -import org.iot.dsa.dslink.requester.AbstractInvokeHandler; -import org.iot.dsa.dslink.requester.OutboundInvokeHandler; import org.iot.dsa.dslink.requester.SimpleInvokeHandler; import org.iot.dsa.node.DSInfo; import org.iot.dsa.node.DSInt; -import org.iot.dsa.node.DSList; import org.iot.dsa.node.DSMap; -import org.iot.dsa.node.DSMetadata; import org.iot.dsa.node.DSNode; import org.iot.dsa.node.DSValueType; import org.iot.dsa.node.action.ActionInvocation; diff --git a/dslink-core/src/test/java/org/iot/dsa/dslink/RequesterSubscribeTest.java b/dslink-core/src/test/java/org/iot/dsa/dslink/RequesterSubscribeTest.java index e9fbece4..af228073 100644 --- a/dslink-core/src/test/java/org/iot/dsa/dslink/RequesterSubscribeTest.java +++ b/dslink-core/src/test/java/org/iot/dsa/dslink/RequesterSubscribeTest.java @@ -5,7 +5,6 @@ import org.iot.dsa.dslink.requester.SimpleRequestHandler; import org.iot.dsa.node.DSElement; import org.iot.dsa.node.DSIValue; -import org.iot.dsa.node.DSInfo; import org.iot.dsa.node.DSInt; import org.iot.dsa.node.DSNode; import org.iot.dsa.node.DSStatus; diff --git a/dslink-websocket-standalone/src/main/java/org/iot/dsa/dslink/websocket/WsTextTransport.java b/dslink-websocket-standalone/src/main/java/org/iot/dsa/dslink/websocket/WsTextTransport.java index ba3b2d29..cc7f3d86 100644 --- a/dslink-websocket-standalone/src/main/java/org/iot/dsa/dslink/websocket/WsTextTransport.java +++ b/dslink-websocket-standalone/src/main/java/org/iot/dsa/dslink/websocket/WsTextTransport.java @@ -1,5 +1,7 @@ package org.iot.dsa.dslink.websocket; +import com.acuity.iot.dsa.dslink.io.DSCharBuffer; +import com.acuity.iot.dsa.dslink.io.DSIoException; import com.acuity.iot.dsa.dslink.transport.DSTextTransport; import com.acuity.iot.dsa.dslink.transport.DSTransport; import java.io.IOException; @@ -16,8 +18,6 @@ import javax.websocket.RemoteEndpoint; import javax.websocket.Session; import org.glassfish.tyrus.client.ClientManager; -import com.acuity.iot.dsa.dslink.io.DSCharBuffer; -import com.acuity.iot.dsa.dslink.io.DSIoException; import org.iot.dsa.util.DSException; /**