Interface AccountModifier
-
- All Superinterfaces:
IntermediateStorageProvider
,Modifier<Account>
,UndeletableModifier<Account>
public interface AccountModifier extends UndeletableModifier<Account>, IntermediateStorageProvider
Defines an API to modify an instance of typeAccount
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Account.AccountType
getAccountType()
Get theAccount.AccountType
representing the type of this account which is held in thisAccountModifier
.java.lang.String
getAddress()
Get the current account address which is held in thisAccountModifier
.java.util.Optional<Account>
getAlternativeOutgoingAccount()
Get the current optional alternative outgoing account which is held in thisAccountModifier
.Channel
getChannel()
Get the current channel which is held in thisAccountModifier
.java.lang.String
getName()
Get the current account name which is held in thisAccountModifier
.java.lang.String
getProtocol()
Get the current protocol which is held in thisAccountModifier
.Tenant
getTenant()
Get the current tenant which is held in thisAccountModifier
.boolean
isEnabled()
Get the current enabled state which is held in thisAccountModifier
.boolean
isSendAllowed()
Get the current sendAllowed state which is held in thisAccountModifier
.AccountModifier
setAccountType(Account.AccountType type)
Set theAccount.AccountType
representing the type of this account while creating.AccountModifier
setAddress(java.lang.String address)
Change the address of the associatedAccount
.AccountModifier
setAlternativeOutgoingAccount(java.util.Optional<Account> outgoingAccount)
Change the optional alternative outgoing account of the associatedAccount
.AccountModifier
setChannel(Channel channel)
Change the channel of the associatedAccount
.AccountModifier
setEnabled(boolean enabled)
Change the enabled state of the associatedAccount
.AccountModifier
setName(java.lang.String name)
Change the name of the associatedAccount
.AccountModifier
setProtocol(java.lang.String protocol)
Change the protocol of the associatedAccount
.AccountModifier
setSendAllowed(boolean sendAllowed)
Change the sendAllowed state of the associatedAccount
.AccountModifier
setTenant(Tenant tenant)
Change the tenant of the associatedAccount
.boolean
validateAccountType(Account.AccountType type)
Validate the given type of account.boolean
validateAddress(java.lang.String address)
Validate the given address.boolean
validateAlternativeOutgoingAccount(java.util.Optional<Account> outgoingAccount)
Validate the given alternative outgoing account.boolean
validateChannel(Channel channel)
Validate the given channel.boolean
validateEnabled(boolean enabled)
Validate the given enabled.boolean
validateName(java.lang.String name)
Validate the given name.boolean
validateProtocol(java.lang.String protocol)
Validate the given protocol.boolean
validateSendAllowed(boolean sendAllowed)
Validate the given sendAllowed.boolean
validateTenant(Tenant tenant)
Validate the given tenant.-
Methods inherited from interface com.novomind.ecom.api.iagent.provider.IntermediateStorageProvider
getIntermediateStorage
-
Methods inherited from interface com.novomind.ecom.api.imail.routing.persistence.Modifier
delete, get, write
-
Methods inherited from interface com.novomind.ecom.api.imail.routing.persistence.UndeletableModifier
undelete
-
-
-
-
Method Detail
-
getName
java.lang.String getName()
Get the current account name which is held in thisAccountModifier
.- Returns:
- the name as String
-
setName
AccountModifier setName(java.lang.String name) throws ValidationException
Change the name of the associated
Account
.The change is applied after the
Modifier.write()
method is called.- Parameters:
name
- the new name as String- Returns:
- the
AccountModifier
- Throws:
ValidationException
- if the new name is invalid
-
validateName
boolean validateName(java.lang.String name) throws ValidationException
Validate the given name.- Parameters:
name
- the name to validate as String- Returns:
- true if the name is valid
- Throws:
ValidationException
- if the name is invalid
-
getAddress
java.lang.String getAddress()
Get the current account address which is held in thisAccountModifier
.- Returns:
- the address as String
-
setAddress
AccountModifier setAddress(java.lang.String address) throws ValidationException
Change the address of the associated
Account
.The change is applied after the
Modifier.write()
method is called.- Parameters:
address
- the new address as String- Returns:
- the
AccountModifier
- Throws:
ValidationException
- if the new address is invalid
-
validateAddress
boolean validateAddress(java.lang.String address) throws ValidationException
Validate the given address.- Parameters:
address
- the address to validate as String- Returns:
- true if the address is valid
- Throws:
ValidationException
- if the address is invalid
-
getProtocol
java.lang.String getProtocol()
Get the current protocol which is held in thisAccountModifier
.- Returns:
- the protocol as String
-
setProtocol
AccountModifier setProtocol(java.lang.String protocol) throws ValidationException
Change the protocol of the associated
Account
.The change is applied after the
Modifier.write()
method is called.- Parameters:
protocol
- the new protocol as String- Returns:
- the
AccountModifier
- Throws:
ValidationException
- if the new protocol is invalid
-
validateProtocol
boolean validateProtocol(java.lang.String protocol) throws ValidationException
Validate the given protocol.- Parameters:
protocol
- the protocol to validate as String- Returns:
- true if the protocol is valid
- Throws:
ValidationException
- if the protocol is invalid
-
getChannel
Channel getChannel()
Get the current channel which is held in thisAccountModifier
.- Returns:
- the channel as String
-
setChannel
AccountModifier setChannel(Channel channel) throws ValidationException
Change the channel of the associated
Account
.The change is applied after the
Modifier.write()
method is called.- Parameters:
channel
- the new channel- Returns:
- the
AccountModifier
- Throws:
ValidationException
- if the new channel is invalid
-
validateChannel
boolean validateChannel(Channel channel) throws ValidationException
Validate the given channel.- Parameters:
channel
- the channel to validate- Returns:
- true if the channel is valid
- Throws:
ValidationException
- if the channel is invalid
-
getTenant
Tenant getTenant()
Get the current tenant which is held in thisAccountModifier
.- Returns:
- the tenant as String
-
setTenant
AccountModifier setTenant(Tenant tenant) throws ValidationException
Change the tenant of the associated
Account
.The change is applied after the
Modifier.write()
method is called.- Parameters:
tenant
- the new tenant- Returns:
- the
AccountModifier
- Throws:
ValidationException
- if the new tenant is invalid
-
validateTenant
boolean validateTenant(Tenant tenant) throws ValidationException
Validate the given tenant.- Parameters:
tenant
- the tenant to validate- Returns:
- true if the tenant is valid
- Throws:
ValidationException
- if the tenant is invalid
-
isEnabled
boolean isEnabled()
Get the current enabled state which is held in thisAccountModifier
.- Returns:
- the enabled state
-
setEnabled
AccountModifier setEnabled(boolean enabled) throws ValidationException
Change the enabled state of the associated
Account
.The change is applied after the
Modifier.write()
method is called.- Parameters:
enabled
- the new enabled state- Returns:
- the
AccountModifier
- Throws:
ValidationException
- if the new enabled state cannot be applied
-
validateEnabled
boolean validateEnabled(boolean enabled) throws ValidationException
Validate the given enabled.- Parameters:
enabled
- the enabled state to validate- Returns:
- true if the enabled is valid
- Throws:
ValidationException
- if the enabled is invalid
-
isSendAllowed
boolean isSendAllowed()
Get the current sendAllowed state which is held in thisAccountModifier
.- Returns:
- the sendAllowed state
-
setSendAllowed
AccountModifier setSendAllowed(boolean sendAllowed) throws ValidationException
Change the sendAllowed state of the associated
Account
.The change is applied after the
Modifier.write()
method is called.- Parameters:
sendAllowed
- the new sendAllowed state- Returns:
- the
AccountModifier
- Throws:
ValidationException
- if the new sendAllowed state cannot be applied
-
validateSendAllowed
boolean validateSendAllowed(boolean sendAllowed) throws ValidationException
Validate the given sendAllowed.- Parameters:
sendAllowed
- the sendAllowed state to validate- Returns:
- true if the sendAllowed is valid
- Throws:
ValidationException
- if the sendAllowed is invalid
-
getAlternativeOutgoingAccount
java.util.Optional<Account> getAlternativeOutgoingAccount()
Get the current optional alternative outgoing account which is held in thisAccountModifier
.- Returns:
- the optional alternative outgoing account
- Since:
- 10.0.142
-
setAlternativeOutgoingAccount
AccountModifier setAlternativeOutgoingAccount(java.util.Optional<Account> outgoingAccount) throws ValidationException
Change the optional alternative outgoing account of the associated
Account
.The change is applied after the
Modifier.write()
method is called.- Parameters:
outgoingAccount
- the new optional alternative outgoing account- Returns:
- the
AccountModifier
- Throws:
ValidationException
- if the new optional alternative outgoing account is invalid- Since:
- 10.0.142
-
validateAlternativeOutgoingAccount
boolean validateAlternativeOutgoingAccount(java.util.Optional<Account> outgoingAccount) throws ValidationException
Validate the given alternative outgoing account.- Parameters:
outgoingAccount
- the new optional alternative outgoing account- Returns:
- true if the outgoing account is valid
- Throws:
ValidationException
- if the outgoing account is invalid, or the alternative outgoing account does not allow to sendisSendAllowed()
.- Since:
- 10.0.142
-
getAccountType
Account.AccountType getAccountType()
Get theAccount.AccountType
representing the type of this account which is held in thisAccountModifier
.- Returns:
- the type as
Account.AccountType
- Since:
- 12.22
-
setAccountType
AccountModifier setAccountType(Account.AccountType type) throws ValidationException
Set the
Account.AccountType
representing the type of this account while creating. Please note, the type of an account is only setable for new accounts. Changing the type of an existing Account leads to a ValidationException.- Parameters:
type
- the newAccount.AccountType
representing the type of this account- Returns:
- the
AccountModifier
- Throws:
ValidationException
- if the change is invalid- Since:
- 12.22
-
validateAccountType
boolean validateAccountType(Account.AccountType type) throws ValidationException
Validate the given type of account.- Parameters:
type
- the type of account- Returns:
- true if the type of account is valid
- Throws:
ValidationException
- if the type of account is not valid- Since:
- 12.22
-
-