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

org.ccsds.moims.mo.common.directory.structures.AddressDetails Maven / Gradle / Ivy

package org.ccsds.moims.mo.common.directory.structures;

/**
 * The AddressDetails structure holds all information required by the Directory 
 * service about a service providers URI and attributes relating to QoS. 
 */
public final class AddressDetails implements org.ccsds.moims.mo.mal.structures.Composite {

    /**
     * Short form for type.
     */
    @Deprecated
    private static final Integer TYPE_SHORT_FORM = 4;
    /**
     * Absolute short form for type. This will be replaced by the TypeId.
     */
    @Deprecated
    public static final Long SHORT_FORM = 844429241876484L;
    private static final long serialVersionUID = 844429241876484L;
    /**
     * Absolute short form for type.
     */
    public static final org.ccsds.moims.mo.mal.TypeId TYPE_ID = new org.ccsds.moims.mo.mal.TypeId(SHORT_FORM);

    /**
     * The set of possible QoS levels this service can provide.
     */
    private org.ccsds.moims.mo.mal.structures.QoSLevelList supportedLevels;

    /**
     * Any QoS properties relevant to this address URIs and the specified transport. 
     */
    private org.ccsds.moims.mo.mal.structures.NamedValueList QoSproperties;

    /**
     * The number of QoS priority levels that this provider supports.
     */
    private org.ccsds.moims.mo.mal.structures.UInteger priorityLevels;

    /**
     * The Service URI that identifies the physical location of this service. 
     * NULL if represents a shared data provider (Broker). 
     */
    private org.ccsds.moims.mo.mal.structures.URI serviceURI;

    /**
     * The broker URI that identifies the physical location of the publish and 
     * subscribe interface. NULL if service does not use publish and subscribe 
     * operations or if a shared broker is to be used. 
     */
    private org.ccsds.moims.mo.mal.structures.URI brokerURI;

    /**
     * The object instance identifier of a ServiceProvider COM object that is 
     * the shared broker used by this provider. 
     */
    private Long brokerProviderObjInstId;

    /**
     * Default constructor for AddressDetails.
     * 
     */
    public AddressDetails() {
    }

    /**
     * Constructor that initialises the values of the structure.
     * 
     * @param supportedLevels The set of possible QoS levels this service can 
     * provide. 
     * @param QoSproperties Any QoS properties relevant to this address URIs and 
     * the specified transport. 
     * @param priorityLevels The number of QoS priority levels that this provider 
     * supports. 
     * @param serviceURI The Service URI that identifies the physical location 
     * of this service. NULL if represents a shared data provider (Broker). 
     * @param brokerURI The broker URI that identifies the physical location of 
     * the publish and subscribe interface. NULL if service does not use publish 
     * and subscribe operations or if a shared broker is to be used. 
     * @param brokerProviderObjInstId The object instance identifier of a ServiceProvider 
     * COM object that is the shared broker used by this provider. 
     */
    public AddressDetails(org.ccsds.moims.mo.mal.structures.QoSLevelList supportedLevels,
            org.ccsds.moims.mo.mal.structures.NamedValueList QoSproperties,
            org.ccsds.moims.mo.mal.structures.UInteger priorityLevels,
            org.ccsds.moims.mo.mal.structures.URI serviceURI,
            org.ccsds.moims.mo.mal.structures.URI brokerURI,
            Long brokerProviderObjInstId) {
        this.supportedLevels = supportedLevels;
        this.QoSproperties = QoSproperties;
        this.priorityLevels = priorityLevels;
        this.serviceURI = serviceURI;
        this.brokerURI = brokerURI;
        this.brokerProviderObjInstId = brokerProviderObjInstId;
    }

    /**
     * Constructor that initialises the non-nullable values of the structure. 
     * 
     * @param supportedLevels The set of possible QoS levels this service can 
     * provide. 
     * @param QoSproperties Any QoS properties relevant to this address URIs and 
     * the specified transport. 
     * @param priorityLevels The number of QoS priority levels that this provider 
     * supports. 
     */
    public AddressDetails(org.ccsds.moims.mo.mal.structures.QoSLevelList supportedLevels,
            org.ccsds.moims.mo.mal.structures.NamedValueList QoSproperties,
            org.ccsds.moims.mo.mal.structures.UInteger priorityLevels) {
        this.supportedLevels = supportedLevels;
        this.QoSproperties = QoSproperties;
        this.priorityLevels = priorityLevels;
        this.serviceURI = null;
        this.brokerURI = null;
        this.brokerProviderObjInstId = null;
    }

    /**
     * Creates an instance of this type using the default constructor. It is a 
     * generic factory method. 
     * 
     * @return A new instance of this type with default field values.
     */
    public org.ccsds.moims.mo.mal.structures.Element createElement() {
        return new org.ccsds.moims.mo.common.directory.structures.AddressDetails();
    }

    /**
     * Returns the field supportedLevels.
     * 
     * @return The field supportedLevels.
     */
    public org.ccsds.moims.mo.mal.structures.QoSLevelList getSupportedLevels() {
        return supportedLevels;
    }

    /**
     * Sets the field supportedLevels.
     * 
     * @param __newValue The new value.
     */
    @Deprecated
    public void setSupportedLevels(org.ccsds.moims.mo.mal.structures.QoSLevelList __newValue) {
        supportedLevels = __newValue;
    }

    /**
     * Returns the field QoSproperties.
     * 
     * @return The field QoSproperties.
     */
    public org.ccsds.moims.mo.mal.structures.NamedValueList getQoSproperties() {
        return QoSproperties;
    }

    /**
     * Sets the field QoSproperties.
     * 
     * @param __newValue The new value.
     */
    @Deprecated
    public void setQoSproperties(org.ccsds.moims.mo.mal.structures.NamedValueList __newValue) {
        QoSproperties = __newValue;
    }

    /**
     * Returns the field priorityLevels.
     * 
     * @return The field priorityLevels.
     */
    public org.ccsds.moims.mo.mal.structures.UInteger getPriorityLevels() {
        return priorityLevels;
    }

    /**
     * Sets the field priorityLevels.
     * 
     * @param __newValue The new value.
     */
    @Deprecated
    public void setPriorityLevels(org.ccsds.moims.mo.mal.structures.UInteger __newValue) {
        priorityLevels = __newValue;
    }

    /**
     * Returns the field serviceURI.
     * 
     * @return The field serviceURI.
     */
    public org.ccsds.moims.mo.mal.structures.URI getServiceURI() {
        return serviceURI;
    }

    /**
     * Sets the field serviceURI.
     * 
     * @param __newValue The new value.
     */
    @Deprecated
    public void setServiceURI(org.ccsds.moims.mo.mal.structures.URI __newValue) {
        serviceURI = __newValue;
    }

    /**
     * Returns the field brokerURI.
     * 
     * @return The field brokerURI.
     */
    public org.ccsds.moims.mo.mal.structures.URI getBrokerURI() {
        return brokerURI;
    }

    /**
     * Sets the field brokerURI.
     * 
     * @param __newValue The new value.
     */
    @Deprecated
    public void setBrokerURI(org.ccsds.moims.mo.mal.structures.URI __newValue) {
        brokerURI = __newValue;
    }

    /**
     * Returns the field brokerProviderObjInstId.
     * 
     * @return The field brokerProviderObjInstId.
     */
    public Long getBrokerProviderObjInstId() {
        return brokerProviderObjInstId;
    }

    /**
     * Sets the field brokerProviderObjInstId.
     * 
     * @param __newValue The new value.
     */
    @Deprecated
    public void setBrokerProviderObjInstId(Long __newValue) {
        brokerProviderObjInstId = __newValue;
    }

    /**
     * Compares this object to the specified object. The result is true if and 
     * only if the argument is not null and is the same type that contains the 
     * same value as this object. 
     * 
     * @param obj The object to compare with.
     * @return true if the objects are the same; false otherwise.
     */
    public boolean equals(Object obj) {
        if (obj instanceof AddressDetails) {
            AddressDetails other = (AddressDetails) obj;
            if (supportedLevels == null) {
                if (other.supportedLevels != null) {
                    return false;
                }
            } else {
                if (! supportedLevels.equals(other.supportedLevels)) {
                    return false;
                }
            }
            if (QoSproperties == null) {
                if (other.QoSproperties != null) {
                    return false;
                }
            } else {
                if (! QoSproperties.equals(other.QoSproperties)) {
                    return false;
                }
            }
            if (priorityLevels == null) {
                if (other.priorityLevels != null) {
                    return false;
                }
            } else {
                if (! priorityLevels.equals(other.priorityLevels)) {
                    return false;
                }
            }
            if (serviceURI == null) {
                if (other.serviceURI != null) {
                    return false;
                }
            } else {
                if (! serviceURI.equals(other.serviceURI)) {
                    return false;
                }
            }
            if (brokerURI == null) {
                if (other.brokerURI != null) {
                    return false;
                }
            } else {
                if (! brokerURI.equals(other.brokerURI)) {
                    return false;
                }
            }
            if (brokerProviderObjInstId == null) {
                if (other.brokerProviderObjInstId != null) {
                    return false;
                }
            } else {
                if (! brokerProviderObjInstId.equals(other.brokerProviderObjInstId)) {
                    return false;
                }
            }
            return true;
        }
        return false;
    }

    /**
     * Returns a hash code for this object.
     * 
     * @return a hash code value for this object.
     */
    public int hashCode() {
        int hash = 7;
        hash = 83 * hash + (supportedLevels != null ? supportedLevels.hashCode() : 0);
        hash = 83 * hash + (QoSproperties != null ? QoSproperties.hashCode() : 0);
        hash = 83 * hash + (priorityLevels != null ? priorityLevels.hashCode() : 0);
        hash = 83 * hash + (serviceURI != null ? serviceURI.hashCode() : 0);
        hash = 83 * hash + (brokerURI != null ? brokerURI.hashCode() : 0);
        hash = 83 * hash + (brokerProviderObjInstId != null ? brokerProviderObjInstId.hashCode() : 0);
        return hash;
    }

    /**
     * Returns a String object representing this type"s value.
     * 
     * @return a string representation of the value of this object.
     */
    public String toString() {
        StringBuilder buf = new StringBuilder();
        buf.append("(AddressDetails: ");
        buf.append("supportedLevels=");
        buf.append(supportedLevels);
        buf.append(", QoSproperties=");
        buf.append(QoSproperties);
        buf.append(", priorityLevels=");
        buf.append(priorityLevels);
        buf.append(", serviceURI=");
        buf.append(serviceURI);
        buf.append(", brokerURI=");
        buf.append(brokerURI);
        buf.append(", brokerProviderObjInstId=");
        buf.append(brokerProviderObjInstId);
        buf.append(')');
        return buf.toString();
    }

    /**
     * Encodes the value of this object using the provided MALEncoder.
     * 
     * @param encoder The encoder to use for encoding.
     * @throws org.ccsds.moims.mo.mal.MALException if any encoding errors are 
     * detected. 
     */
    public void encode(org.ccsds.moims.mo.mal.MALEncoder encoder) throws org.ccsds.moims.mo.mal.MALException {
        if (supportedLevels == null) {
            throw new org.ccsds.moims.mo.mal.MALException("The field 'supportedLevels' cannot be null!");
        }
        if (QoSproperties == null) {
            throw new org.ccsds.moims.mo.mal.MALException("The field 'QoSproperties' cannot be null!");
        }
        if (priorityLevels == null) {
            throw new org.ccsds.moims.mo.mal.MALException("The field 'priorityLevels' cannot be null!");
        }
        encoder.encodeElement(supportedLevels);
        encoder.encodeElement(QoSproperties);
        encoder.encodeUInteger(priorityLevels);
        encoder.encodeNullableURI(serviceURI);
        encoder.encodeNullableURI(brokerURI);
        encoder.encodeNullableLong(brokerProviderObjInstId);
    }

    /**
     * Decodes the value of this object using the provided MALDecoder.
     * 
     * @param decoder The decoder to use for decoding.
     * @return Returns this object.
     * @throws org.ccsds.moims.mo.mal.MALException if any decoding errors are 
     * detected. 
     */
    public org.ccsds.moims.mo.mal.structures.Element decode(org.ccsds.moims.mo.mal.MALDecoder decoder) throws org.ccsds.moims.mo.mal.MALException {
        supportedLevels = (org.ccsds.moims.mo.mal.structures.QoSLevelList) decoder.decodeElement(new org.ccsds.moims.mo.mal.structures.QoSLevelList());
        QoSproperties = (org.ccsds.moims.mo.mal.structures.NamedValueList) decoder.decodeElement(new org.ccsds.moims.mo.mal.structures.NamedValueList());
        priorityLevels = decoder.decodeUInteger();
        serviceURI = decoder.decodeNullableURI();
        brokerURI = decoder.decodeNullableURI();
        brokerProviderObjInstId = decoder.decodeNullableLong();
        return this;
    }

    /**
     * Returns the absolute short form of this type.
     * 
     * @return The absolute short form of this type.
     */
    public Long getShortForm() {
        return SHORT_FORM;
    }

    /**
     * Returns the type short form of this type which is unique to the area/service 
     * it is defined in but not unique across all types. 
     * 
     * @return The type short form of this type.
     */
    public Integer getTypeShortForm() {
        return TYPE_SHORT_FORM;
    }

    /**
     * Returns the area number of this type.
     * 
     * @return The area number of this type.
     */
    public org.ccsds.moims.mo.mal.structures.UShort getAreaNumber() {
        return org.ccsds.moims.mo.common.CommonHelper.COMMON_AREA_NUMBER;
    }

    /**
     * Returns the area version of this type.
     * 
     * @return The area number of this type.
     */
    public org.ccsds.moims.mo.mal.structures.UOctet getAreaVersion() {
        return org.ccsds.moims.mo.common.CommonHelper.COMMON_AREA_VERSION;
    }

    /**
     * Returns the service number of this type.
     * 
     * @return The service number of this type.
     */
    public org.ccsds.moims.mo.mal.structures.UShort getServiceNumber() {
        return org.ccsds.moims.mo.common.directory.DirectoryServiceInfo.DIRECTORY_SERVICE_NUMBER;
    }

    /**
     * Returns the TypeId of this element.
     * 
     * @return The TypeId of this element.
     */
    public org.ccsds.moims.mo.mal.TypeId getTypeId() {
        return TYPE_ID;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy