public abstract class PSURI extends PSAddressable
DEFAULT_HOST, DEFAULT_PORT, DEFAULT_SCHEME, MAX_PORT_NUMBER
Constructor and Description |
---|
PSURI(String url)
Construct a new URI from the specified URL.
|
PSURI(String scheme,
String host,
int port,
String path)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
EntityValidity |
checkURIValid()
Check whether this URI is valid.
|
Date |
getCreatedDate() |
String |
getDescription() |
String |
getDisplayTitle()
The display title is the title if it's specified,
otherwise the url if it's external or else the filename..
|
String |
getDocid() |
Long |
getId() |
String |
getIdentifier()
Returns the identifier to use when connecting to PageSeeder based on the ID available.
|
String |
getKey() |
List<String> |
getLabels() |
String |
getLabelsAsString() |
String |
getMediaType() |
Date |
getModifiedDate() |
String |
getTitle() |
boolean |
isIdentifiable()
Determines whether the entity can be identified in PageSeeder.
|
boolean |
isValid()
Determines whether the entity is valid based on known PageSeeder constraints.
|
void |
setCreatedDate(String date) |
void |
setDescription(String description) |
void |
setDocid(String docid) |
void |
setId(Long id) |
void |
setLabels(List<String> labels) |
void |
setLabels(String labels) |
void |
setMediaType(String mediatype) |
void |
setModifiedDate(String date) |
void |
setTitle(String title) |
getHost, getHostURL, getPath, getPort, getScheme, getURL, setHost, setPath, setPort, setScheme, toURL
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkValid
public PSURI(String scheme, String host, int port, String path)
scheme
- The scheme "http" or "https"host
- Where the resource is hosted.port
- The port (or negative to use the default port).path
- The path to the resource.public PSURI(String url)
The URL may omit the scheme or authority part, it which case it will default on the default values from the configuration.
Implementation note: this constructor will decompose the URL into its components.
url
- The url.IllegalArgumentException
- If the specified URL is invalidpublic final Long getId()
public final String getKey()
public boolean isIdentifiable()
PSEntity
To be identifiable, the entity must have either a private id or a public id.
If the public ID does not correspond to a single attribute in PageSeeder, then a combination of attributes may be used to determine whether it is possible to identify the entity.
true
if the object can be identified in PageSeeder;
false
if it is not possible to identify the entity form its attributes or keys.public String getIdentifier()
PSEntity
When both the private and public identifier are available, the private identifier takes precedence over the public one.
When the public identifier cannot be used on its own, then only the private ID is returned.
In general, if the PSEntity.isIdentifiable()
method return true
, this
method should return a value. When it is not the case, it should be clearly documented.
public final String getMediaType()
public final String getDocid()
public final String getDescription()
public final String getTitle()
public String getDisplayTitle()
public final Date getCreatedDate()
public final Date getModifiedDate()
public final void setId(Long id)
id
- the id to setpublic final void setDocid(String docid)
docid
- the docid to setpublic final void setDescription(String description)
description
- the description to setpublic final void setTitle(String title)
title
- the title to setpublic final void setMediaType(String mediatype)
mediatype
- the mediatype to setpublic final void setCreatedDate(String date)
date
- the ISO8601 datepublic final void setModifiedDate(String date)
date
- the ISO8601 datepublic final String getLabelsAsString()
public final void setLabels(String labels)
labels
- The labels as a comma-separated list.public EntityValidity checkURIValid()
public boolean isValid()
PSEntity
true
if the object is intrinsically valid based on its internal values;
false
if any of its attributes violates a PageSeeder constraint.Copyright © 2016 Allette Systems. All rights reserved.