public class RemoteAddeEntry extends java.lang.Object implements AddeEntry
| Modifier and Type | Class and Description |
|---|---|
static class |
RemoteAddeEntry.Builder
Something of a hack... this approach allows us to build a
RemoteAddeEntry in a readable way, despite there being
multiple final fields. |
AddeEntry.EditorAction, AddeEntry.EntrySource, AddeEntry.EntryStatus, AddeEntry.EntryType, AddeEntry.EntryValidity| Modifier and Type | Field and Description |
|---|---|
private AddeAccount |
account
Holds the accounting information for this entry.
|
static int |
ADDE_PORT
Default port for remote ADDE servers.
|
private java.lang.String |
address
The server "address" of this entry.
|
private java.lang.String |
asStringId |
private java.lang.String |
entryAlias
Allows the user to refer to this entry with an arbitrary name.
|
private AddeEntry.EntrySource |
entrySource
Where this entry came from.
|
private AddeEntry.EntryStatus |
entryStatus
Whether or not this entry is in the "active set".
|
private AddeEntry.EntryType |
entryType
This entry's type.
|
private AddeEntry.EntryValidity |
entryValidity
Whether or not this entry is valid.
|
private java.lang.String |
group
The "dataset" of this entry.
|
private int |
hashCode
Used so that the hashCode of this entry is not needlessly
recalculated.
|
static java.util.List<RemoteAddeEntry> |
INVALID_ENTRIES
Represents a collection of invalid remote ADDE entries.
|
static RemoteAddeEntry |
INVALID_ENTRY
Represents an invalid remote ADDE entry.
|
private boolean |
isTemporary
Whether or not this entry will persist between McIDAS-V sessions.
|
private static org.slf4j.Logger |
logger
Typical logger object.
|
private static java.lang.String |
publicSrvFormat
String.format(String, Object...) |
DEFAULT_ACCOUNT| Modifier | Constructor and Description |
|---|---|
private |
RemoteAddeEntry(RemoteAddeEntry.Builder builder)
Creates a new ADDE entry using a give "ADDE entry builder".
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
asStringId()
Currently 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.
|
static java.util.Map<AddeEntry.EntryType,RemoteEntryEditor.AddeStatus> |
checkEntryTypes(java.lang.String host,
java.lang.String group)
Determine the types of ADDE data within the given
group on
host. |
static java.util.Map<AddeEntry.EntryType,RemoteEntryEditor.AddeStatus> |
checkEntryTypes(java.lang.String host,
java.lang.String group,
java.lang.String user,
java.lang.String proj)
Determine the types of ADDE data within the given
group on
host. |
static boolean |
checkHost(RemoteAddeEntry entry)
Determines whether or not the server specified in
entry is
listening on port 112. |
boolean |
equals(java.lang.Object obj)
Determines whether or not the given object is equivalent to this ADDE
entry.
|
AddeAccount |
getAccount()
Accounting information associated with the current entry.
|
java.lang.String |
getAddress()
Address of the server associated with the current entry.
|
java.lang.String |
getEntryAlias() |
AddeEntry.EntrySource |
getEntrySource()
Source that specified this entry.
|
AddeEntry.EntryStatus |
getEntryStatus()
GUI status of the entry.
|
java.lang.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.
|
java.lang.String |
getGroup()
Dataset/group located on the server.
|
java.lang.String |
getName()
Name associated with this entry.
|
int |
hashCode()
Returns a hash code for this ADDE entry.
|
boolean |
isEntryTemporary()
Determine whether or not this entry will be saved between application
sessions.
|
static java.util.Set<java.lang.String> |
readGroups(java.lang.String host,
java.lang.String user,
java.lang.String proj)
Attempts to determine which (if any) ADDE groups are available on the
given
host. |
static java.util.Set<java.lang.String> |
readPublicGroups(RemoteAddeEntry entry)
Tries to connect to a given
RemoteAddeEntry and read the list
of ADDE "groups" available to the public. |
static java.util.Set<java.lang.String> |
readPublicGroups(java.lang.String host)
Attempts to determine the "public" ADDE groups available on
the given
host. |
void |
setEntryAlias(java.lang.String newAlias) |
void |
setEntryStatus(AddeEntry.EntryStatus newStatus) |
void |
setEntryValidity(AddeEntry.EntryValidity entryValidity) |
java.lang.String |
toString()
String representation of this entry.
|
private static final org.slf4j.Logger logger
public static final RemoteAddeEntry INVALID_ENTRY
public static final java.util.List<RemoteAddeEntry> INVALID_ENTRIES
public static final int ADDE_PORT
private static final java.lang.String publicSrvFormat
String.format(String, Object...)-friendly string for building a
request to read a server's "PUBLIC.SRV".private final AddeAccount account
private final java.lang.String address
private final java.lang.String group
private final boolean isTemporary
private AddeEntry.EntryType entryType
private AddeEntry.EntryValidity entryValidity
private AddeEntry.EntrySource entrySource
private AddeEntry.EntryStatus entryStatus
private java.lang.String entryAlias
private java.lang.String asStringId
private volatile int hashCode
hashCode()private RemoteAddeEntry(RemoteAddeEntry.Builder builder)
builder - Object used to build this entry.public java.lang.String getAddress()
AddeEntryLocalAddeEntries will return localhost.getAddress in interface AddeEntryaddresspublic java.lang.String getGroup()
AddeEntrypublic java.lang.String getName()
AddeEntrypublic AddeAccount getAccount()
AddeEntryAddeEntry.DEFAULT_ACCOUNT.getAccount in interface AddeEntryaccountpublic AddeEntry.EntryType getEntryType()
AddeEntrygetEntryType in interface AddeEntryentryTypepublic AddeEntry.EntryValidity getEntryValidity()
AddeEntrygetEntryValidity in interface AddeEntryentryValiditypublic void setEntryValidity(AddeEntry.EntryValidity entryValidity)
public AddeEntry.EntrySource getEntrySource()
AddeEntrygetEntrySource in interface AddeEntryentrySourcepublic AddeEntry.EntryStatus getEntryStatus()
AddeEntryAddeEntry.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.getEntryStatus in interface AddeEntryentryStatuspublic void setEntryStatus(AddeEntry.EntryStatus newStatus)
setEntryStatus in interface AddeEntrypublic java.lang.String getEntryAlias()
getEntryAlias in interface AddeEntrypublic void setEntryAlias(java.lang.String newAlias)
setEntryAlias in interface AddeEntrypublic boolean isEntryTemporary()
AddeEntryisEntryTemporary in interface AddeEntrypublic java.lang.String getEntryText()
String representation of this ADDE entry. Currently looks
like ADDRESS/GROUP, but this is subject to change.getEntryText in interface AddeEntryString representation of this entry.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - Object to test against. null values are okay, but
return false.true if the given object is the same as this ADDE
entry, false otherwise... including when o is
null.public int hashCode()
address, group, entryType, account.hashCode in class java.lang.Objectpublic java.lang.String asStringId()
AddeEntryasStringId in interface AddeEntrypublic java.lang.String toString()
AddeEntryOutput will typically contain internal details and as such will differ
from AddeEntry.getEntryText().
public static java.util.Set<java.lang.String> readPublicGroups(RemoteAddeEntry entry)
RemoteAddeEntry and read the list
of ADDE "groups" available to the public.entry - The RemoteAddeEntry to query. Cannot be null.Set of public groups on entry.java.lang.NullPointerException - if entry is null.java.lang.IllegalArgumentException - if the server address is an empty
String.public static boolean checkHost(RemoteAddeEntry entry)
entry is
listening on port 112.entry - Descriptor containing the server to check.true if a connection was opened, false otherwise.java.lang.NullPointerException - if entry is null.public static RemoteEntryEditor.AddeStatus checkEntry(RemoteAddeEntry entry)
Note that this method uses checkHost(RemoteAddeEntry) to
verify that the server is listening. To forego the check, simply call
checkEntry(false, entry).
entry - RemoteAddeEntry to check. Cannot be
null.RemoteEntryEditor.AddeStatus that represents the verification status
of entry.checkHost(RemoteAddeEntry),
checkEntry(boolean, RemoteAddeEntry)public static RemoteEntryEditor.AddeStatus checkEntry(boolean checkHost, RemoteAddeEntry entry)
checkHost - true tries to connect to the remote ADDE server
before doing anything else.entry - RemoteAddeEntry to check. Cannot be
null.RemoteEntryEditor.AddeStatus that represents the verification status
of entry.java.lang.NullPointerException - if entry is null.RemoteEntryEditor.AddeStatuspublic static java.util.Map<AddeEntry.EntryType,RemoteEntryEditor.AddeStatus> checkEntryTypes(java.lang.String host, java.lang.String group)
group on
host. This method uses the "default" ADDE user name
and project number.
Note: parameters cannot be null.
host - Host to check.group - ADDE group.EnumMap that maps ADDE data type to whether or not it
is available for the given host and group.public static java.util.Map<AddeEntry.EntryType,RemoteEntryEditor.AddeStatus> checkEntryTypes(java.lang.String host, java.lang.String group, java.lang.String user, java.lang.String proj)
group on
host.
Note: parameters cannot be null.
host - Host to check.group - ADDE group.user - ADDE user name.proj - ADDE project number.EnumMap that maps ADDE data type to whether or not it
is available for the given set of parameters.checkEntry(boolean, RemoteAddeEntry)public static java.util.Set<java.lang.String> readPublicGroups(java.lang.String host)
host.
Note: this method uses the "default" ADDE user name and project number.
host - Host from which public groups are to be read. Cannot be null.Set of the public groups on host. The
Set will be empty if there are no groups.public static java.util.Set<java.lang.String> readGroups(java.lang.String host, java.lang.String user, java.lang.String proj)
host.
Note: parameters cannot be null.
host - Host from which public groups are to be read.user - ADDE user name.proj - ADDE project number.Set of the groups on host. The Set will
be empty if there are no groups.