Class RemoteAddeEntry
java.lang.Object
edu.wisc.ssec.mcidasv.servermanager.RemoteAddeEntry
- All Implemented Interfaces:
AddeEntry
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Something of a hack... this approach allows us to build aRemoteAddeEntry
in a readable way, despite there being multiplefinal
fields.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 AddeAccount
Holds the accounting information for this entry.static final int
Default port for remote ADDE servers.private final String
The server "address" of this entry.private String
private String
Allows the user to refer to this entry with an arbitrary name.private AddeEntry.EntrySource
Where this entry came from.private AddeEntry.EntryStatus
Whether or not this entry is in the "active set".private AddeEntry.EntryType
This entry's type.private AddeEntry.EntryValidity
Whether or not this entry is valid.private final String
The "dataset" of this entry.private int
Used 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 RemoteAddeEntry
Represents an invalid remote ADDE entry.private final boolean
Whether or not this entry will persist between McIDAS-V sessions.private static final org.slf4j.Logger
Typical logger object.private static final String
String.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
ConstructorsModifierConstructorDescriptionprivate
RemoteAddeEntry
(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.AddeStatus
checkEntry
(boolean checkHost, RemoteAddeEntry entry) Attempts to verify whether or not the information in a given RemoteAddeEntry represents a valid remote ADDE server.static RemoteEntryEditor.AddeStatus
checkEntry
(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 givengroup
onhost
.checkEntryTypes
(String host, String group, String user, String proj) Determine the types of ADDE data within the givengroup
onhost
.static boolean
checkHost
(RemoteAddeEntry entry) Determines whether or not the server specified inentry
is listening on port 112.boolean
Determines 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.HandyString
representation 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.int
hashCode()
Returns a hash code for this ADDE entry.boolean
Determine 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 givenRemoteAddeEntry
and read the list of ADDE "groups" available to the public.readPublicGroups
(String host) Attempts to determine the "public" ADDE groups available on the givenhost
.void
setEntryAlias
(String newAlias) void
setEntryStatus
(AddeEntry.EntryStatus newStatus) void
setEntryValidity
(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:AddeEntry
Address of the server associated with the current entry.LocalAddeEntries
will returnlocalhost
.- Specified by:
getAddress
in interfaceAddeEntry
- Returns:
address
-
getGroup
Description copied from interface:AddeEntry
Dataset/group located on the server. -
getName
Description copied from interface:AddeEntry
Name associated with this entry. -
getAccount
Description copied from interface:AddeEntry
Accounting information associated with the current entry. If the server does not require accounting information, this method returnsAddeEntry.DEFAULT_ACCOUNT
.- Specified by:
getAccount
in interfaceAddeEntry
- Returns:
account
-
getEntryType
Description copied from interface:AddeEntry
Type of chooser this entry should appear under.- Specified by:
getEntryType
in interfaceAddeEntry
- Returns:
entryType
-
getEntryValidity
Description copied from interface:AddeEntry
Does this entry represent a "valid" ADDE server.- Specified by:
getEntryValidity
in interfaceAddeEntry
- Returns:
entryValidity
-
setEntryValidity
-
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 interfaceAddeEntry
- Returns:
entrySource
-
getEntryStatus
Description copied from interface:AddeEntry
GUI status of the entry. Differs fromAddeEntry.EntryValidity
in thatEntryStatus
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 interfaceAddeEntry
- Returns:
entryStatus
-
setEntryStatus
- Specified by:
setEntryStatus
in interfaceAddeEntry
-
getEntryAlias
- Specified by:
getEntryAlias
in interfaceAddeEntry
-
setEntryAlias
- Specified by:
setEntryAlias
in interfaceAddeEntry
-
isEntryTemporary
Description copied from interface:AddeEntry
Determine whether or not this entry will be saved between application sessions.- Specified by:
isEntryTemporary
in interfaceAddeEntry
- Returns:
- Whether or not this entry is saved for subsequent sessions.
-
getEntryText
HandyString
representation of this ADDE entry. Currently looks likeADDRESS/GROUP
, but this is subject to change.- Specified by:
getEntryText
in interfaceAddeEntry
- Returns:
- Alternate
String
representation of this entry.
-
equals
Determines whether or not the given object is equivalent to this ADDE entry. -
hashCode
-
asStringId
Description copied from interface:AddeEntry
Currently used as a identifier for convenient storage by the server manager.- Specified by:
asStringId
in interfaceAddeEntry
- Returns:
- Identifier for this entry.
-
toString
Description copied from interface:AddeEntry
String representation of this entry.Output will typically contain internal details and as such will differ from
AddeEntry.getEntryText()
. -
readPublicGroups
Tries to connect to a givenRemoteAddeEntry
and read the list of ADDE "groups" available to the public.- Parameters:
entry
- TheRemoteAddeEntry
to query. Cannot benull
.- Returns:
Set
of public groups onentry
.- Throws:
NullPointerException
- ifentry
isnull
.IllegalArgumentException
- if the server address is an emptyString
.
-
checkHost
Determines whether or not the server specified inentry
is listening on port 112.- Parameters:
entry
- Descriptor containing the server to check.- Returns:
true
if a connection was opened,false
otherwise.- Throws:
NullPointerException
- ifentry
is 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
-RemoteAddeEntry
to check. Cannot benull
.- Returns:
- The
RemoteEntryEditor.AddeStatus
that 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
-true
tries to connect to the remote ADDE server before doing anything else.entry
-RemoteAddeEntry
to check. Cannot benull
.- Returns:
- The
RemoteEntryEditor.AddeStatus
that represents the verification status ofentry
. - Throws:
NullPointerException
- ifentry
isnull
.- See Also:
-
checkEntryTypes
public static Map<AddeEntry.EntryType,RemoteEntryEditor.AddeStatus> checkEntryTypes(String host, String group) Determine the types of ADDE data within the givengroup
onhost
. 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:
EnumMap
that maps ADDE data type to whether or not it is available for the givenhost
andgroup
.
-
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 givengroup
onhost
.Note: parameters cannot be
null
.- Parameters:
host
- Host to check.group
- ADDE group.user
- ADDE user name.proj
- ADDE project number.- Returns:
EnumMap
that 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:
Set
of the public groups onhost
. TheSet
will 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:
Set
of the groups onhost
. TheSet
will be empty if there are no groups.
-