Commit 2e3a2835 authored by chiaming2000's avatar chiaming2000
Browse files

Deprecate legacy firmware download API. A new API is added for firmware

download that does not require a security pin.   
parent 35712cc5
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -25,19 +25,15 @@ import kinetic.admin.Domain;
import kinetic.admin.KineticAdminClient;
import kinetic.admin.KineticLog;
import kinetic.admin.KineticLogType;

import kinetic.client.ClientConfiguration;

import kinetic.client.KineticException;

import com.google.protobuf.ByteString;

import com.seagate.kinetic.client.internal.MessageFactory;
import com.seagate.kinetic.client.internal.p2p.DefaultKineticP2pClient;
import com.seagate.kinetic.common.lib.HMACAlgorithmUtil;
import com.seagate.kinetic.common.lib.KineticMessage;
import com.seagate.kinetic.proto.Kinetic.Command;

import com.seagate.kinetic.proto.Kinetic.Command.GetLog;
import com.seagate.kinetic.proto.Kinetic.Command.GetLog.Type;
import com.seagate.kinetic.proto.Kinetic.Command.Header;
@@ -50,8 +46,8 @@ import com.seagate.kinetic.proto.Kinetic.Command.Security.ACL.HMACAlgorithm;
import com.seagate.kinetic.proto.Kinetic.Command.Setup;
import com.seagate.kinetic.proto.Kinetic.Command.Status;
import com.seagate.kinetic.proto.Kinetic.Command.Status.StatusCode;
import com.seagate.kinetic.proto.Kinetic.Message.AuthType;
import com.seagate.kinetic.proto.Kinetic.Message;
import com.seagate.kinetic.proto.Kinetic.Message.AuthType;
import com.seagate.kinetic.proto.Kinetic.Message.PINauth;

/**
@@ -459,7 +455,7 @@ public class DefaultAdminClient extends DefaultKineticP2pClient implements Kinet
     * {@inheritDoc}
     */
    @Override
    public void firmwareDownload(byte[] pin, byte[] bytes)
    public void firmwareDownload(byte[] bytes)
            throws KineticException {

        KineticMessage km = MessageFactory.createKineticMessageWithBuilder();
@@ -469,10 +465,6 @@ public class DefaultAdminClient extends DefaultKineticP2pClient implements Kinet
        Setup.Builder setup = commandBuilder.getBodyBuilder()
                .getSetupBuilder();

//        if (null != pin && pin.length > 0) {
//            setup.setPin(ByteString.copyFrom(pin));
//        }

        setup.setFirmwareDownload(true);

        if (null != bytes && bytes.length > 0) {
@@ -813,6 +805,16 @@ public class DefaultAdminClient extends DefaultKineticP2pClient implements Kinet
        return kmresp;
    }

    /**
     * @deprecated
     */
    @Deprecated
    @Override
    public void firmwareDownload(byte[] pin, byte[] bytes)
            throws KineticException {
        this.firmwareDownload(bytes);
    }
    
    
    
}
+34 −18
Original line number Diff line number Diff line
@@ -52,19 +52,35 @@ public interface KineticAdminClient extends KineticP2pClient {
     * <p>
     * 
     * @param pin
     *            Compare the pin with drive's pin. If equal, can download
     *            firmware the information for the drive, if not, drive will
     *            reject the firmwareDownload request.
     *            No used. This is for backward compatibility only.
     * 
     * @param bytes
     *            update firmware bytes for the drive.
     * 
     * @throws KineticException
     *             if unable to load firmware bytes to the drive.
     * 
     * @deprecated
     * @see #firmwareDownload(byte[])
     */
    @Deprecated
    public void firmwareDownload(byte[] pin, byte[] bytes)
            throws KineticException;

    /**
     * Load firmware byte[] to the drive.
     * <p>
     * The firmware byte[] is itself protected on its own for integrity,
     * authenticity, etc
     * 
     * @param bytes
     *            update firmware bytes for the drive.
     * 
     * @throws KineticException
     *             if unable to load firmware bytes to the drive.
     */
    public void firmwareDownload(byte[] bytes) throws KineticException;

    /**
     * Get all Kinetic logs, such as the utilization temperature and capacity
     * information from the drive.