@Entity public class URLHandlerImpl extends Object implements URLHandler, Locatable, AdminMainEntity, ProfileEntity, URLHandlerAdminPresentation
URLHandlerAdminPresentation.GroupName, URLHandlerAdminPresentation.GroupOrder, URLHandlerAdminPresentation.TabName, URLHandlerAdminPresentation.TabOrder| Modifier and Type | Field and Description |
|---|---|
protected Long |
id |
protected String |
incomingURL |
protected Boolean |
isRegex |
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. |
boolean |
isRegexHandler()
Indicates if the value returned by
getIncomingURL() is a regex expression
rather than a concrete URI. |
void |
setId(Long id) |
void |
setIncomingURL(String incomingURL) |
void |
setNewURL(String newURL) |
void |
setRegexHandler(boolean regexHandler)
Deprecated.
|
void |
setRegexHandler(Boolean regexHandler)
Indicates if the value set by the method
setIncomingURL(String) should be treated as a regex
expression rather than as a concrete URI. |
void |
setUrlRedirectType(URLRedirectType redirectType) |
protected Long id
protected String incomingURL
protected String newURL
protected String urlRedirectType
protected Boolean isRegex
public Long getId()
getId in interface URLHandlerpublic void setId(Long id)
setId in interface URLHandlerpublic String getIncomingURL()
getIncomingURL in interface URLHandlerpublic void setIncomingURL(String incomingURL)
setIncomingURL in interface URLHandlerpublic String getNewURL()
getNewURL in interface URLHandlerpublic void setNewURL(String newURL)
setNewURL in interface URLHandlerpublic URLRedirectType getUrlRedirectType()
getUrlRedirectType in interface URLHandlerpublic void setUrlRedirectType(URLRedirectType redirectType)
setUrlRedirectType in interface URLHandlerpublic boolean isRegexHandler()
URLHandlergetIncomingURL() is a regex expression
rather than a concrete URI. Default is false.isRegexHandler in interface URLHandler@Deprecated public void setRegexHandler(boolean regexHandler)
setRegexHandler in interface URLHandlerpublic void setRegexHandler(Boolean regexHandler)
URLHandlersetIncomingURL(String) should be treated as a regex
expression rather than as a concrete URI.setRegexHandler in interface URLHandlerpublic String getMainEntityName()
getMainEntityName in interface AdminMainEntitypublic String getLocation()
LocatablegetLocation in interface Locatableprotected 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 © 2019. All rights reserved.