edu.wisc.ssec.mcidasv.servermanager
Class LocalAddeEntry

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.servermanager.LocalAddeEntry
All Implemented Interfaces:
AddeEntry

public class LocalAddeEntry
extends Object
implements AddeEntry


Nested Class Summary
static class LocalAddeEntry.AddeFormat
          The various kinds of local ADDE data understood by McIDAS-V, along with some helpful metadata.
static class LocalAddeEntry.Builder
          A builder of (mostly) immutable LocalAddeEntry instances.
static class LocalAddeEntry.ServerName
           
 
Nested classes/interfaces inherited from interface edu.wisc.ssec.mcidasv.servermanager.AddeEntry
AddeEntry.EditorAction, AddeEntry.EntrySource, AddeEntry.EntryStatus, AddeEntry.EntryType, AddeEntry.EntryValidity
 
Field Summary
private  String asStringId
           
private static String CYGWIN_PREFIX
           
private static int CYGWIN_PREFIX_LEN
           
private  String descriptor
          N2
private  String end
          R2
private  String entryAlias
           
private  AddeEntry.EntryStatus entryStatus
           
private  String fileMask
          MASK
private  LocalAddeEntry.AddeFormat format
          MCV
private  String group
          N1
static List<LocalAddeEntry> INVALID_ENTRIES
          Represents a "bad" collection of local ADDE entries.
static LocalAddeEntry INVALID_ENTRY
          Represents a "bad" local ADDE entry.
private  boolean isTemporary
           
(package private) static org.slf4j.Logger logger
          Friendly neighborhood logging object.
private  String name
          C
private  boolean realtime
          RT
private  String start
          R1
 
Fields inherited from interface edu.wisc.ssec.mcidasv.servermanager.AddeEntry
DEFAULT_ACCOUNT
 
Constructor Summary
private LocalAddeEntry(LocalAddeEntry.Builder builder)
           
 
Method Summary
 String asStringId()
          Currently used as a identifier for convenient storage by the server manager.
 boolean equals(Object obj)
          Checks a given object for equality with the current LocalAddeEntry instance.
static int generateHashCode(LocalAddeEntry entry)
           
static int generateHashCode(String name, String group, String fileMask, String entryAlias, boolean isTemporary, LocalAddeEntry.AddeFormat format)
           
 AddeAccount getAccount()
          Accounting information associated with the current entry.
 String getAddress()
          Address of the server associated with the current entry.
 String getDescriptor()
          Gets the ADDE descriptor for the current local ADDE entry.
 String getEnd()
          Gets the ending number of the current local ADDE dataset.
 String getEntryAlias()
           
 AddeEntry.EntrySource getEntrySource()
          Source that specified this entry.
 AddeEntry.EntryStatus getEntryStatus()
          GUI status of the entry.
 String getEntryText()
          Handy String representation of this ADDE entry.
 AddeEntry.EntryType getEntryType()
          Type of chooser this entry should appear under.
 AddeEntry.EntryValidity getEntryValidity()
          Does this entry represent a "valid" ADDE server.
 String getFileMask()
          Gets the ADDE file mask for the current local ADDE entry.
 LocalAddeEntry.AddeFormat getFormat()
          Gets the ADDE dataset format for the current local ADDE entry.
 String getGroup()
          Dataset/group located on the server.
 String getMask()
          Gets the ADDE file mask for the current local ADDE entry.
 String getName()
          Name associated with this entry.
 boolean getRealtime()
          Gets the ADDE realtime status of the current local ADDE entry.
 String getRealtimeAsString()
          Gets the local ADDE dataset's realtime status as a value suitable for RESOLV.SRV (one of "Y" or "N").
 String getStart()
          Gets the starting number of the current local ADDE dataset.
 int hashCode()
           
 boolean isEntryTemporary()
           
 boolean isValid()
          Tests the current local ADDE dataset for validity.
 void setEntryAlias(String newAlias)
           
 void setEntryStatus(AddeEntry.EntryStatus newStatus)
           
 String toString()
          String representation of this entry.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

static final org.slf4j.Logger logger
Friendly neighborhood logging object.


INVALID_ENTRY

public static final LocalAddeEntry INVALID_ENTRY
Represents a "bad" local ADDE entry.


INVALID_ENTRIES

public static final List<LocalAddeEntry> INVALID_ENTRIES
Represents a "bad" collection of local ADDE entries.


CYGWIN_PREFIX

private static final String CYGWIN_PREFIX
See Also:
Constant Field Values

CYGWIN_PREFIX_LEN

private static final int CYGWIN_PREFIX_LEN

entryStatus

private AddeEntry.EntryStatus entryStatus

group

private final String group
N1


descriptor

private final String descriptor
N2


realtime

private final boolean realtime
RT


format

private final LocalAddeEntry.AddeFormat format
MCV


start

private final String start
R1


end

private final String end
R2


fileMask

private final String fileMask
MASK


name

private final String name
C


asStringId

private String asStringId

isTemporary

private final boolean isTemporary

entryAlias

private String entryAlias
Constructor Detail

LocalAddeEntry

private LocalAddeEntry(LocalAddeEntry.Builder builder)
Parameters:
builder -
See Also:
LocalAddeEntry.Builder
Method Detail

getAccount

public AddeAccount getAccount()
Description copied from interface: AddeEntry
Accounting information associated with the current entry. If the server does not require accounting information, this method returns AddeEntry.DEFAULT_ACCOUNT.

Specified by:
getAccount in interface AddeEntry
Returns:
ADDE account object.

getAddress

public String getAddress()
Description copied from interface: AddeEntry
Address of the server associated with the current entry. LocalAddeEntrys will return localhost.

Specified by:
getAddress in interface AddeEntry

getEntrySource

public AddeEntry.EntrySource getEntrySource()
Description copied from interface: AddeEntry
Source that specified this entry. For example; allows you to distinguish "system" entries (which cannot be removed, only disabled) from entries created by the user (full control).

Specified by:
getEntrySource in interface AddeEntry

getEntryStatus

public AddeEntry.EntryStatus getEntryStatus()
Description copied from interface: AddeEntry
GUI status of the entry. Differs from AddeEntry.EntryValidity in that EntryStatus controls this entry showing up in a chooser and has nothing to do with whether or not the entry is a valid ADDE server.

Specified by:
getEntryStatus in interface AddeEntry

getEntryText

public String getEntryText()
Description copied from interface: AddeEntry
Handy String representation of this ADDE entry. Currently looks like ADDRESS/GROUP, but this is subject to change.

Specified by:
getEntryText in interface AddeEntry

getEntryType

public AddeEntry.EntryType getEntryType()
Description copied from interface: AddeEntry
Type of chooser this entry should appear under.

Specified by:
getEntryType in interface AddeEntry
Returns:
The "type" of data associated with this entry.

getEntryValidity

public AddeEntry.EntryValidity getEntryValidity()
Description copied from interface: AddeEntry
Does this entry represent a "valid" ADDE server.

Specified by:
getEntryValidity in interface AddeEntry
Returns:
Whether or not this entry has been validated.

getEntryAlias

public String getEntryAlias()
Specified by:
getEntryAlias in interface AddeEntry

setEntryAlias

public void setEntryAlias(String newAlias)
Specified by:
setEntryAlias in interface AddeEntry

setEntryStatus

public void setEntryStatus(AddeEntry.EntryStatus newStatus)
Specified by:
setEntryStatus in interface AddeEntry

isEntryTemporary

public boolean isEntryTemporary()
Specified by:
isEntryTemporary in interface AddeEntry

getGroup

public String getGroup()
Description copied from interface: AddeEntry
Dataset/group located on the server.

Specified by:
getGroup in interface AddeEntry

getName

public String getName()
Description copied from interface: AddeEntry
Name associated with this entry.

Specified by:
getName in interface AddeEntry
Returns:
Name associated with this entry.

getDescriptor

public String getDescriptor()
Gets the ADDE descriptor for the current local ADDE entry.

Returns:
ADDE descriptor (corresponds to the "N2" section of a RESOLV.SRV entry).

getFormat

public LocalAddeEntry.AddeFormat getFormat()
Gets the ADDE dataset format for the current local ADDE entry.

Returns:
ADDE format (corresponds to the "MCV" section of a RESOLV.SRV entry).

getMask

public String getMask()
Gets the ADDE file mask for the current local ADDE entry.

Returns:
ADDE file mask (corresponds to the "MASK" section of a RESOLV.SRV entry).

getFileMask

public String getFileMask()
Gets the ADDE file mask for the current local ADDE entry.

Returns:
ADDE file mask (corresponds to the "MASK" section of a RESOLV.SRV entry).

getRealtime

public boolean getRealtime()
Gets the ADDE realtime status of the current local ADDE entry.

Returns:
Whether or not the current dataset is "realtime". Corresponds to the "RT" section of a RESOLV.SRV entry.

getStart

public String getStart()
Gets the starting number of the current local ADDE dataset.

Returns:
Corresponds to the "R1" section of a RESOLV.SRV entry.

getEnd

public String getEnd()
Gets the ending number of the current local ADDE dataset.

Returns:
Corresponds to the "R2" section of a RESOLV.SRV entry.

isValid

public boolean isValid()
Tests the current local ADDE dataset for validity.

Returns:
true iff group and name are not empty.

getRealtimeAsString

public String getRealtimeAsString()
Gets the local ADDE dataset's realtime status as a value suitable for RESOLV.SRV (one of "Y" or "N").

Returns:
RESOLV.SRV-friendly representation of the current realtime status.

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
generateHashCode(String, String, String, String, boolean, AddeFormat)

equals

public boolean equals(Object obj)
Checks a given object for equality with the current LocalAddeEntry instance.

Overrides:
equals in class Object
Parameters:
obj - Object to check. null values allowed.
Returns:
true if obj is "equal" to the current LocalAddeEntry instance.

asStringId

public String asStringId()
Description copied from interface: AddeEntry
Currently used as a identifier for convenient storage by the server manager.

Specified by:
asStringId in interface AddeEntry

toString

public String toString()
Description copied from interface: AddeEntry
String representation of this entry.

Specified by:
toString in interface AddeEntry
Overrides:
toString in class Object

generateHashCode

public static int generateHashCode(LocalAddeEntry entry)

generateHashCode

public static int generateHashCode(String name,
                                   String group,
                                   String fileMask,
                                   String entryAlias,
                                   boolean isTemporary,
                                   LocalAddeEntry.AddeFormat format)