@Component public class PartnerManagerImpl extends ManagerHelperImpl<Partner> implements PartnerManager
PartnerManager.UpdateField| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
classType |
| Constructor and Description |
|---|
PartnerManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists(java.lang.String partnerRef)
Returns whether a partner reference exists (as a registered ASSISTments partner).
|
Partner |
getMyPartner()
Returns the current application's or service's Partner object originating from the
PartnerCredentials as defined in the current application's configuration file (xml). |
int |
getMyPartnerId()
Returns the current application's or service's Partner ID originating from persisted version of
PartnerCredentials as defined in the current application's configuration file (xml). |
java.lang.String |
getMyPartnerRef()
Returns the current application's or service's Partner external reference name originating from the
PartnerCredentials as defined in the current application's configuration file (xml). |
Partner |
getPartner(java.lang.String partnerRef)
Returns the Partner object for the named partner
|
int |
getPartnerId(java.lang.String partnerRef)
Returns the database ID for a partner reference
Note: For use only by Service Administrators.
|
java.util.List<java.lang.String> |
getPartnerReferences()
Returns a list of all partner references
|
java.util.List<Partner> |
getPartners() |
Partner |
getRequestingPartner()
Returns the Partner object for the requesting application or service.
|
int |
getRequestingPartnerId()
Returns the persisted Partner ID for the requesting application or service.
|
java.lang.String |
getRequestingPartnerRef()
Returns the Partner reference for the requesting application or service.
|
void |
init() |
java.util.List<Partner> |
registerDependencies(PartnerCredentials pCreds) |
Partner |
registerOrUpdate(PartnerCredentials partnerCreds)
Registers a new application with the ASSISTmetns Service (AS)
|
void |
update(java.util.List<Pair<PartnerManager.UpdateField,java.lang.String>> values) |
void |
update(java.lang.String partnerRef,
java.util.List<Pair<PartnerManager.UpdateField,java.lang.String>> values)
Updates a partner application's select registration fields
|
void |
updateRegistration(Partner partner)
Updates a partner application's registration.
|
createExternalReferenceFor@PostConstruct public void init()
@Transactional public Partner registerOrUpdate(PartnerCredentials partnerCreds) throws AlreadyExistsException
PartnerManagerOnly the AS admin applications is allowed to call this method.
registerOrUpdate in interface PartnerManagerpartnerCreds - Partner application to registerAlreadyExistsException - If partnerRef is already in usepublic java.util.List<Partner> registerDependencies(PartnerCredentials pCreds)
registerDependencies in interface PartnerManagerpublic void updateRegistration(Partner partner)
PartnerManagerNote: Presently for use only by System Administrators. Going forward, the API should allow partner applications to update a subset of their registration data.
Replaces all partner application fields with the values provided. The correct use of this method
is to call PartnerManager.getPartner(String), update the returned PartnerApplication object
and to pass the updated object to this method.
updateRegistration in interface PartnerManagerpartner - New settingsPartnerManager.getPartner(String)public boolean exists(java.lang.String partnerRef)
PartnerManagerNote: For use only by Service Administrators.
exists in interface PartnerManagerpartnerRef - Partner reference of interestpublic Partner getMyPartner() throws NotFoundException
PartnerManagerPartnerCredentials as defined in the current application's configuration file (xml).
Note: Use with caution. In most cases you are interested in the requesting
partner as your application is acting on behalf of that requestor. See PartnerManager.getRequestingPartner().
getMyPartner in interface PartnerManagerNotFoundException - If somehow the current application does not have a persisted entry. Unexpected.public java.lang.String getMyPartnerRef()
PartnerManagerPartnerCredentials as defined in the current application's configuration file (xml).
Note: Use with caution. In most cases you are interested in the requesting
partner as your application is acting on behalf of that requestor. See PartnerManager.getRequestingPartnerRef().
getMyPartnerRef in interface PartnerManagerpublic int getMyPartnerId()
throws NotFoundException
PartnerManagerPartnerCredentials as defined in the current application's configuration file (xml).
Note: Use with caution. In most cases you are interested in the requesting
partner as your application is acting on behalf of that requestor. See PartnerManager.getRequestingPartnerId().
getMyPartnerId in interface PartnerManagerNotFoundException - If somehow the current application does not have a persisted entry. Unexpected.public Partner getRequestingPartner()
PartnerManagergetRequestingPartner in interface PartnerManagerpublic java.lang.String getRequestingPartnerRef()
PartnerManagergetRequestingPartnerRef in interface PartnerManagerpublic int getRequestingPartnerId()
throws NotFoundException
PartnerManagergetRequestingPartnerId in interface PartnerManagerNotFoundException - If the requestor presented an invalid partner reference.public Partner getPartner(java.lang.String partnerRef) throws NotFoundException
PartnerManager
Note: For use only by Service Administrators.
For their application, partners call #getPartner().
getPartner in interface PartnerManagerpartnerRef - Partner referenceNotFoundException - If the named application is not a registered partner.public int getPartnerId(java.lang.String partnerRef)
throws NotFoundException
PartnerManager#getPartnerId().getPartnerId in interface PartnerManagerpartnerRef - Partner reference of interestNotFoundException - If the specified partnerRef is not foundpublic java.util.List<Partner> getPartners()
getPartners in interface PartnerManagerpublic java.util.List<java.lang.String> getPartnerReferences()
PartnerManagergetPartnerReferences in interface PartnerManagerpublic void update(java.util.List<Pair<PartnerManager.UpdateField,java.lang.String>> values)
update in interface PartnerManagerpublic void update(java.lang.String partnerRef,
java.util.List<Pair<PartnerManager.UpdateField,java.lang.String>> values)
PartnerManagerupdate in interface PartnerManagerpartnerRef - Partner application reference to updatevalues - List of fields and values to update