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 AddeAccount
OptionalAddeAccount
of the entry.private final String
Hostname or IP of the resulting entry.private String
Optional alias for the entry.private String
Optional description of the entry.private AddeEntry.EntrySource
OptionalAddeEntry.EntrySource
of the entry.private AddeEntry.EntryStatus
OptionalAddeEntry.EntryStatus
of the entry.private AddeEntry.EntryType
OptionalAddeEntry.EntryType
of the entry.private AddeEntry.EntryValidity
OptionalAddeEntry.EntryValidity
of the entry.private final String
ADDE group to use for the resulting entry.private boolean
Optional 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.EntryType
of the entry. Defaults toAddeEntry.EntryType.UNKNOWN
. -
entryValidity
OptionalAddeEntry.EntryValidity
of the entry. Defaults toAddeEntry.EntryValidity.UNVERIFIED
. -
entrySource
OptionalAddeEntry.EntrySource
of the entry. Defaults toAddeEntry.EntrySource.SYSTEM
. -
entryStatus
OptionalAddeEntry.EntryStatus
of the entry. Defaults toAddeEntry.EntryStatus.ENABLED
. -
account
OptionalAddeAccount
of 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 eitheraddress
orgroup
isnull
.
-
-
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,entryType
will 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,entryValidity
will 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,entrySource
will 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,entryStatus
will 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
.
-