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

org.hyperledger.fabric.sdk.LifecycleInstallChaincodeRequest 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 java.util.Collection;

import org.hyperledger.fabric.sdk.exception.InvalidArgumentException;

/**
 * LifecycleInstallChaincodeRequest parameters for installing chaincode with lifecycle
 * see also {@link HFClient#sendLifecycleInstallChaincodeRequest(LifecycleInstallChaincodeRequest, Collection)}
 */
public class LifecycleInstallChaincodeRequest extends LifecycleRequest {

    private LifecycleChaincodePackage lifecycleChaincodePackage;

    LifecycleInstallChaincodeRequest(User userContext) {
        super(userContext, false);
    }

    LifecycleChaincodePackage getLifecycleChaincodePackage() {
        return lifecycleChaincodePackage;
    }

    /**
     * Set the chaincode package that needs to be installed.
     *
     * @param lifecycleChaincodePackage The chaincode to install see {@link LifecycleChaincodePackage}
     * @throws InvalidArgumentException
     */
    public void setLifecycleChaincodePackage(LifecycleChaincodePackage lifecycleChaincodePackage) throws InvalidArgumentException {

        if (null == lifecycleChaincodePackage) {
            throw new InvalidArgumentException("The parameter lifecycleChaincodePackage can not be null.");

        }
        this.lifecycleChaincodePackage = lifecycleChaincodePackage;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy