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

sap.prd.cmintegration.cli.GetTransportModifiable Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package sap.prd.cmintegration.cli;

import static java.lang.String.format;
import static sap.prd.cmintegration.cli.Commands.Helpers.getCommandName;

import java.util.function.Predicate;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import sap.ai.st.cm.plugins.ciintegration.odataclient.CMODataTransport;

/**
 *  Checks if a transport is modifiable.
 */
@CommandDescriptor(name="is-transport-modifiable")
class GetTransportModifiable extends TransportRelated {

    final static private Logger logger = LoggerFactory.getLogger(GetTransportModifiable.class);
    GetTransportModifiable(String host, String user, String password, String changeId, String transportId) {
        super(host, user, password, changeId, transportId);
    }

    /**
     * @return A predicate returning true in same something was written to stdout.
     * Otherwise false.
     */
    protected Predicate getOutputPredicate() {
        return it -> { System.out.println(it.isModifiable()); 
                       return true;};
    }

    public final static void main(String[] args) throws Exception {
        logger.debug(format("%s called with arguments: '%s'.", GetTransportModifiable.class.getSimpleName(), Commands.Helpers.getArgsLogString(args)));
        TransportRelated.main(GetTransportModifiable.class, args,
            format("%s , ", getCommandName(GetTransportModifiable.class)),
            "Returns 'true' if the transport is modifiable. Otherwise 'false'.");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy