Merged V3.2 to HEAD

15586: Merged V3.1 to V3.2
      14863: Fixed ETHREEOH-2223: Oracle version-specific schema update failure in upgrading from 2.1A build to 3.1 build
      15041: Further fix for ETHREEOH-2223: Oracle version-specific schema update failure in upgrading from 2.1A build to 3.1 build
      15428: The ipAddress field of HibernateNodeDaoServiceImpl is 39 characters long (Transaction.hbm.xml modified)
      15472: Incremented schema version number for SQL patch
      15502: ETHREEOH-2292: Deployment failure in case of IPv6 on Win 2k8
             *NOTE*: Removed Derby scripts as it's no longer supported
   15588: (record only after Derby script removal) Fixed over-zelous move of Derby scripts
   15589: Removed hard-coded GUEST reference
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /alfresco/BRANCHES/V3.1:r14863,15041,15428,15472,15502
   Merged /alfresco/BRANCHES/V3.2:r15586,15588-15589


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16863 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-10-13 13:02:56 +00:00
parent 69249332d3
commit e31a8bf882
12 changed files with 187 additions and 451 deletions

View File

@@ -114,6 +114,7 @@
<ref bean="patch.db-V2.1-RemoveWcmSubmittedAspect" />
<ref bean="patch.db-V2.1-AuditPathIndex" />
<ref bean="patch.db-V3.0-0-CreateActivitiesExtras" />
<ref bean="patch.db-V3.1-Allow-IPv6" />
<ref bean="patch.db-V3.2-Remove-AVM-Issuer" />
<ref bean="patch.db-V3.2-Modify-AVM-MimeType" />
<ref bean="patch.db-V3.2-Upgrade-JBPM" />

View File

@@ -1,79 +0,0 @@
--
-- Title: Activities Schema - Extras (Indexes, Identity)
-- Database: Derby
-- Since: V3.0.0 Schema
--
-- Activity Post
-- Hibernate workaround - to add identity column
DROP TABLE alf_activity_post;
CREATE TABLE alf_activity_post (
sequence_id bigint generated by default as identity (start with 1),
post_date timestamp NOT NULL,
status varchar(10) NOT NULL,
activity_data varchar(4000) NOT NULL,
post_user_id varchar(255) NOT NULL,
job_task_node integer NOT NULL,
site_network varchar(255) default NULL,
app_tool varchar(36) default NULL,
activity_type varchar(255) NOT NULL,
last_modified timestamp NOT NULL,
primary key (sequence_id)
);
CREATE INDEX post_jobtasknode_idx ON alf_activity_post(job_task_node);
CREATE INDEX post_status_idx ON alf_activity_post(status);
-- Activity Feed
-- Hibernate workaround - to add identity column
DROP TABLE alf_activity_feed;
CREATE TABLE alf_activity_feed (
id bigint generated by default as identity (start with 1),
post_id bigint default NULL,
post_date timestamp NOT NULL,
activity_summary varchar(4000) default NULL,
feed_user_id varchar(255) NOT NULL,
activity_type varchar(255) NOT NULL,
activity_format varchar(10) default NULL,
site_network varchar(255) default NULL,
app_tool varchar(36) default NULL,
post_user_id varchar(255) NOT NULL,
feed_date timestamp NOT NULL,
primary key (id)
);
CREATE INDEX feed_postdate_idx ON alf_activity_feed(post_date);
CREATE INDEX feed_postuserid_idx ON alf_activity_feed(post_user_id);
CREATE INDEX feed_feeduserid_idx ON alf_activity_feed(feed_user_id);
CREATE INDEX feed_sitenetwork_idx ON alf_activity_feed(site_network);
CREATE INDEX feed_activityformat_idx ON alf_activity_feed(activity_format);
-- Activity Feed Control
-- Hibernate workaround - to add identity column
DROP TABLE alf_activity_feed_control;
CREATE TABLE alf_activity_feed_control (
id bigint generated by default as identity (start with 1),
feed_user_id varchar(255) NOT NULL,
site_network varchar(255) NOT NULL,
app_tool varchar(36) default NULL,
last_modified timestamp NOT NULL,
primary key (id)
);
CREATE INDEX feedctrl_feeduserid_idx ON alf_activity_feed_control(feed_user_id);
--
-- Record script finish
--
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V3.0-0-CreateActivitiesExtras';
INSERT INTO alf_applied_patch
(id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
VALUES
(
'patch.db-V3.0-0-CreateActivitiesExtras', 'Executed script create V3.0: Created activities extras',
0, 125, -1, 126, CURRENT_TIMESTAMP, 'UNKNOWN', 1, 1, 'Script completed'
);

View File

@@ -1,74 +0,0 @@
--
-- Title: Create Content tables
-- Database: Derby
-- Since: V3.2 Schema 2012
-- Author: Derek Hulley
--
-- Please contact support@alfresco.com if you need assistance with the upgrade.
--
CREATE TABLE alf_mimetype
(
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
version BIGINT NOT NULL,
mimetype_str VARCHAR(100) NOT NULL,
PRIMARY KEY (id),
UNIQUE (mimetype_str)
);
CREATE TABLE alf_encoding
(
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
version BIGINT NOT NULL,
encoding_str VARCHAR(100) NOT NULL,
PRIMARY KEY (id),
UNIQUE (encoding_str)
);
-- This table may exist during upgrades, but must be removed.
-- The drop statement is therefore optional.
DROP TABLE alf_content_url; --(optional)
CREATE TABLE alf_content_url
(
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
version BIGINT NOT NULL,
content_url VARCHAR(255) NOT NULL,
content_url_short VARCHAR(12) NOT NULL,
content_url_crc BIGINT NOT NULL,
content_size BIGINT NOT NULL,
CONSTRAINT idx_alf_cont_url_crc UNIQUE (content_url_short, content_url_crc),
PRIMARY KEY (id)
);
CREATE TABLE alf_content_data
(
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
version BIGINT NOT NULL,
content_url_id BIGINT,
content_mimetype_id BIGINT,
content_encoding_id BIGINT,
content_locale_id BIGINT,
CONSTRAINT fk_alf_cont_url FOREIGN KEY (content_url_id) REFERENCES alf_content_url (id),
CONSTRAINT fk_alf_cont_mim FOREIGN KEY (content_mimetype_id) REFERENCES alf_mimetype (id),
CONSTRAINT fk_alf_cont_enc FOREIGN KEY (content_encoding_id) REFERENCES alf_encoding (id),
CONSTRAINT fk_alf_cont_loc FOREIGN KEY (content_locale_id) REFERENCES alf_locale (id),
PRIMARY KEY (id)
);
CREATE TABLE alf_content_clean
(
content_url VARCHAR(255) NOT NULL
);
CREATE INDEX idx_alf_contentclean_url ON alf_content_clean(content_url);
--
-- Record script finish
--
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V3.2-ContentTables';
INSERT INTO alf_applied_patch
(id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
VALUES
(
'patch.db-V3.2-ContentTables', 'Manually executed script upgrade V3.2: Content Tables',
0, 2011, -1, 2012, null, 'UNKOWN', 1, 1, 'Script completed'
);

View File

@@ -1,46 +0,0 @@
--
-- Title: Create lock tables
-- Database: Derby
-- Since: V3.2 Schema 2011
-- Author: Derek Hulley
--
-- Please contact support@alfresco.com if you need assistance with the upgrade.
--
CREATE TABLE alf_lock_resource
(
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
version BIGINT NOT NULL,
qname_ns_id BIGINT NOT NULL,
qname_localname VARCHAR(255) NOT NULL,
CONSTRAINT fk_alf_lockr_ns FOREIGN KEY (qname_ns_id) REFERENCES alf_namespace (id),
CONSTRAINT fk_alf_lockr_id PRIMARY KEY (id),
CONSTRAINT idx_alf_lockr_key UNIQUE (qname_ns_id, qname_localname)
);
CREATE TABLE alf_lock
(
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
version BIGINT NOT NULL,
shared_resource_id BIGINT NOT NULL,
excl_resource_id BIGINT NOT NULL,
lock_token VARCHAR(36) NOT NULL,
start_time BIGINT NOT NULL,
expiry_time BIGINT NOT NULL,
CONSTRAINT fk_alf_lock_shared FOREIGN KEY (shared_resource_id) REFERENCES alf_lock_resource (id),
CONSTRAINT fk_alf_lock_excl FOREIGN KEY (excl_resource_id) REFERENCES alf_lock_resource (id),
CONSTRAINT fk_alf_lock_id PRIMARY KEY (id),
CONSTRAINT idx_alf_lock_key UNIQUE (shared_resource_id, excl_resource_id)
);
--
-- Record script finish
--
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V3.2-LockTables';
INSERT INTO alf_applied_patch
(id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
VALUES
(
'patch.db-V3.2-LockTables', 'Manually executed script upgrade V3.2: Lock Tables',
0, 2010, -1, 2011, null, 'UNKOWN', 1, 1, 'Script completed'
);

View File

@@ -0,0 +1,21 @@
--
-- Title: Increase the ipAddress field length to allow IPv6 adresses
-- Database: MySQL
-- Since: V3.1 schema 1009
--
-- Please contact support@alfresco.com if you need assistance with the upgrade.
--
ALTER TABLE alf_server MODIFY ip_address varchar(39) NOT NULL;
--
-- Record script finish
--
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V3.1-Allow-IPv6';
INSERT INTO alf_applied_patch
(id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
VALUES
(
'patch.db-V3.1-Allow-IPv6', 'Manually executed script upgrade V3.1: Increase the ipAddress field length',
0, 2019, -1, 2020, null, 'UNKOWN', 1, 1, 'Script completed'
);

View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="alfresco.activities">
<insert id="insert_activity_feedcontrol" parameterClass="FeedControl">
insert into alf_activity_feed_control (id, feed_user_id, site_network, app_tool, last_modified)
values (DEFAULT, #feedUserId#, #siteNetwork#, #appTool#, #lastModified#)
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
<insert id="insert_activity_feed" parameterClass="ActivityFeed">
insert into alf_activity_feed (id, activity_type, activity_summary, activity_format, feed_user_id, post_user_id, post_date, post_id, site_network, app_tool, feed_date)
values (DEFAULT, #activityType#, #activitySummary#, #activitySummaryFormat#, #feedUserId#, #postUserId#, #postDate#, #postId#, #siteNetwork#, #appTool#, #feedDate#)
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
<insert id="insert_activity_post" parameterClass="ActivityPost">
insert into alf_activity_post (sequence_id, status, activity_data, post_user_id, post_date, activity_type, site_network, app_tool, job_task_node, last_modified)
values (DEFAULT, #status#, #activityData#, #userId#, #postDate#, #activityType#, #siteNetwork#, #appTool#, #jobTaskNode#, #lastModified#)
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
</sqlMap>

View File

@@ -1,37 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="alfresco.content">
<insert id="insert_Mimetype" parameterClass="Mimetype" >
<include refid="insert_Mimetype_AutoIncrement"/>
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
<insert id="insert_Encoding" parameterClass="Encoding" >
<include refid="insert_Encoding_AutoIncrement"/>
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
<insert id="insert_ContentUrl" parameterClass="ContentUrl" >
<include refid="insert_ContentUrl_AutoIncrement"/>
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
<insert id="insert_ContentData" parameterClass="ContentData" >
<include refid="insert_ContentData_AutoIncrement"/>
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
</sqlMap>

View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="alfresco.lock">
<insert id="insert_LockResource" parameterClass="LockResource" >
<include refid="insert_LockResource_AutoIncrement"/>
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
<insert id="insert_Lock" parameterClass="Lock" >
<include refid="insert_Lock_AutoIncrement"/>
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
</sqlMap>

View File

@@ -1842,8 +1842,8 @@
<ref bean="qnameDAO" />
</property>
</bean>
<bean id="patch.db-V3.2-ContentTables" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
<bean id="patch.db-V3.2-ContentTables" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
<property name="id"><value>patch.db-V3.2-ContentTables</value></property>
<property name="description"><value>patch.schemaUpgradeScript.description</value></property>
<property name="fixesFromSchema"><value>0</value></property>
@@ -1921,4 +1921,16 @@
</property>
</bean>
<bean id="patch.db-V3.1-Allow-IPv6" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
<property name="id"><value>patch.db-V3.1-Allow-IPv6</value></property>
<property name="description"><value>patch.schemaUpgradeScript.description</value></property>
<property name="fixesFromSchema"><value>0</value></property>
<property name="fixesToSchema"><value>3003</value></property>
<property name="targetSchema"><value>3004</value></property>
<property name="scriptUrl">
<!-- Share a create script -->
<value>classpath:alfresco/dbscripts/upgrade/3.1/${db.script.dialect}/IPv6-patch.sql</value>
</property>
</bean>
</beans>

View File

@@ -19,4 +19,4 @@ version.build=@build-number@
# Schema number
version.schema=3003
version.schema=3004

View File

@@ -50,7 +50,7 @@
<generator class="native" />
</id>
<natural-id>
<property name="ipAddress" column="ip_address" type="string" length="15" not-null="true" />
<property name="ipAddress" column="ip_address" type="string" length="39" not-null="true" />
</natural-id>
<!-- Optimistic locking -->
<version column="version" name="version" type="long" />

View File

@@ -1,149 +1,149 @@
/*
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have received a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.repo.security.authentication;
import net.sf.acegisecurity.Authentication;
import net.sf.acegisecurity.GrantedAuthority;
import net.sf.acegisecurity.GrantedAuthorityImpl;
import net.sf.acegisecurity.UserDetails;
import net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken;
import net.sf.acegisecurity.providers.dao.User;
import org.alfresco.repo.tenant.TenantService;
import org.alfresco.service.cmr.security.PermissionService;
/**
* @author Andy Hind
* @author dward
*/
public class AuthenticationContextImpl implements AuthenticationContext
{
private TenantService tenantService;
public void setTenantService(TenantService tenantService)
{
this.tenantService = tenantService;
}
/**
* Explicitly set the given validated user details to be authenticated.
*
* @param ud
* the User Details
* @return Authentication
*/
public Authentication setUserDetails(UserDetails ud)
{
try
{
UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(ud, "", ud
.getAuthorities());
auth.setDetails(ud);
auth.setAuthenticated(true);
return setCurrentAuthentication(auth);
}
catch (net.sf.acegisecurity.AuthenticationException ae)
{
throw new AuthenticationException(ae.getMessage(), ae);
}
finally
{
// Support for logging tenantdomain / username (via log4j NDC)
AuthenticationUtil.logNDC(ud.getUsername());
}
}
public Authentication setSystemUserAsCurrentUser()
{
return setSystemUserAsCurrentUser(TenantService.DEFAULT_DOMAIN);
}
public Authentication setSystemUserAsCurrentUser(String tenantDomain)
{
GrantedAuthority[] gas = new GrantedAuthority[1];
gas[0] = new GrantedAuthorityImpl("ROLE_SYSTEM");
return setUserDetails(new User(getSystemUserName(tenantDomain), "", true, true, true, true, gas));
}
public String getSystemUserName()
{
return AuthenticationUtil.SYSTEM_USER_NAME;
}
public String getSystemUserName(String tenantDomain)
{
return this.tenantService.getDomainUser(getSystemUserName(), tenantDomain);
}
public boolean isSystemUserName(String userName)
{
return getSystemUserName().equals(this.tenantService.getBaseNameUser(userName));
}
public boolean isCurrentUserTheSystemUser()
{
return isSystemUserName(getCurrentUserName());
}
public String getGuestUserName(String tenantDomain)
{
return this.tenantService.getDomainUser(getGuestUserName(), tenantDomain);
}
public String getGuestUserName()
{
return PermissionService.GUEST_AUTHORITY.toLowerCase();
}
public boolean isGuestUserName(String userName)
{
return PermissionService.GUEST_AUTHORITY.equalsIgnoreCase(this.tenantService.getBaseNameUser(userName));
}
public Authentication setCurrentAuthentication(Authentication authentication)
{
return AuthenticationUtil.setFullAuthentication(authentication);
}
public Authentication getCurrentAuthentication() throws AuthenticationException
{
return AuthenticationUtil.getFullAuthentication();
}
public String getCurrentUserName() throws AuthenticationException
{
return AuthenticationUtil.getFullyAuthenticatedUser();
}
public void clearCurrentSecurityContext()
{
AuthenticationUtil.clearCurrentSecurityContext();
}
public String getUserDomain(String userName)
{
return this.tenantService.getUserDomain(userName);
}
}
/*
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have received a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.repo.security.authentication;
import net.sf.acegisecurity.Authentication;
import net.sf.acegisecurity.GrantedAuthority;
import net.sf.acegisecurity.GrantedAuthorityImpl;
import net.sf.acegisecurity.UserDetails;
import net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken;
import net.sf.acegisecurity.providers.dao.User;
import org.alfresco.repo.tenant.TenantService;
import org.alfresco.service.cmr.security.PermissionService;
/**
* @author Andy Hind
* @author dward
*/
public class AuthenticationContextImpl implements AuthenticationContext
{
private TenantService tenantService;
public void setTenantService(TenantService tenantService)
{
this.tenantService = tenantService;
}
/**
* Explicitly set the given validated user details to be authenticated.
*
* @param ud
* the User Details
* @return Authentication
*/
public Authentication setUserDetails(UserDetails ud)
{
try
{
UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(ud, "", ud
.getAuthorities());
auth.setDetails(ud);
auth.setAuthenticated(true);
return setCurrentAuthentication(auth);
}
catch (net.sf.acegisecurity.AuthenticationException ae)
{
throw new AuthenticationException(ae.getMessage(), ae);
}
finally
{
// Support for logging tenantdomain / username (via log4j NDC)
AuthenticationUtil.logNDC(ud.getUsername());
}
}
public Authentication setSystemUserAsCurrentUser()
{
return setSystemUserAsCurrentUser(TenantService.DEFAULT_DOMAIN);
}
public Authentication setSystemUserAsCurrentUser(String tenantDomain)
{
GrantedAuthority[] gas = new GrantedAuthority[1];
gas[0] = new GrantedAuthorityImpl("ROLE_SYSTEM");
return setUserDetails(new User(getSystemUserName(tenantDomain), "", true, true, true, true, gas));
}
public String getSystemUserName()
{
return AuthenticationUtil.SYSTEM_USER_NAME;
}
public String getSystemUserName(String tenantDomain)
{
return this.tenantService.getDomainUser(getSystemUserName(), tenantDomain);
}
public boolean isSystemUserName(String userName)
{
return getSystemUserName().equals(this.tenantService.getBaseNameUser(userName));
}
public boolean isCurrentUserTheSystemUser()
{
return isSystemUserName(getCurrentUserName());
}
public String getGuestUserName(String tenantDomain)
{
return this.tenantService.getDomainUser(getGuestUserName(), tenantDomain);
}
public String getGuestUserName()
{
return AuthenticationUtil.getGuestUserName();
}
public boolean isGuestUserName(String userName)
{
return AuthenticationUtil.getGuestUserName().equalsIgnoreCase(this.tenantService.getBaseNameUser(userName));
}
public Authentication setCurrentAuthentication(Authentication authentication)
{
return AuthenticationUtil.setFullAuthentication(authentication);
}
public Authentication getCurrentAuthentication() throws AuthenticationException
{
return AuthenticationUtil.getFullAuthentication();
}
public String getCurrentUserName() throws AuthenticationException
{
return AuthenticationUtil.getFullyAuthenticatedUser();
}
public void clearCurrentSecurityContext()
{
AuthenticationUtil.clearCurrentSecurityContext();
}
public String getUserDomain(String userName)
{
return this.tenantService.getUserDomain(userName);
}
}