org.ccsds.moims.mo.common.directory.structures.PublishDetails Maven / Gradle / Ivy
package org.ccsds.moims.mo.common.directory.structures;
/**
* The PublishDetails structure holds all the required information to publish
* new service provider details.
*/
public final class PublishDetails implements org.ccsds.moims.mo.mal.structures.Composite {
/**
* Short form for type.
*/
@Deprecated
private static final Integer TYPE_SHORT_FORM = 6;
/**
* Absolute short form for type. This will be replaced by the TypeId.
*/
@Deprecated
public static final Long SHORT_FORM = 844429241876486L;
private static final long serialVersionUID = 844429241876486L;
/**
* 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 unique service provider id; allows multiple service providers of the
* same service type to coexist in the directory service.
*/
private org.ccsds.moims.mo.mal.structures.Identifier providerId;
/**
* The domain of the provider.
*/
private org.ccsds.moims.mo.mal.structures.IdentifierList domain;
/**
* The type of session of the provider.
*/
private org.ccsds.moims.mo.mal.structures.SessionType sessionType;
/**
* If this is part of a replay session, this field holds the session name
* of the source session. NULL otherwise.
*/
private org.ccsds.moims.mo.mal.structures.Identifier sourceSessionName;
/**
* The network of the provider.
*/
private org.ccsds.moims.mo.mal.structures.Identifier network;
/**
* The new service provider details.
*/
private org.ccsds.moims.mo.common.directory.structures.ProviderDetails providerDetails;
/**
* The optional XML files to associate with this provider.
*/
private org.ccsds.moims.mo.mal.structures.FileList serviceXML;
/**
* Default constructor for PublishDetails.
*
*/
public PublishDetails() {
}
/**
* Constructor that initialises the values of the structure.
*
* @param providerId The unique service provider id; allows multiple service
* providers of the same service type to coexist in the directory service.
* @param domain The domain of the provider.
* @param sessionType The type of session of the provider.
* @param sourceSessionName If this is part of a replay session, this field
* holds the session name of the source session. NULL otherwise.
* @param network The network of the provider.
* @param providerDetails The new service provider details.
* @param serviceXML The optional XML files to associate with this provider.
*/
public PublishDetails(org.ccsds.moims.mo.mal.structures.Identifier providerId,
org.ccsds.moims.mo.mal.structures.IdentifierList domain,
org.ccsds.moims.mo.mal.structures.SessionType sessionType,
org.ccsds.moims.mo.mal.structures.Identifier sourceSessionName,
org.ccsds.moims.mo.mal.structures.Identifier network,
org.ccsds.moims.mo.common.directory.structures.ProviderDetails providerDetails,
org.ccsds.moims.mo.mal.structures.FileList serviceXML) {
this.providerId = providerId;
this.domain = domain;
this.sessionType = sessionType;
this.sourceSessionName = sourceSessionName;
this.network = network;
this.providerDetails = providerDetails;
this.serviceXML = serviceXML;
}
/**
* Constructor that initialises the non-nullable values of the structure.
*
* @param providerId The unique service provider id; allows multiple service
* providers of the same service type to coexist in the directory service.
* @param domain The domain of the provider.
* @param sessionType The type of session of the provider.
* @param network The network of the provider.
* @param providerDetails The new service provider details.
*/
public PublishDetails(org.ccsds.moims.mo.mal.structures.Identifier providerId,
org.ccsds.moims.mo.mal.structures.IdentifierList domain,
org.ccsds.moims.mo.mal.structures.SessionType sessionType,
org.ccsds.moims.mo.mal.structures.Identifier network,
org.ccsds.moims.mo.common.directory.structures.ProviderDetails providerDetails) {
this.providerId = providerId;
this.domain = domain;
this.sessionType = sessionType;
this.sourceSessionName = null;
this.network = network;
this.providerDetails = providerDetails;
this.serviceXML = 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.PublishDetails();
}
/**
* Returns the field providerId.
*
* @return The field providerId.
*/
public org.ccsds.moims.mo.mal.structures.Identifier getProviderId() {
return providerId;
}
/**
* Sets the field providerId.
*
* @param __newValue The new value.
*/
@Deprecated
public void setProviderId(org.ccsds.moims.mo.mal.structures.Identifier __newValue) {
providerId = __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 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 sourceSessionName.
*
* @return The field sourceSessionName.
*/
public org.ccsds.moims.mo.mal.structures.Identifier getSourceSessionName() {
return sourceSessionName;
}
/**
* Sets the field sourceSessionName.
*
* @param __newValue The new value.
*/
@Deprecated
public void setSourceSessionName(org.ccsds.moims.mo.mal.structures.Identifier __newValue) {
sourceSessionName = __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 providerDetails.
*
* @return The field providerDetails.
*/
public org.ccsds.moims.mo.common.directory.structures.ProviderDetails getProviderDetails() {
return providerDetails;
}
/**
* Sets the field providerDetails.
*
* @param __newValue The new value.
*/
@Deprecated
public void setProviderDetails(org.ccsds.moims.mo.common.directory.structures.ProviderDetails __newValue) {
providerDetails = __newValue;
}
/**
* Returns the field serviceXML.
*
* @return The field serviceXML.
*/
public org.ccsds.moims.mo.mal.structures.FileList getServiceXML() {
return serviceXML;
}
/**
* Sets the field serviceXML.
*
* @param __newValue The new value.
*/
@Deprecated
public void setServiceXML(org.ccsds.moims.mo.mal.structures.FileList __newValue) {
serviceXML = __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 PublishDetails) {
PublishDetails other = (PublishDetails) obj;
if (providerId == null) {
if (other.providerId != null) {
return false;
}
} else {
if (! providerId.equals(other.providerId)) {
return false;
}
}
if (domain == null) {
if (other.domain != null) {
return false;
}
} else {
if (! domain.equals(other.domain)) {
return false;
}
}
if (sessionType == null) {
if (other.sessionType != null) {
return false;
}
} else {
if (! sessionType.equals(other.sessionType)) {
return false;
}
}
if (sourceSessionName == null) {
if (other.sourceSessionName != null) {
return false;
}
} else {
if (! sourceSessionName.equals(other.sourceSessionName)) {
return false;
}
}
if (network == null) {
if (other.network != null) {
return false;
}
} else {
if (! network.equals(other.network)) {
return false;
}
}
if (providerDetails == null) {
if (other.providerDetails != null) {
return false;
}
} else {
if (! providerDetails.equals(other.providerDetails)) {
return false;
}
}
if (serviceXML == null) {
if (other.serviceXML != null) {
return false;
}
} else {
if (! serviceXML.equals(other.serviceXML)) {
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 + (providerId != null ? providerId.hashCode() : 0);
hash = 83 * hash + (domain != null ? domain.hashCode() : 0);
hash = 83 * hash + (sessionType != null ? sessionType.hashCode() : 0);
hash = 83 * hash + (sourceSessionName != null ? sourceSessionName.hashCode() : 0);
hash = 83 * hash + (network != null ? network.hashCode() : 0);
hash = 83 * hash + (providerDetails != null ? providerDetails.hashCode() : 0);
hash = 83 * hash + (serviceXML != null ? serviceXML.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("(PublishDetails: ");
buf.append("providerId=");
buf.append(providerId);
buf.append(", domain=");
buf.append(domain);
buf.append(", sessionType=");
buf.append(sessionType);
buf.append(", sourceSessionName=");
buf.append(sourceSessionName);
buf.append(", network=");
buf.append(network);
buf.append(", providerDetails=");
buf.append(providerDetails);
buf.append(", serviceXML=");
buf.append(serviceXML);
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 (providerId == null) {
throw new org.ccsds.moims.mo.mal.MALException("The field 'providerId' cannot be null!");
}
if (domain == null) {
throw new org.ccsds.moims.mo.mal.MALException("The field 'domain' cannot be null!");
}
if (sessionType == null) {
throw new org.ccsds.moims.mo.mal.MALException("The field 'sessionType' cannot be null!");
}
if (network == null) {
throw new org.ccsds.moims.mo.mal.MALException("The field 'network' cannot be null!");
}
if (providerDetails == null) {
throw new org.ccsds.moims.mo.mal.MALException("The field 'providerDetails' cannot be null!");
}
encoder.encodeIdentifier(providerId);
encoder.encodeElement(domain);
encoder.encodeElement(sessionType);
encoder.encodeNullableIdentifier(sourceSessionName);
encoder.encodeIdentifier(network);
encoder.encodeElement(providerDetails);
encoder.encodeNullableElement(serviceXML);
}
/**
* 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 {
providerId = decoder.decodeIdentifier();
domain = (org.ccsds.moims.mo.mal.structures.IdentifierList) decoder.decodeElement(new org.ccsds.moims.mo.mal.structures.IdentifierList());
sessionType = (org.ccsds.moims.mo.mal.structures.SessionType) decoder.decodeElement(org.ccsds.moims.mo.mal.structures.SessionType.LIVE);
sourceSessionName = decoder.decodeNullableIdentifier();
network = decoder.decodeIdentifier();
providerDetails = (org.ccsds.moims.mo.common.directory.structures.ProviderDetails) decoder.decodeElement(new org.ccsds.moims.mo.common.directory.structures.ProviderDetails());
serviceXML = (org.ccsds.moims.mo.mal.structures.FileList) decoder.decodeNullableElement(new org.ccsds.moims.mo.mal.structures.FileList());
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;
}
}