sap.prd.cmintegration.cli.GetTransportStatusABAP Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ci-integration-cli Show documentation
Show all versions of ci-integration-cli Show documentation
SAP Change Management Integration
package sap.prd.cmintegration.cli;
import static sap.prd.cmintegration.cli.Commands.Helpers.getCommandName;
import java.util.function.Function;
import org.apache.commons.cli.Options;
import org.apache.commons.lang3.StringUtils;
import com.sap.cmclient.Transport;
/**
* Command for retrieving the owner of a transport.
*/
@CommandDescriptor(name="get-transport-status", type = BackendType.CTS)
class GetTransportStatusABAP extends TransportRelatedABAP {
GetTransportStatusABAP(String host, String user, String password, String transportId, boolean returnCodeMode) {
super(host, user, password, transportId, returnCodeMode);
}
@Override
protected Function getAction() {
return new Function() {
@Override
public String apply(Transport t) {
// ... ugly downcast
String status = ((com.sap.cmclient.dto.Transport)t).getStatus();
return (StringUtils.isBlank(status)) ? null : status;
}
};
}
public final static void main(String[] args) throws Exception {
TransportRelatedABAP.main(GetTransportStatusABAP.class, new Options(), args,
getCommandName(GetTransportStatusABAP.class), "",
"Returns the status of the given transport");
}
}