All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hyperledger.fabric.sdk.LifecycleRequest Maven / Gradle / Ivy

Go to download

Java SDK for Hyperledger Fabric. Deprecated as of Fabric v2.5, replaced by org.hyperledger.fabric:fabric-gateway.

There is a newer version: 2.2.26
Show newest version
/*
 *
 * Copyright IBM Corp. All Rights Reserved.
 *
 * SPDX-License-Identifier: Apache-2.0
 * /
 */

package org.hyperledger.fabric.sdk;

import org.hyperledger.fabric.sdk.helper.Config;

class LifecycleRequest {

    private static final long defaultConfigWaitTime = Config.getConfig().getProposalWaitTime();
    private boolean verifiable;

    // The timeout for a single proposal request to endorser in milliseconds
    private long proposalWaitTime = defaultConfigWaitTime;

    private User userContext;
    private boolean submitted = false;

    LifecycleRequest(User userContext) {
        this.userContext = userContext;
        verifiable = true;
    }

    LifecycleRequest(User userContext, boolean verifiable) {
        this.userContext = userContext;
        this.verifiable = verifiable;
    }

    void setSubmitted() {
        submitted = true;
    }

    User getUserContext() {

        return userContext;
    }

    /**
     * Set the user context for this request. This context will override the user context set
     * on {@link HFClient#setUserContext(User)}
     *
     * @param userContext The user context for this request used for signing.
     */
    public void setUserContext(User userContext) {
        this.userContext = userContext;
    }

    long getProposalWaitTime() {
        return proposalWaitTime;
    }

    /**
     * Sets the timeout for a single proposal request to endorser in milliseconds.
     *
     * @param proposalWaitTime the timeout for a single proposal request to endorser in milliseconds
     */
    public void setProposalWaitTime(long proposalWaitTime) {
        this.proposalWaitTime = proposalWaitTime;
    }

    boolean isVerifiable() {

        return verifiable;

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy