+ this.requestId = 0;
+ }
+
+ /**
+ * Generates an instance of the Status class to be used in case of
+ * asynchronous call. It is supposed to be created by the underlying
+ * infrastructure only when it was successful in allocating the asynchronous
+ * request id, hence caller should expect StatusCode to be successful.
+ *
+ * @param errorCode
+ * The status code. If passed as null, code will be stored as
+ * {@code StatusCode.UNDEFINED}
+ * @param requestId
+ * The request id set by underlying infrastructure for this
+ * request
+ */
+ public Status(StatusCode errorCode, long requestId) {
+ this.code = (errorCode != null) ? errorCode : StatusCode.UNDEFINED;
+ this.description = (description != null) ? description : this.code
+ .toString();
+ this.requestId = requestId;