@Entity public class URLHandlerImpl extends Object implements URLHandler, Locatable, AdminMainEntity, ProfileEntity
Modifier and Type | Field and Description |
---|---|
protected Long |
id |
protected String |
incomingURL |
protected String |
newURL |
protected String |
urlRedirectType |
MAIN_ENTITY_NAME_PROPERTY
Constructor and Description |
---|
URLHandlerImpl() |
Modifier and Type | Method and Description |
---|---|
<G extends URLHandler> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
Long |
getId() |
String |
getIncomingURL() |
String |
getLocation()
If this is returning something that is non-null, this MUST return a String that starts with a slash
and does not end with a slash.
|
String |
getMainEntityName() |
String |
getNewURL() |
URLRedirectType |
getUrlRedirectType() |
protected boolean |
hasRegExCharacters(String location)
In a preview environment,
getLocation() attempts to navigate to the
provided URL. |
void |
setId(Long id) |
void |
setIncomingURL(String incomingURL) |
void |
setNewURL(String newURL) |
void |
setUrlRedirectType(URLRedirectType redirectType) |
protected Long id
protected String incomingURL
protected String newURL
protected String urlRedirectType
public Long getId()
getId
in interface URLHandler
public void setId(Long id)
setId
in interface URLHandler
public String getIncomingURL()
getIncomingURL
in interface URLHandler
public void setIncomingURL(String incomingURL)
setIncomingURL
in interface URLHandler
public String getNewURL()
getNewURL
in interface URLHandler
public void setNewURL(String newURL)
setNewURL
in interface URLHandler
public URLRedirectType getUrlRedirectType()
getUrlRedirectType
in interface URLHandler
public void setUrlRedirectType(URLRedirectType redirectType)
setUrlRedirectType
in interface URLHandler
public String getMainEntityName()
getMainEntityName
in interface AdminMainEntity
public String getLocation()
Locatable
getLocation
in interface Locatable
protected boolean hasRegExCharacters(String location)
getLocation()
attempts to navigate to the
provided URL. If the URL contains a Regular Expression, then we can't
navigate to it.location
- public <G extends URLHandler> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException
MultiTenantCloneable
public CreateResponse<MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException {
CreateResponse<MyClass> createResponse = super.createOrRetrieveCopyInstance(context);
if (createResponse.isAlreadyPopulated()) {
return createResponse;
}
MyClass myClone = createResponse.getClone();
//copy extended field values on myClone here
return createResponse;
}
Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity:
public CreateResponse<G extends MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException {
CreateResponse createResponse = context.createOrRetrieveCopyInstance(this);
MyClass myClone = createResponse.getClone();
//copy extended field values on myClone here
return createResponse;
}
createOrRetrieveCopyInstance
in interface MultiTenantCloneable<URLHandler>
context
- a context object providing persistence and library functionality for copying entitiesCloneNotSupportedException
- if there's a problem detected with the cloning configurationCopyright © 2017. All rights reserved.