Package org.cyclos.services.access
Interface AccessClientService
-
- All Superinterfaces:
CRUDService<AccessClientDTO,AccessClientData,AccessClientDataParams>,Service
- All Known Subinterfaces:
AccessClientServiceLocal
public interface AccessClientService extends CRUDService<AccessClientDTO,AccessClientData,AccessClientDataParams>
Service interface used for managing access clients
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ActivateAccessClientDTOactivate(@NotNull String activationCode, String prefix)Activates an access client for the current user, using the given activation code.voidblock(@NotNull AccessClientActionParams params)Blocks the given an access clientActivateAccessClientDTOcreateAndActivate(CreateAccessClientParams params)Same asactivate(String, String)but creating a new access client first (instead of activating an already existing unassigned client) for the logged user.
The name, when not given, will be generated using the UserAgent's device name suffixing it with '_1','_2' if already exists.
The code used here is that sent withrequestActivationCode(SendOtpParams)StringgetActivationCode(@NotNull AccessClientActionParams params)Returns the code which can be used to activate the access client, connecting an applicationAccessClientsActivationDatagetActivationData(ChannelVO channel)Returns data for activating access clients If a channel is passed in, will only return types that can be used to access it.AccessClientsListDatagetListData(@NotNull PrincipalTypeVO principalType, @NotNull UserLocatorVO user)Returns data for listing access clients of a given type and userAccessClientsSearchDatagetSearchData()Returns data for searching access clientsList<AccessClientTypeData>getTypeData(@NotNull UserLocatorVO user, ChannelVO channel)Returns data each access client type the authenticated user can see for the given user.AccessClientVOlocate(@NotNull AccessClientLocatorVO locator)Returns an access client by either id or token, but only if it belongs (or is managed by) the authenticated userOtpResultrequestActivationCode(@NotNull SendOtpParams params)Requests an activation code of an access client.Page<AccessClientDetailedVO>search(@NotNull AccessClientQuery query)Searches for access clients according to the given criteriavoidunassign(@NotNull AccessClientActionParams params)Unassigns the given access client from its connected applicationbooleanunassignCurrent(ActionWithConfirmationPassword action)Unassigns the access client in the current authorization.voidunblock(@NotNull AccessClientActionParams params)Unblocks the given access client-
Methods inherited from interface org.cyclos.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
-
-
-
Method Detail
-
activate
ActivateAccessClientDTO activate(@NotNull @NotNull String activationCode, String prefix) throws FrameworkException
Activates an access client for the current user, using the given activation code. It is possible to pass in a prefix (optional) to have it appended before the activation code itself. Returns a dto containing the principal type and a token which is then used to identify the remote application. The prefix is not returned. So, if for example, "123" is passed as prefix, and "ABCDEF", the token needed to be used on web service requests will be "123ABCDEF", but only "ABCDEF" is returned. If the prefix is null, no prefix is used.- Throws:
FrameworkException
-
block
void block(@NotNull @NotNull AccessClientActionParams params) throws FrameworkExceptionBlocks the given an access client- Throws:
IllegalActionException- When the status is not activeFrameworkException
-
createAndActivate
ActivateAccessClientDTO createAndActivate(CreateAccessClientParams params)
Same asactivate(String, String)but creating a new access client first (instead of activating an already existing unassigned client) for the logged user.
The name, when not given, will be generated using the UserAgent's device name suffixing it with '_1','_2' if already exists.
The code used here is that sent withrequestActivationCode(SendOtpParams)- See Also:
activate(String, String)
-
getActivationCode
String getActivationCode(@NotNull @NotNull AccessClientActionParams params) throws FrameworkException
Returns the code which can be used to activate the access client, connecting an application- Throws:
IllegalActionException- When the status is not unassignedFrameworkException
-
getActivationData
AccessClientsActivationData getActivationData(ChannelVO channel) throws FrameworkException
Returns data for activating access clients If a channel is passed in, will only return types that can be used to access it.- Throws:
FrameworkException
-
getListData
AccessClientsListData getListData(@NotNull @NotNull PrincipalTypeVO principalType, @NotNull @NotNull UserLocatorVO user) throws FrameworkException
Returns data for listing access clients of a given type and user- Throws:
FrameworkException
-
getSearchData
AccessClientsSearchData getSearchData() throws FrameworkException
Returns data for searching access clients- Throws:
FrameworkException
-
getTypeData
List<AccessClientTypeData> getTypeData(@NotNull @NotNull UserLocatorVO user, ChannelVO channel) throws FrameworkException
Returns data each access client type the authenticated user can see for the given user. If a channel is passed in, will only return types that can be used to access it.- Throws:
FrameworkException
-
locate
AccessClientVO locate(@NotNull @NotNull AccessClientLocatorVO locator) throws FrameworkException
Returns an access client by either id or token, but only if it belongs (or is managed by) the authenticated user- Throws:
FrameworkException
-
requestActivationCode
OtpResult requestActivationCode(@NotNull @NotNull SendOtpParams params) throws FrameworkException
Requests an activation code of an access client.- Throws:
FrameworkException
-
search
Page<AccessClientDetailedVO> search(@NotNull @NotNull AccessClientQuery query) throws FrameworkException
Searches for access clients according to the given criteria- Throws:
FrameworkException
-
unassign
void unassign(@NotNull @NotNull AccessClientActionParams params) throws FrameworkExceptionUnassigns the given access client from its connected application- Throws:
IllegalActionException- When the status is unassignedFrameworkException
-
unassignCurrent
boolean unassignCurrent(ActionWithConfirmationPassword action) throws FrameworkException
Unassigns the access client in the current authorization. No-op if not authorized as an access client. Returns true if an access client was found associated to the current session.- Throws:
FrameworkException
-
unblock
void unblock(@NotNull @NotNull AccessClientActionParams params) throws FrameworkExceptionUnblocks the given access client- Throws:
IllegalActionException- When the status is not blockedFrameworkException
-
-