Class RemoteAddeEntry
java.lang.Object
edu.wisc.ssec.mcidasv.servermanager.RemoteAddeEntry
- All Implemented Interfaces:
AddeEntry
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSomething of a hack... this approach allows us to build aRemoteAddeEntryin a readable way, despite there being multiplefinalfields.Nested classes/interfaces inherited from interface edu.wisc.ssec.mcidasv.servermanager.AddeEntry
AddeEntry.EditorAction, AddeEntry.EntrySource, AddeEntry.EntryStatus, AddeEntry.EntryType, AddeEntry.EntryValidity -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AddeAccountHolds the accounting information for this entry.static final intDefault port for remote ADDE servers.private final StringThe server "address" of this entry.private Stringprivate StringAllows the user to refer to this entry with an arbitrary name.private AddeEntry.EntrySourceWhere this entry came from.private AddeEntry.EntryStatusWhether or not this entry is in the "active set".private AddeEntry.EntryTypeThis entry's type.private AddeEntry.EntryValidityWhether or not this entry is valid.private final StringThe "dataset" of this entry.private intUsed so that the hashCode of this entry is not needlessly recalculated.static final List<RemoteAddeEntry> Represents a collection of invalid remote ADDE entries.static final RemoteAddeEntryRepresents an invalid remote ADDE entry.private final booleanWhether or not this entry will persist between McIDAS-V sessions.private static final org.slf4j.LoggerTypical logger object.private static final StringString.format(String, Object...)-friendly string for building a request to read a server's "PUBLIC.SRV".Fields inherited from interface edu.wisc.ssec.mcidasv.servermanager.AddeEntry
DEFAULT_ACCOUNT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateRemoteAddeEntry(RemoteAddeEntry.Builder builder) Creates a new ADDE entry using a give "ADDE entry builder". -
Method Summary
Modifier and TypeMethodDescriptionCurrently used as a identifier for convenient storage by the server manager.static RemoteEntryEditor.AddeStatuscheckEntry(boolean checkHost, RemoteAddeEntry entry) Attempts to verify whether or not the information in a given RemoteAddeEntry represents a valid remote ADDE server.static RemoteEntryEditor.AddeStatuscheckEntry(RemoteAddeEntry entry) Attempts to verify whether or not the information in a given RemoteAddeEntry represents a valid remote ADDE server.checkEntryTypes(String host, String group) Determine the types of ADDE data within the givengrouponhost.checkEntryTypes(String host, String group, String user, String proj) Determine the types of ADDE data within the givengrouponhost.static booleancheckHost(RemoteAddeEntry entry) Determines whether or not the server specified inentryis listening on port 112.booleanDetermines whether or not the given object is equivalent to this ADDE entry.Accounting information associated with the current entry.Address of the server associated with the current entry.Source that specified this entry.GUI status of the entry.HandyStringrepresentation of this ADDE entry.Type of chooser this entry should appear under.Does this entry represent a "valid" ADDE server.getGroup()Dataset/group located on the server.getName()Name associated with this entry.inthashCode()Returns a hash code for this ADDE entry.booleanDetermine whether or not this entry will be saved between application sessions.readGroups(String host, String user, String proj) Attempts to determine which (if any) ADDE groups are available on the givenhost.readPublicGroups(RemoteAddeEntry entry) Tries to connect to a givenRemoteAddeEntryand read the list of ADDE "groups" available to the public.readPublicGroups(String host) Attempts to determine the "public" ADDE groups available on the givenhost.voidsetEntryAlias(String newAlias) voidsetEntryStatus(AddeEntry.EntryStatus newStatus) voidsetEntryValidity(AddeEntry.EntryValidity entryValidity) toString()String representation of this entry.
-
Field Details
-
logger
Typical logger object. -
INVALID_ENTRY
Represents an invalid remote ADDE entry. -
INVALID_ENTRIES
Represents a collection of invalid remote ADDE entries. -
ADDE_PORT
Default port for remote ADDE servers.- See Also:
-
publicSrvFormat
String.format(String, Object...)-friendly string for building a request to read a server's "PUBLIC.SRV".- See Also:
-
account
Holds the accounting information for this entry. -
address
The server "address" of this entry. -
group
The "dataset" of this entry. -
isTemporary
Whether or not this entry will persist between McIDAS-V sessions. -
entryType
This entry's type. -
entryValidity
Whether or not this entry is valid. -
entrySource
Where this entry came from. -
entryStatus
Whether or not this entry is in the "active set". -
entryAlias
Allows the user to refer to this entry with an arbitrary name. -
asStringId
-
hashCode
Used so that the hashCode of this entry is not needlessly recalculated.- See Also:
-
-
Constructor Details
-
RemoteAddeEntry
Creates a new ADDE entry using a give "ADDE entry builder".- Parameters:
builder- Object used to build this entry.
-
-
Method Details
-
getAddress
Description copied from interface:AddeEntryAddress of the server associated with the current entry.LocalAddeEntrieswill returnlocalhost.- Specified by:
getAddressin interfaceAddeEntry- Returns:
address
-
getGroup
Description copied from interface:AddeEntryDataset/group located on the server. -
getName
Description copied from interface:AddeEntryName associated with this entry. -
getAccount
Description copied from interface:AddeEntryAccounting information associated with the current entry. If the server does not require accounting information, this method returnsAddeEntry.DEFAULT_ACCOUNT.- Specified by:
getAccountin interfaceAddeEntry- Returns:
account
-
getEntryType
Description copied from interface:AddeEntryType of chooser this entry should appear under.- Specified by:
getEntryTypein interfaceAddeEntry- Returns:
entryType
-
getEntryValidity
Description copied from interface:AddeEntryDoes this entry represent a "valid" ADDE server.- Specified by:
getEntryValidityin interfaceAddeEntry- Returns:
entryValidity
-
setEntryValidity
-
getEntrySource
Description copied from interface:AddeEntrySource 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:
getEntrySourcein interfaceAddeEntry- Returns:
entrySource
-
getEntryStatus
Description copied from interface:AddeEntryGUI status of the entry. Differs fromAddeEntry.EntryValidityin thatEntryStatuscontrols 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:
getEntryStatusin interfaceAddeEntry- Returns:
entryStatus
-
setEntryStatus
- Specified by:
setEntryStatusin interfaceAddeEntry
-
getEntryAlias
- Specified by:
getEntryAliasin interfaceAddeEntry
-
setEntryAlias
- Specified by:
setEntryAliasin interfaceAddeEntry
-
isEntryTemporary
Description copied from interface:AddeEntryDetermine whether or not this entry will be saved between application sessions.- Specified by:
isEntryTemporaryin interfaceAddeEntry- Returns:
- Whether or not this entry is saved for subsequent sessions.
-
getEntryText
HandyStringrepresentation of this ADDE entry. Currently looks likeADDRESS/GROUP, but this is subject to change.- Specified by:
getEntryTextin interfaceAddeEntry- Returns:
- Alternate
Stringrepresentation of this entry.
-
equals
Determines whether or not the given object is equivalent to this ADDE entry. -
hashCode
-
asStringId
Description copied from interface:AddeEntryCurrently used as a identifier for convenient storage by the server manager.- Specified by:
asStringIdin interfaceAddeEntry- Returns:
- Identifier for this entry.
-
toString
Description copied from interface:AddeEntryString representation of this entry.Output will typically contain internal details and as such will differ from
AddeEntry.getEntryText(). -
readPublicGroups
Tries to connect to a givenRemoteAddeEntryand read the list of ADDE "groups" available to the public.- Parameters:
entry- TheRemoteAddeEntryto query. Cannot benull.- Returns:
Setof public groups onentry.- Throws:
NullPointerException- ifentryisnull.IllegalArgumentException- if the server address is an emptyString.
-
checkHost
Determines whether or not the server specified inentryis listening on port 112.- Parameters:
entry- Descriptor containing the server to check.- Returns:
trueif a connection was opened,falseotherwise.- Throws:
NullPointerException- ifentryis null.
-
checkEntry
Attempts to verify whether or not the information in a given RemoteAddeEntry represents a valid remote ADDE server. If not, the method tries to determine which parts of the entry are invalid.Note that this method uses
checkHost(RemoteAddeEntry)to verify that the server is listening. To forego the check, simply callcheckEntry(false, entry).- Parameters:
entry-RemoteAddeEntryto check. Cannot benull.- Returns:
- The
RemoteEntryEditor.AddeStatusthat represents the verification status ofentry. - See Also:
-
checkEntry
Attempts to verify whether or not the information in a given RemoteAddeEntry represents a valid remote ADDE server. If not, the method tries to determine which parts of the entry are invalid.- Parameters:
checkHost-truetries to connect to the remote ADDE server before doing anything else.entry-RemoteAddeEntryto check. Cannot benull.- Returns:
- The
RemoteEntryEditor.AddeStatusthat represents the verification status ofentry. - Throws:
NullPointerException- ifentryisnull.- See Also:
-
checkEntryTypes
public static Map<AddeEntry.EntryType,RemoteEntryEditor.AddeStatus> checkEntryTypes(String host, String group) Determine the types of ADDE data within the givengrouponhost. This method uses the "default" ADDE user name and project number.Note: parameters cannot be
null.- Parameters:
host- Host to check.group- ADDE group.- Returns:
EnumMapthat maps ADDE data type to whether or not it is available for the givenhostandgroup.
-
checkEntryTypes
public static Map<AddeEntry.EntryType,RemoteEntryEditor.AddeStatus> checkEntryTypes(String host, String group, String user, String proj) Determine the types of ADDE data within the givengrouponhost.Note: parameters cannot be
null.- Parameters:
host- Host to check.group- ADDE group.user- ADDE user name.proj- ADDE project number.- Returns:
EnumMapthat maps ADDE data type to whether or not it is available for the given set of parameters.- See Also:
-
readPublicGroups
Attempts to determine the "public" ADDE groups available on the givenhost.Note: this method uses the "default" ADDE user name and project number.
- Parameters:
host- Host from which public groups are to be read. Cannot benull.- Returns:
Setof the public groups onhost. TheSetwill be empty if there are no groups.
-
readGroups
Attempts to determine which (if any) ADDE groups are available on the givenhost.Note: parameters cannot be
null.- Parameters:
host- Host from which public groups are to be read.user- ADDE user name.proj- ADDE project number.- Returns:
Setof the groups onhost. TheSetwill be empty if there are no groups.
-