Class RemoteRepositoryImpl<Type extends IridaRepresentationModel>

    • Constructor Detail

      • RemoteRepositoryImpl

        public RemoteRepositoryImpl​(RemoteAPITokenService tokenService,
                                    UserService userService,
                                    org.springframework.core.ParameterizedTypeReference<ListResourceWrapper<Type>> listTypeReference,
                                    org.springframework.core.ParameterizedTypeReference<ResourceWrapper<Type>> objectTypeReference)
        Create a new repository with the given rest template and object params
        Parameters:
        tokenService - service storing api tokens for communication with the remote APIs
        userService - service for reading users
        listTypeReference - A ParameterizedTypeReference for objects listed by the rest template
        objectTypeReference - A ParameterizedTypeReference for individual resources read by the rest template
    • Method Detail

      • list

        public java.util.List<Type> list​(java.lang.String uri,
                                         RemoteAPI remoteAPI)
        List the resources available from this service
        Specified by:
        list in interface RemoteRepository<Type extends IridaRepresentationModel>
        Parameters:
        uri - the URI of the resource to list.
        remoteAPI - The API to read from
        Returns:
        A List<Type> of the resources available
      • setRemoteStatus

        protected <T extends IridaRepresentationModel> T setRemoteStatus​(T entity,
                                                                         RemoteAPI api)
        Set the RemoteStatus of a read remote entity
        Type Parameters:
        T - The type of entity you're setting status of
        Parameters:
        entity - The entity to set the remote status on
        api - The API to connect to
        Returns:
        the enhanced entity