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

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

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

/**
 * The ServiceFilter structure holds all information required by the Directory 
 * service for service lookup operation. The field filters are AND"d 
 * together. 
 */
public final class ServiceFilter implements org.ccsds.moims.mo.mal.structures.Composite {

    /**
     * Short form for type.
     */
    @Deprecated
    private static final Integer TYPE_SHORT_FORM = 7;
    /**
     * Absolute short form for type. This will be replaced by the TypeId.
     */
    @Deprecated
    public static final Long SHORT_FORM = 844429241876487L;
    private static final long serialVersionUID = 844429241876487L;
    /**
     * 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 required service provider. Can be NULL in which case matches all values. 
     */
    private org.ccsds.moims.mo.mal.structures.Identifier serviceProviderId;

    /**
     * The domain to query. Can be NULL in which case matches all values.
     */
    private org.ccsds.moims.mo.mal.structures.IdentifierList domain;

    /**
     * The network to match. Can be NULL in which case matches all values.
     */
    private org.ccsds.moims.mo.mal.structures.Identifier network;

    /**
     * The session type to match. Can be NULL in which case matches all values. 
     */
    private org.ccsds.moims.mo.mal.structures.SessionType sessionType;

    /**
     * The session name to match. Can be NULL in which case matches all values. 
     */
    private org.ccsds.moims.mo.mal.structures.Identifier sessionName;

    /**
     * The service to filter on, values can be NULL which matches all values. 
     */
    private org.ccsds.moims.mo.common.structures.ServiceKey serviceKey;

    /**
     * List of required capability sets. If NULL then matches any.
     */
    private org.ccsds.moims.mo.mal.structures.UShortList requiredCapabilitySets;

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

    /**
     * Constructor that initialises the values of the structure.
     * 
     * @param serviceProviderId The required service provider. Can be NULL in 
     * which case matches all values. 
     * @param domain The domain to query. Can be NULL in which case matches all 
     * values. 
     * @param network The network to match. Can be NULL in which case matches 
     * all values. 
     * @param sessionType The session type to match. Can be NULL in which case 
     * matches all values. 
     * @param sessionName The session name to match. Can be NULL in which case 
     * matches all values. 
     * @param serviceKey The service to filter on, values can be NULL which matches 
     * all values. 
     * @param requiredCapabilitySets List of required capability sets. If NULL 
     * then matches any. 
     */
    public ServiceFilter(org.ccsds.moims.mo.mal.structures.Identifier serviceProviderId,
            org.ccsds.moims.mo.mal.structures.IdentifierList domain,
            org.ccsds.moims.mo.mal.structures.Identifier network,
            org.ccsds.moims.mo.mal.structures.SessionType sessionType,
            org.ccsds.moims.mo.mal.structures.Identifier sessionName,
            org.ccsds.moims.mo.common.structures.ServiceKey serviceKey,
            org.ccsds.moims.mo.mal.structures.UShortList requiredCapabilitySets) {
        this.serviceProviderId = serviceProviderId;
        this.domain = domain;
        this.network = network;
        this.sessionType = sessionType;
        this.sessionName = sessionName;
        this.serviceKey = serviceKey;
        this.requiredCapabilitySets = requiredCapabilitySets;
    }

    /**
     * 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.ServiceFilter();
    }

    /**
     * Returns the field serviceProviderId.
     * 
     * @return The field serviceProviderId.
     */
    public org.ccsds.moims.mo.mal.structures.Identifier getServiceProviderId() {
        return serviceProviderId;
    }

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

    /**
     * Returns the field domain.
     * 
     * @return The field domain.
     */
    public org.ccsds.moims.mo.mal.structures.IdentifierList getDomain() {
        return domain;
    }

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

    /**
     * Returns the field network.
     * 
     * @return The field network.
     */
    public org.ccsds.moims.mo.mal.structures.Identifier getNetwork() {
        return network;
    }

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

    /**
     * Returns the field sessionType.
     * 
     * @return The field sessionType.
     */
    public org.ccsds.moims.mo.mal.structures.SessionType getSessionType() {
        return sessionType;
    }

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

    /**
     * Returns the field sessionName.
     * 
     * @return The field sessionName.
     */
    public org.ccsds.moims.mo.mal.structures.Identifier getSessionName() {
        return sessionName;
    }

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

    /**
     * Returns the field serviceKey.
     * 
     * @return The field serviceKey.
     */
    public org.ccsds.moims.mo.common.structures.ServiceKey getServiceKey() {
        return serviceKey;
    }

    /**
     * Sets the field serviceKey.
     * 
     * @param __newValue The new value.
     */
    @Deprecated
    public void setServiceKey(org.ccsds.moims.mo.common.structures.ServiceKey __newValue) {
        serviceKey = __newValue;
    }

    /**
     * Returns the field requiredCapabilitySets.
     * 
     * @return The field requiredCapabilitySets.
     */
    public org.ccsds.moims.mo.mal.structures.UShortList getRequiredCapabilitySets() {
        return requiredCapabilitySets;
    }

    /**
     * Sets the field requiredCapabilitySets.
     * 
     * @param __newValue The new value.
     */
    @Deprecated
    public void setRequiredCapabilitySets(org.ccsds.moims.mo.mal.structures.UShortList __newValue) {
        requiredCapabilitySets = __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 ServiceFilter) {
            ServiceFilter other = (ServiceFilter) obj;
            if (serviceProviderId == null) {
                if (other.serviceProviderId != null) {
                    return false;
                }
            } else {
                if (! serviceProviderId.equals(other.serviceProviderId)) {
                    return false;
                }
            }
            if (domain == null) {
                if (other.domain != null) {
                    return false;
                }
            } else {
                if (! domain.equals(other.domain)) {
                    return false;
                }
            }
            if (network == null) {
                if (other.network != null) {
                    return false;
                }
            } else {
                if (! network.equals(other.network)) {
                    return false;
                }
            }
            if (sessionType == null) {
                if (other.sessionType != null) {
                    return false;
                }
            } else {
                if (! sessionType.equals(other.sessionType)) {
                    return false;
                }
            }
            if (sessionName == null) {
                if (other.sessionName != null) {
                    return false;
                }
            } else {
                if (! sessionName.equals(other.sessionName)) {
                    return false;
                }
            }
            if (serviceKey == null) {
                if (other.serviceKey != null) {
                    return false;
                }
            } else {
                if (! serviceKey.equals(other.serviceKey)) {
                    return false;
                }
            }
            if (requiredCapabilitySets == null) {
                if (other.requiredCapabilitySets != null) {
                    return false;
                }
            } else {
                if (! requiredCapabilitySets.equals(other.requiredCapabilitySets)) {
                    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 + (serviceProviderId != null ? serviceProviderId.hashCode() : 0);
        hash = 83 * hash + (domain != null ? domain.hashCode() : 0);
        hash = 83 * hash + (network != null ? network.hashCode() : 0);
        hash = 83 * hash + (sessionType != null ? sessionType.hashCode() : 0);
        hash = 83 * hash + (sessionName != null ? sessionName.hashCode() : 0);
        hash = 83 * hash + (serviceKey != null ? serviceKey.hashCode() : 0);
        hash = 83 * hash + (requiredCapabilitySets != null ? requiredCapabilitySets.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("(ServiceFilter: ");
        buf.append("serviceProviderId=");
        buf.append(serviceProviderId);
        buf.append(", domain=");
        buf.append(domain);
        buf.append(", network=");
        buf.append(network);
        buf.append(", sessionType=");
        buf.append(sessionType);
        buf.append(", sessionName=");
        buf.append(sessionName);
        buf.append(", serviceKey=");
        buf.append(serviceKey);
        buf.append(", requiredCapabilitySets=");
        buf.append(requiredCapabilitySets);
        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 {
        encoder.encodeNullableIdentifier(serviceProviderId);
        encoder.encodeNullableElement(domain);
        encoder.encodeNullableIdentifier(network);
        encoder.encodeNullableElement(sessionType);
        encoder.encodeNullableIdentifier(sessionName);
        encoder.encodeNullableElement(serviceKey);
        encoder.encodeNullableElement(requiredCapabilitySets);
    }

    /**
     * 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 {
        serviceProviderId = decoder.decodeNullableIdentifier();
        domain = (org.ccsds.moims.mo.mal.structures.IdentifierList) decoder.decodeNullableElement(new org.ccsds.moims.mo.mal.structures.IdentifierList());
        network = decoder.decodeNullableIdentifier();
        sessionType = (org.ccsds.moims.mo.mal.structures.SessionType) decoder.decodeNullableElement(org.ccsds.moims.mo.mal.structures.SessionType.LIVE);
        sessionName = decoder.decodeNullableIdentifier();
        serviceKey = (org.ccsds.moims.mo.common.structures.ServiceKey) decoder.decodeNullableElement(new org.ccsds.moims.mo.common.structures.ServiceKey());
        requiredCapabilitySets = (org.ccsds.moims.mo.mal.structures.UShortList) decoder.decodeNullableElement(new org.ccsds.moims.mo.mal.structures.UShortList());
        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