Class AssociationTypeService
java.lang.Object
com.sodius.oslc.server.process.services.AssociationTypeService
Provides services for
AssociationType.- Since:
- 1.3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAssociationTypes(URI catalog, URI localDomain, URI friendDomain, Map<String, AssociationType> associationTypes) Adds compatible AssociationTypes to the map in parameter.protected Map<String, AssociationType> associationTypes(RootServices rootServices, List<URI> domains) Returns a map of compatible AssociationType.protected voidcheckDomains(List<URI> domains) Checks the domains.domains()Returns the list of accepted domains.getAssociationTypes(String friendId, List<URI> domains) Returns the list of available association types for the given friend and domains.getCatalog(String associationTypeId, String friendId, String catalog) Returns the service provider catalog of the given friend or the given catalog if query parameter is not empty.protected URIgetCatalogPropertyURI(RootServices rootServices, URI domain) Gets the catalog of a domain in a root services.protected FriendgetExistingFriend(String friendId) Returns a Friend from its identifier.
-
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 identifierdomains- 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 rootServicesdomains- 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 LinkingTypesStoreExceptionAdds compatible AssociationTypes to the map in parameter.- Parameters:
catalog- the cataloglocalDomain- the local domainfriendDomain- the friend domainassociationTypes- 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 identifierfriendId- the friend identifiercatalog- the catalog uri- Returns:
- the service provider catalog
-
getExistingFriend
Returns a Friend from its identifier.- Parameters:
friendId- the friend identifier- Returns:
- the Friend if it exists
- Since:
- 3.16.0
-
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
Domainby default - Since:
- 3.16.0
-
checkDomains
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
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 servicesdomain- the domain- Returns:
- the catalog if it exists in the root services, null otherwise.
- Since:
- 3.16.0
-