public final class HrefHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BASE_REST_SCHEMAS_URL
URL to base REST schemas
|
Constructor and Description |
---|
HrefHelper() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
buildBaseRestSchemaRef(java.lang.String type)
Returns a link to standard base schema of given type.
|
static java.lang.String |
buildEntityDescribesHref(PersistenceContext context,
java.lang.String entityName)
Returns a href to single entity resource without primary key.
|
static java.lang.String |
buildEntityFieldHref(PersistenceContext context,
java.lang.String entityName,
java.lang.String entityId,
java.lang.String fieldName)
Builds a link to an entity field.
|
static java.lang.String |
buildEntityHref(PersistenceContext context,
java.lang.String entityName,
java.lang.String entityId)
Returns a href to single entity resource.
|
static java.lang.String |
buildEntityMetadataHref(PersistenceContext context,
java.lang.String entityName)
Returns a href to entity resource metadata.
|
static java.lang.String |
buildMetadataCatalogHref(PersistenceContext context)
Returns a href to metadata catalog.
|
static java.lang.String |
buildQueryDescribesHref(PersistenceContext context,
java.lang.String queryName)
Returns a href to single entity resource without primary key.
|
static java.lang.String |
buildQueryHref(PersistenceContext context,
java.lang.String queryName,
java.lang.String queryParams)
Returns a href to query resource.
|
static java.lang.String |
buildQueryMetadataHref(PersistenceContext context,
java.lang.String queryName)
Returns a href to query resource.
|
static java.lang.StringBuilder |
getEntityRoot(PersistenceContext context,
java.lang.String entityName)
Returns StringBuilder containing entity root:
http(s)://root:port/persistence/version/context/entity/entityName
|
static java.lang.StringBuilder |
getMetadataRoot(PersistenceContext context)
Returns StringBuilder containing metadata-catalog root:
http(s)://root:port/persistence/version/context/metadata-catalog
|
static java.lang.StringBuilder |
getQueryRoot(PersistenceContext context,
java.lang.String queryName)
Returns StringBuilder containing query root:
http(s)://root:port/persistence/version/context/query/queryName
|
static java.lang.StringBuilder |
getRoot(PersistenceContext context)
Returns StringBuilder containing application root:
http(s)://root:port/persistence/version/context
|
static java.lang.StringBuilder |
getRoot(java.lang.String baseUri,
java.lang.String version,
java.lang.String context)
Returns StringBuilder containing application root:
http(s)://root:port/persistence/version/context
|
public static final java.lang.String BASE_REST_SCHEMAS_URL
public static java.lang.StringBuilder getRoot(java.lang.String baseUri, java.lang.String version, java.lang.String context)
baseUri
- the base URIversion
- the service versioncontext
- the persistent unit namepublic static java.lang.StringBuilder getRoot(PersistenceContext context)
context
- the persistence contextpublic static java.lang.StringBuilder getMetadataRoot(PersistenceContext context)
context
- the persistence contextpublic static java.lang.StringBuilder getEntityRoot(PersistenceContext context, java.lang.String entityName)
context
- the persistence contextentityName
- the entity namepublic static java.lang.StringBuilder getQueryRoot(PersistenceContext context, java.lang.String queryName)
context
- the persistence contextqueryName
- the query namepublic static java.lang.String buildBaseRestSchemaRef(java.lang.String type)
type
- the schema typepublic static java.lang.String buildEntityHref(PersistenceContext context, java.lang.String entityName, java.lang.String entityId)
context
- persistence context.entityName
- entity name.entityId
- entity ID.public static java.lang.String buildEntityFieldHref(PersistenceContext context, java.lang.String entityName, java.lang.String entityId, java.lang.String fieldName)
context
- persistence context.entityName
- entity name.entityId
- entity ID.fieldName
- entity field name.public static java.lang.String buildEntityMetadataHref(PersistenceContext context, java.lang.String entityName)
context
- persistence context.entityName
- entity name.public static java.lang.String buildEntityDescribesHref(PersistenceContext context, java.lang.String entityName)
context
- persistence context.entityName
- entity name.public static java.lang.String buildQueryDescribesHref(PersistenceContext context, java.lang.String queryName)
context
- persistence context.queryName
- query name.public static java.lang.String buildMetadataCatalogHref(PersistenceContext context)
context
- persistence context.public static java.lang.String buildQueryHref(PersistenceContext context, java.lang.String queryName, java.lang.String queryParams)
context
- persistence context.queryName
- name of the queryqueryParams
- query parameters. Optional.public static java.lang.String buildQueryMetadataHref(PersistenceContext context, java.lang.String queryName)
context
- persistence context.queryName
- name of the query