Omaha #3398 moved user and userid to core
Change-Id: Id9da2ef25a309c1bbc53f24a59ed2fd1ddbb0407 Former-commit-id: a758b7aff6b30194a3180fddffcefa5d019f2ee5
This commit is contained in:
parent
2db03d95b3
commit
ec37971eff
7 changed files with 54 additions and 193 deletions
|
@ -1,7 +0,0 @@
|
||||||
#Wed May 26 15:16:32 CDT 2010
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.6
|
|
|
@ -2,13 +2,13 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Nws Auth Plug-in
|
Bundle-Name: Nws Auth Plug-in
|
||||||
Bundle-SymbolicName: com.raytheon.uf.viz.plugin.nwsauth;singleton:=true
|
Bundle-SymbolicName: com.raytheon.uf.viz.plugin.nwsauth;singleton:=true
|
||||||
Bundle-Version: 1.12.1174.qualifier
|
Bundle-Version: 1.14.0.qualifier
|
||||||
Bundle-Activator: com.raytheon.uf.viz.plugin.nwsauth.Activator
|
Bundle-Activator: com.raytheon.uf.viz.plugin.nwsauth.Activator
|
||||||
Bundle-Vendor: RAYTHEON
|
Bundle-Vendor: RAYTHEON
|
||||||
Require-Bundle: org.eclipse.core.runtime,
|
Require-Bundle: org.eclipse.core.runtime,
|
||||||
com.raytheon.uf.common.auth,
|
com.raytheon.uf.common.auth,
|
||||||
com.raytheon.uf.common.plugin.nwsauth,
|
com.raytheon.uf.common.plugin.nwsauth,
|
||||||
com.raytheon.uf.viz.core
|
com.raytheon.uf.viz.core
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Export-Package: com.raytheon.uf.viz.plugin.nwsauth
|
Export-Package: com.raytheon.uf.viz.plugin.nwsauth
|
||||||
|
|
|
@ -21,12 +21,9 @@ package com.raytheon.uf.viz.plugin.nwsauth;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.raytheon.uf.common.auth.user.IAuthenticationData;
|
|
||||||
import com.raytheon.uf.common.auth.user.IPermission;
|
import com.raytheon.uf.common.auth.user.IPermission;
|
||||||
import com.raytheon.uf.common.auth.user.IRole;
|
import com.raytheon.uf.common.auth.user.IRole;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.viz.core.auth.BasicUserManager;
|
||||||
import com.raytheon.uf.common.plugin.nwsauth.user.User;
|
|
||||||
import com.raytheon.uf.viz.core.auth.IUserManager;
|
|
||||||
import com.raytheon.uf.viz.core.requests.INotAuthHandler;
|
import com.raytheon.uf.viz.core.requests.INotAuthHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,6 +36,7 @@ import com.raytheon.uf.viz.core.requests.INotAuthHandler;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* May 27, 2010 rgeorge Initial creation
|
* May 27, 2010 rgeorge Initial creation
|
||||||
* Jun 07, 2013 1981 mpduff Add an IUser field.
|
* Jun 07, 2013 1981 mpduff Add an IUser field.
|
||||||
|
* Oct 06, 2014 3398 bclement now extends BasicUserManager
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -46,13 +44,10 @@ import com.raytheon.uf.viz.core.requests.INotAuthHandler;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class NwsUserManager implements IUserManager {
|
public class NwsUserManager extends BasicUserManager {
|
||||||
|
|
||||||
private final NwsNotAuthHandler notAuthHandler = new NwsNotAuthHandler();
|
private final NwsNotAuthHandler notAuthHandler = new NwsNotAuthHandler();
|
||||||
|
|
||||||
/** Saved User Name */
|
|
||||||
private IUser user;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -63,35 +58,6 @@ public class NwsUserManager implements IUserManager {
|
||||||
return notAuthHandler;
|
return notAuthHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see com.raytheon.uf.viz.core.auth.IUserManager#getUserObject()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public IUser getUserObject() {
|
|
||||||
if (this.user == null) {
|
|
||||||
String userId = System.getProperty("user.name");
|
|
||||||
this.user = new User(userId);
|
|
||||||
return this.user;
|
|
||||||
} else {
|
|
||||||
return user;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* com.raytheon.uf.viz.core.auth.IUserManager#updateUserObject(com.raytheon
|
|
||||||
* .uf.common.auth.user.IUser,
|
|
||||||
* com.raytheon.uf.common.auth.user.IAuthenticationData)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void updateUserObject(IUser user, IAuthenticationData authData) {
|
|
||||||
this.user = user;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -110,11 +76,4 @@ public class NwsUserManager implements IUserManager {
|
||||||
return NwsRoleDataManager.getInstance().getRoles(application);
|
return NwsRoleDataManager.getInstance().getRoles(application);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void updateUserObject(String userId, IAuthenticationData authData) {
|
|
||||||
user = new User(userId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,5 @@ Require-Bundle: com.raytheon.uf.common.serialization;bundle-version="1.12.2",
|
||||||
org.apache.commons.lang;bundle-version="2.3.0"
|
org.apache.commons.lang;bundle-version="2.3.0"
|
||||||
Export-Package: com.raytheon.uf.common.plugin.nwsauth,
|
Export-Package: com.raytheon.uf.common.plugin.nwsauth,
|
||||||
com.raytheon.uf.common.plugin.nwsauth.exception,
|
com.raytheon.uf.common.plugin.nwsauth.exception,
|
||||||
com.raytheon.uf.common.plugin.nwsauth.user,
|
|
||||||
com.raytheon.uf.common.plugin.nwsauth.xml
|
com.raytheon.uf.common.plugin.nwsauth.xml
|
||||||
Import-Package: com.raytheon.uf.common.plugin.nwsauth.exception
|
Import-Package: com.raytheon.uf.common.plugin.nwsauth.exception
|
||||||
|
|
|
@ -1,10 +1,25 @@
|
||||||
|
/**
|
||||||
|
* This software was developed and / or modified by Raytheon Company,
|
||||||
|
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||||
|
*
|
||||||
|
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||||
|
* This software product contains export-restricted data whose
|
||||||
|
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||||
|
* to non-U.S. persons whether in the United States or abroad requires
|
||||||
|
* an export license or other authorization.
|
||||||
|
*
|
||||||
|
* Contractor Name: Raytheon Company
|
||||||
|
* Contractor Address: 6825 Pine Street, Suite 340
|
||||||
|
* Mail Stop B8
|
||||||
|
* Omaha, NE 68106
|
||||||
|
* 402.291.0100
|
||||||
|
*
|
||||||
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
|
* further licensing information.
|
||||||
|
**/
|
||||||
package com.raytheon.uf.common.plugin.nwsauth.user;
|
package com.raytheon.uf.common.plugin.nwsauth.user;
|
||||||
|
|
||||||
import com.raytheon.uf.common.auth.user.AuthenticationData;
|
|
||||||
import com.raytheon.uf.common.auth.user.IAuthenticationData;
|
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of IUser
|
* Implementation of IUser
|
||||||
|
@ -15,92 +30,17 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* May 26, 2010 rgeorge Initial creation
|
* May 26, 2010 rgeorge Initial creation
|
||||||
|
* Oct 06, 2014 3398 bclement moved to common.auth
|
||||||
|
* left extension for backwards compatibility
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author rgeorge
|
* @author rgeorge
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
|
* @deprecated use com.raytheon.uf.common.auth.user.User
|
||||||
*/
|
*/
|
||||||
@DynamicSerialize
|
@DynamicSerialize
|
||||||
public class User implements IUser {
|
@Deprecated
|
||||||
|
public class User extends com.raytheon.uf.common.auth.user.User {
|
||||||
@DynamicSerializeElement
|
|
||||||
private UserId userId;
|
|
||||||
|
|
||||||
@DynamicSerializeElement
|
|
||||||
private AuthenticationData authenticationData;
|
|
||||||
|
|
||||||
public User() {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public User(String userId) {
|
|
||||||
setUserId(new UserId(userId));
|
|
||||||
}
|
|
||||||
|
|
||||||
public UserId getUserId() {
|
|
||||||
return userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserId(UserId userId) {
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AuthenticationData getAuthenticationData() {
|
|
||||||
return authenticationData;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAuthenticationData(AuthenticationData authenticationData) {
|
|
||||||
this.authenticationData = authenticationData;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public UserId uniqueId() {
|
|
||||||
return userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IAuthenticationData authenticationData() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return this.authenticationData;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return this.getClass().getName() + "[userId = " + userId.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = 1;
|
|
||||||
result = prime
|
|
||||||
* result
|
|
||||||
+ ((authenticationData == null) ? 0 : authenticationData
|
|
||||||
.hashCode());
|
|
||||||
result = prime * result + ((userId == null) ? 0 : userId.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if (this == obj)
|
|
||||||
return true;
|
|
||||||
if (obj == null)
|
|
||||||
return false;
|
|
||||||
if (getClass() != obj.getClass())
|
|
||||||
return false;
|
|
||||||
User other = (User) obj;
|
|
||||||
if (authenticationData == null) {
|
|
||||||
if (other.authenticationData != null)
|
|
||||||
return false;
|
|
||||||
} else if (!authenticationData.equals(other.authenticationData))
|
|
||||||
return false;
|
|
||||||
if (userId == null) {
|
|
||||||
if (other.userId != null)
|
|
||||||
return false;
|
|
||||||
} else if (!userId.equals(other.userId))
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,12 +1,28 @@
|
||||||
|
/**
|
||||||
|
* This software was developed and / or modified by Raytheon Company,
|
||||||
|
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||||
|
*
|
||||||
|
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||||
|
* This software product contains export-restricted data whose
|
||||||
|
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||||
|
* to non-U.S. persons whether in the United States or abroad requires
|
||||||
|
* an export license or other authorization.
|
||||||
|
*
|
||||||
|
* Contractor Name: Raytheon Company
|
||||||
|
* Contractor Address: 6825 Pine Street, Suite 340
|
||||||
|
* Mail Stop B8
|
||||||
|
* Omaha, NE 68106
|
||||||
|
* 402.291.0100
|
||||||
|
*
|
||||||
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
|
* further licensing information.
|
||||||
|
**/
|
||||||
package com.raytheon.uf.common.plugin.nwsauth.user;
|
package com.raytheon.uf.common.plugin.nwsauth.user;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlAttribute;
|
|
||||||
|
|
||||||
import com.raytheon.uf.common.auth.user.IUserId;
|
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of IUserId
|
* Implementation of IUserId
|
||||||
|
@ -17,64 +33,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* May 26, 2010 rgeorge Initial creation
|
* May 26, 2010 rgeorge Initial creation
|
||||||
|
* Oct 06, 2014 3398 bclement moved to common.auth
|
||||||
|
* left extension for backwards compatibility
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author rgeorge
|
* @author rgeorge
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
|
* @deprecated use com.raytheon.uf.common.auth.user.UserId
|
||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.NONE)
|
@XmlAccessorType(XmlAccessType.NONE)
|
||||||
@DynamicSerialize
|
@DynamicSerialize
|
||||||
public class UserId implements IUserId {
|
@Deprecated
|
||||||
|
public class UserId extends com.raytheon.uf.common.auth.user.UserId {
|
||||||
@DynamicSerializeElement
|
|
||||||
@XmlAttribute
|
|
||||||
String id;
|
|
||||||
|
|
||||||
public UserId() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public UserId(String id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(String id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = 1;
|
|
||||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if (this == obj)
|
|
||||||
return true;
|
|
||||||
if (obj == null)
|
|
||||||
return false;
|
|
||||||
if (getClass() != obj.getClass())
|
|
||||||
return false;
|
|
||||||
UserId other = (UserId) obj;
|
|
||||||
if (id == null) {
|
|
||||||
if (other.id != null)
|
|
||||||
return false;
|
|
||||||
} else if (!id.equals(other.id))
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,11 +26,11 @@ import java.util.List;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import com.raytheon.uf.common.auth.resp.SuccessfulExecution;
|
import com.raytheon.uf.common.auth.resp.SuccessfulExecution;
|
||||||
|
import com.raytheon.uf.common.auth.user.User;
|
||||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||||
import com.raytheon.uf.common.dissemination.OUPRequest;
|
import com.raytheon.uf.common.dissemination.OUPRequest;
|
||||||
import com.raytheon.uf.common.dissemination.OUPResponse;
|
import com.raytheon.uf.common.dissemination.OUPResponse;
|
||||||
import com.raytheon.uf.common.dissemination.OfficialUserProduct;
|
import com.raytheon.uf.common.dissemination.OfficialUserProduct;
|
||||||
import com.raytheon.uf.common.plugin.nwsauth.user.User;
|
|
||||||
import com.raytheon.uf.common.serialization.comm.RequestRouter;
|
import com.raytheon.uf.common.serialization.comm.RequestRouter;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
|
|
Loading…
Add table
Reference in a new issue