/**
 *
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.acme.spnego;


/**
 * @version $Revision: 531149 $ $Date: $
 */
public final class NegTokenTarg implements org.apache.asn1.types.com.acme.spnego.NegTokenTargType, org.apache.asn1.runtime.ASN1Type
{
    private negResultEnum negResult;
    private MechType supportedMech;
    private org.apache.asn1.runtime.ASN1OctetString responseToken;
    private org.apache.asn1.runtime.ASN1OctetString mechListMIC;

    public negResultEnum getNegResult()
    {
        return negResult;
    }

    public void setNegResult( negResultEnum negResult )
    {
        this.negResult = negResult;
    }

    public MechType getSupportedMech()
    {
        return supportedMech;
    }

    public void setSupportedMech( MechType supportedMech )
    {
        this.supportedMech = supportedMech;
    }

    public org.apache.asn1.runtime.ASN1OctetString getResponseToken()
    {
        return responseToken;
    }

    public void setResponseToken( org.apache.asn1.runtime.ASN1OctetString responseToken )
    {
        this.responseToken = responseToken;
    }

    public org.apache.asn1.runtime.ASN1OctetString getMechListMIC()
    {
        return mechListMIC;
    }

    public void setMechListMIC( org.apache.asn1.runtime.ASN1OctetString mechListMIC )
    {
        this.mechListMIC = mechListMIC;
    }

    public boolean isConsistent()
    {
        if ( negResult != null && !negResult.isConsistent() )
        {
            return false;
        }
        if ( supportedMech != null && !supportedMech.isConsistent() )
        {
            return false;
        }
        if ( responseToken != null && !responseToken.isConsistent() )
        {
            return false;
        }
        if ( mechListMIC != null && !mechListMIC.isConsistent() )
        {
            return false;
        }
        return true;
    }

    public static class negResultEnum extends org.apache.asn1.runtime.ValuedEnum implements org.apache.asn1.runtime.ASN1Type
    {
        public static final negResultEnum ACCEPTCOMPLETED = new negResultEnum( "accept_completed", 0 );
        public static final negResultEnum ACCEPTINCOMPLETE = new negResultEnum( "accept_incomplete", 1 );
        public static final negResultEnum REJECT = new negResultEnum( "reject", 2 );

        protected negResultEnum( String s, int i )
        {
            super( s, i );
        }

        public boolean isConsistent()
        {
            return true;
        }
    }
}
