public interface MembershipTypeHandler
Modifier and Type | Field and Description |
---|---|
static String |
ANY_MEMBERSHIP_TYPE
The name of any membership type
|
static Comparator<MembershipType> |
COMPARATOR
This comparator allows to keep the original order but with ANY_MEMBERSHIP_TYPE as first element
if it exists
|
Modifier and Type | Method and Description |
---|---|
void |
addMembershipTypeEventListener(MembershipTypeEventListener listener)
Use this method to register a membership type event listener.
|
MembershipType |
createMembershipType(MembershipType mt,
boolean broadcast)
Use this method to persist a new membership type.
|
MembershipType |
createMembershipTypeInstance() |
MembershipType |
findMembershipType(String name)
Use this method to search for a membership type with the specified name.
|
Collection<MembershipType> |
findMembershipTypes()
Use this method to get all the membership types in the database
|
MembershipType |
removeMembershipType(String name,
boolean broadcast)
Use this method to remove a membership type.
|
void |
removeMembershipTypeEventListener(MembershipTypeEventListener listener)
Use this method to unregister a membership type event listener.
|
MembershipType |
saveMembershipType(MembershipType mt,
boolean broadcast)
Use this method to update an existed MembershipType data.
|
static final String ANY_MEMBERSHIP_TYPE
static final Comparator<MembershipType> COMPARATOR
MembershipType createMembershipTypeInstance()
MembershipType createMembershipType(MembershipType mt, boolean broadcast) throws Exception
mt
- The new membership type that the developer want to persistbroadcast
- Broadcast the event if the broadcast value is 'true'Exception
- An exception is thrown if the method cannot access the database or a listener fail
to handle the eventMembershipType saveMembershipType(MembershipType mt, boolean broadcast) throws Exception
mt
- The membership type object to update.broadcast
- Broadcast the event to all the registered listener if the broadcast value is 'true'Exception
- An exception is thrown if the method cannot access the database or any listener fail
to handle the event.MembershipType removeMembershipType(String name, boolean broadcast) throws Exception
name
- the membership type namebroadcast
- Broadcast the event to the registered listener if the broadcast value is 'true'Exception
- An exception is thrown if the method cannot access the database or the membership
type is not found in the database or any listener fail to handle the event.MembershipType findMembershipType(String name) throws Exception
name
- the name of the membership type.Exception
- An exception is thrown if the method cannot access the database or more than one
membership type is found.Collection<MembershipType> findMembershipTypes() throws Exception
Exception
- Usually an exception is thrown when the method cannot access the database.void addMembershipTypeEventListener(MembershipTypeEventListener listener)
listener
- the listener instance.void removeMembershipTypeEventListener(MembershipTypeEventListener listener)
listener
- the listener instance.Copyright © 2003–2019 eXo Platform SAS. All rights reserved.