Class AssociationTypeService

java.lang.Object
com.sodius.oslc.server.process.services.AssociationTypeService

@Path("/process/associationType") public class AssociationTypeService extends Object
Provides services for AssociationType.
Since:
1.3.0
  • Constructor Details

    • AssociationTypeService

      public AssociationTypeService()
  • Method Details

    • getAssociationTypes

      @GET @Produces({"application/rdf+xml","application/xml","text/xml","application/json","application/ld+json","text/turtle"}) public Response getAssociationTypes(@QueryParam("friendId") String friendId, @QueryParam("domains") List<URI> domains)
      Returns the list of available association types for the given friend and domains. If the friend and the domains are not provided, all the available association types will be returned.
      Parameters:
      friendId - the friend identifier
      domains - the list of domains
      Returns:
      the association types
      Since:
      3.5.0
    • associationTypes

      protected Map<String,AssociationType> associationTypes(RootServices rootServices, List<URI> domains) throws LinkingTypesStoreException
      Returns a map of compatible AssociationType. Since 3.16.0, it is possible to override this method and add friend domain other than AM, CM, QM, or RM.
      Parameters:
      rootServices - the rootServices
      domains - the local domains
      Returns:
      a map of association types using their identifier as the key
      Throws:
      LinkingTypesStoreException - if an error occurs while reading association types from the store
      Since:
      3.16.0
      See Also:
    • addAssociationTypes

      protected void addAssociationTypes(URI catalog, URI localDomain, URI friendDomain, Map<String,AssociationType> associationTypes) throws LinkingTypesStoreException
      Adds compatible AssociationTypes to the map in parameter.
      Parameters:
      catalog - the catalog
      localDomain - the local domain
      friendDomain - the friend domain
      associationTypes - the map that will be modified
      Throws:
      LinkingTypesStoreException - if an error occurs while reading association types from the store
      Since:
      3.16.0
    • getCatalog

      @GET @Path("{identifier}/catalog") @Produces({"application/rdf+xml","application/xml","text/xml","application/json","application/ld+json","text/turtle"}) public Response getCatalog(@PathParam("identifier") String associationTypeId, @QueryParam("friendId") String friendId, @QueryParam("catalog") String catalog)
      Returns the service provider catalog of the given friend or the given catalog if query parameter is not empty. The catalog will only include providers that are compatible with the domain of the given association type.
      Parameters:
      associationTypeId - the association type identifier
      friendId - the friend identifier
      catalog - the catalog uri
      Returns:
      the service provider catalog
    • getExistingFriend

      protected Friend getExistingFriend(String friendId)
      Returns a Friend from its identifier.
      Parameters:
      friendId - the friend identifier
      Returns:
      the Friend if it exists
      Since:
      3.16.0
    • domains

      protected List<URI> domains()
      Returns the list of accepted domains. Since 3.16.0, it is possible to override this method to add domains.
      Returns:
      the list of domains, which are all declared in Domain by default
      Since:
      3.16.0
    • checkDomains

      protected void checkDomains(List<URI> domains)
      Checks the domains. The list must be non-null and non-empty and every members must be in the accepted domains list.
      Parameters:
      domains - the list of domains to check
      Since:
      3.16.0
      See Also:
    • getCatalogPropertyURI

      protected URI getCatalogPropertyURI(RootServices rootServices, URI domain)
      Gets the catalog of a domain in a root services. Since 3.16.0, it is possible to override this method to add a domain.
      Parameters:
      rootServices - the root services
      domain - the domain
      Returns:
      the catalog if it exists in the root services, null otherwise.
      Since:
      3.16.0