Class RemoteAddeEntry.Builder
java.lang.Object
edu.wisc.ssec.mcidasv.servermanager.RemoteAddeEntry.Builder
- Enclosing class:
RemoteAddeEntry
Something of a hack... this approach allows us to build a
RemoteAddeEntry in a readable way, despite there being
multiple final fields.
The only required parameters are
the RemoteAddeEntry.address and RemoteAddeEntry.group.
Some examples:
RemoteAddeEntry e = RemoteAddeEntry.Builder("adde.cool.com", "RTIMAGES").build();
e = RemoteAddeEntry.Builder("adde.cool.com", "RTIMAGES").type(EntryType.IMAGE).account("user", "1337").build();
e = RemoteAddeEntry.Builder("adde.cool.com", "RTIMAGES").account("user", "1337").type(EntryType.IMAGE).build()
e = RemoteAddeEntry.Builder("a.c.com", "RTIMGS").validity(EntryValidity.VERIFIED).build();
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AddeAccountOptionalAddeAccountof the entry.private final StringHostname or IP of the resulting entry.private StringOptional alias for the entry.private StringOptional description of the entry.private AddeEntry.EntrySourceOptionalAddeEntry.EntrySourceof the entry.private AddeEntry.EntryStatusOptionalAddeEntry.EntryStatusof the entry.private AddeEntry.EntryTypeOptionalAddeEntry.EntryTypeof the entry.private AddeEntry.EntryValidityOptionalAddeEntry.EntryValidityof the entry.private final StringADDE group to use for the resulting entry.private booleanOptional flag for whether or not the entry is temporary. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional "parameter" for an ADDE entry.Optionally sets the "alias" that can be used to refer to the resulting entry.build()Creates an entry based upon the values supplied to the other methods.Convenient way to generate a new, invalid entry.source(AddeEntry.EntrySource entrySource) Optional "parameter" for an ADDE entry.status(AddeEntry.EntryStatus entryStatus) Optional "parameter" for an ADDE entry.temporary(boolean temporary) Optionally control whether or not the resulting entry is "temporary".type(AddeEntry.EntryType entryType) Optional "parameter" for an ADDE entry.validity(AddeEntry.EntryValidity entryValidity) Optional "parameter" for an ADDE entry.
-
Field Details
-
address
Hostname or IP of the resulting entry. -
group
ADDE group to use for the resulting entry. -
entryType
OptionalAddeEntry.EntryTypeof the entry. Defaults toAddeEntry.EntryType.UNKNOWN. -
entryValidity
OptionalAddeEntry.EntryValidityof the entry. Defaults toAddeEntry.EntryValidity.UNVERIFIED. -
entrySource
OptionalAddeEntry.EntrySourceof the entry. Defaults toAddeEntry.EntrySource.SYSTEM. -
entryStatus
OptionalAddeEntry.EntryStatusof the entry. Defaults toAddeEntry.EntryStatus.ENABLED. -
account
OptionalAddeAccountof the entry. Defaults toAddeEntry.DEFAULT_ACCOUNT. -
description
Optional description of the entry. Defaults to "". -
temporary
Optional flag for whether or not the entry is temporary. Defaults tofalse. -
alias
Optional alias for the entry. Default to "".
-
-
Constructor Details
-
Builder
Creates a new "builder" for an ADDE entry. Note that the two parameters to this constructor are the only required parameters to create an ADDE entry.- Parameters:
address- Address of the ADDE entry. Cannot be null.group- Group of the ADDE entry. Cannot be null.- Throws:
NullPointerException- if eitheraddressorgroupisnull.
-
-
Method Details
-
account
Optional "parameter" for an ADDE entry. Allows you to specify the accounting information. If this method is not called, the resulting ADDE entry will be built withAddeEntry.DEFAULT_ACCOUNT.- Parameters:
username- Username of the ADDE account. Cannot benull.project- Project number for the ADDE account. Cannot benull.- Returns:
- Current "builder" for an ADDE entry.
- See Also:
-
type
Optional "parameter" for an ADDE entry. Allows you to set theRemoteAddeEntry.entryType. If this method is not called,entryTypewill default toAddeEntry.EntryType.UNKNOWN.- Parameters:
entryType- ADDE entry "type".- Returns:
- Current "builder" for an ADDE entry.
-
validity
Optional "parameter" for an ADDE entry. Allows you to set theRemoteAddeEntry.entryValidity. If this method is not called,entryValiditywill default toAddeEntry.EntryValidity.UNVERIFIED.- Parameters:
entryValidity- ADDE entry "validity".- Returns:
- Current "builder" for an ADDE entry.
-
source
Optional "parameter" for an ADDE entry. Allows you to set theRemoteAddeEntry.entrySource. If this method is not called,entrySourcewill default toAddeEntry.EntrySource.SYSTEM.- Parameters:
entrySource- ADDE entry "source".- Returns:
- Current "builder" for an ADDE entry.
-
status
Optional "parameter" for an ADDE entry. Allows you to set theRemoteAddeEntry.entryStatus. If this method is not called,entryStatuswill default toAddeEntry.EntryStatus.ENABLED.- Parameters:
entryStatus- ADDE entry "status".- Returns:
- Current "builder" for an ADDE entry.
-
invalidate
Convenient way to generate a new, invalid entry.- Returns:
- Current "builder" for an ADDE entry.
-
temporary
Optionally control whether or not the resulting entry is "temporary".- Parameters:
temporary- Whether or not the entry is temporary.- Returns:
- Current "builder" for an ADDE entry.
-
alias
Optionally sets the "alias" that can be used to refer to the resulting entry.- Parameters:
alias- Alias for the resulting entry.- Returns:
- Current "builder" for an ADDE entry.
-
build
Creates an entry based upon the values supplied to the other methods.- Returns:
- A newly created
RemoteAddeEntry.
-