Handles setting of remote user attribute.

@param remoteUser new remote user name
559491
private void handleRemoteUser(final Object remoteUser) {
		if (request != null) {
			Principal userPrincipal = null;
			if (remoteUser != null) {
				// be defensive
				if (!(remoteUser instanceof String)) {
					final String message = "Attribute "
							+ HttpContext.REMOTE_USER
							+ " expected to be a String but was an ["
							+ remoteUser.getClass() + "]";
					LOG.error(message);
					throw new IllegalArgumentException(message);
				}
				userPrincipal = new User((String) remoteUser);
			}
			getOsgiAuth().setUserPrincipal(userPrincipal);
		} else {
			LOG.warn("Remote user cannot be set to "
					+ remoteUser
					+ ". HttpService specific authentication is disabled because the ServletRequest object cannot be used: "
					+ "Expected to be an instance of "
					+ Request.class.getName() + " but got "
					+ originalRequest.getClass().getName() + ".");
		}
	}
786012
@Override
    public void remoteInvalidate(String sessionId, boolean backendUpdate) {
        super.remoteInvalidate(sessionId, backendUpdate);

        if (backendUpdate) {
            ((CacheHashMap) _sessions).setMaxInactToZero(sessionId, getId());
        }

        // now clean this session out of cache -- we do this even if not doing db inval
        Enumeration<String> e = Collections.enumeration(Collections.singleton(sessionId));
        ((BackedHashMap) _sessions).handleDiscardedCacheItems(e);
    }
383855
public void handleUpdateUser(String jsonp, String target,
            HttpServletRequest request,
            HttpServletResponse response, AuthenticationResult ar)
            throws IOException, ServletException {
        String update = request.getParameter("user");
        if (update == null || update.trim().length() == 0) {
            response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
            response.getWriter().print(buildClientResponse(jsonp, ClientResponse.UNEXPECTED_FAILURE, "Failed to get user information."));
            return;
        }
        try {
            User newUser = m_mapper.readValue(update, User.class);
            if (newUser == null) {
                response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
                response.getWriter().print(buildClientResponse(jsonp, ClientResponse.UNEXPECTED_FAILURE, "Failed to parse user information."));
                return;
            }

            DeploymentType newDeployment = CatalogUtil.getDeployment(new ByteArrayInputStream(getDeploymentBytes()));
            User user = null;
            String[] splitTarget = target.split("/");
            if (splitTarget.length == 3) {
                user = findUser(splitTarget[2], newDeployment);
            }
            if (user == null) {
                response.setStatus(HttpServletResponse.SC_NOT_FOUND);
                response.getWriter().print(buildClientResponse(jsonp, ClientResponse.UNEXPECTED_FAILURE, "User not found"));
                return;
            }
            user.setName(newUser.getName());
            user.setPassword(newUser.getPassword());
            user.setPlaintext(newUser.isPlaintext());
            user.setRoles(newUser.getRoles());

            String dep = CatalogUtil.getDeployment(newDeployment);
            if (dep == null || dep.trim().length() <= 0) {
                response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
                response.getWriter().print(buildClientResponse(jsonp, ClientResponse.UNEXPECTED_FAILURE, "Failed to build deployment information."));
                return;
            }
            Object[] params = new Object[]{null, dep};
            //Call sync as nothing else can happen when this is going on.
            SyncCallback cb = new SyncCallback();
            httpClientInterface.callProcedure(request.getRemoteHost(), ar, BatchTimeoutOverrideType.NO_TIMEOUT, cb, "@UpdateApplicationCatalog", params);
            cb.waitForResponse();
            ClientResponseImpl r = ClientResponseImpl.class.cast(cb.getResponse());
            if (r.getStatus() == ClientResponse.SUCCESS) {
                response.getWriter().print(buildClientResponse(jsonp, ClientResponse.SUCCESS, "User Updated."));
            } else {
                response.getWriter().print(HTTPClientInterface.asJsonp(jsonp, r.toJSONString()));
            }

        } catch (Exception ex) {
            m_log.error("Failed to update user from API", ex);
            response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
            response.getWriter().print(buildClientResponse(jsonp, ClientResponse.UNEXPECTED_FAILURE, Throwables.getStackTraceAsString(ex)));
        }
    }
500062
protected void setUserData(CmsUser user, CmsListItem item) {

        item.set(LIST_COLUMN_LOGIN, user.getName());
        item.set(LIST_COLUMN_DISPLAY, user.getSimpleName());
        item.set(LIST_COLUMN_NAME, user.getFullName());
        item.set(LIST_COLUMN_EMAIL, user.getEmail());
        item.set(LIST_COLUMN_LASTLOGIN, new Date(user.getLastlogin()));
        item.set(LIST_COLUMN_ENABLED, new Boolean(user.isEnabled()));
    }
468764
@Override
    public void setUserName(String userName) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setUserName", userName);
        jcaManagedConnectionFactory.setUserName(userName);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setUserName");
    }
136527
public void setUser(String user, boolean isSIBServerSubject)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setUser", user);

        this.user = user;
        this.isSIBServerSubject = isSIBServerSubject;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setUser");
    }
30673
private void setDefaultUserAgent() {
        setUserAgent(
                MwsUtl.escapeAppName(applicationName),
                MwsUtl.escapeAppVersion(applicationVersion),
                MwsUtl.escapeAttributeValue("Java/"
                        + System.getProperty("java.version") + "/"
                        + System.getProperty("java.class.version") + "/"
                        + System.getProperty("java.vendor")),

                MwsUtl.escapeAttributeName("Platform"),
                MwsUtl.escapeAttributeValue("" + System.getProperty("os.name")
                        + "/" + System.getProperty("os.arch") + "/"
                        + System.getProperty("os.version")),

                MwsUtl.escapeAttributeName("MWSClientVersion"),
                MwsUtl.escapeAttributeValue(libraryVersion));
    }
394064
public void enableUserDefinedRPC() {
        int enabledRpc = scannerParam.getTargetParamsEnabledRPC();
        enabledRpc |= ScannerParam.RPC_USERDEF;
        scannerParam.setTargetParamsEnabledRPC(enabledRpc);
    }
830248
public void setUserParam(String user) {
		try {
			getSipURI().setUserParam(user);
			super.parameters.put(USER, user);
		} catch (ParseException e) {
			logger.error("error setting parameter ", e);
		}
	}
487378
public final void setUserid(String value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setUserid", value);
        getApi().setField(JsApiAccess.USERID, value);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setUserid");
    }
1147181
synchronized void setRemoteID(final String evaluatorRID) {
    if (this.wrapped.isPresent()) {
      throw new IllegalStateException("Trying to reset the evaluator ID. This isn't supported.");
    } else {
      LOG.log(Level.FINE, "Registering remoteId [{0}] for Evaluator [{1}]", new Object[]{evaluatorRID, evaluatorId});
      this.wrapped = Optional.of(remoteManager.getHandler(evaluatorRID,
          EvaluatorRuntimeProtocol.EvaluatorControlProto.class));
    }
  }
117138
public void setRemoteAccessSessions(java.util.Collection<RemoteAccessSession> remoteAccessSessions) {
        if (remoteAccessSessions == null) {
            this.remoteAccessSessions = null;
            return;
        }

        this.remoteAccessSessions = new java.util.ArrayList<RemoteAccessSession>(remoteAccessSessions);
    }
1361931
public void setUser(final String user) {
        final String old = this.user;

        this.user = user;
        this.connectionConfig = System.currentTimeMillis();
        this.connectionValidated = false;

        this.pcs.firePropertyChange("user", old, this.user);
    }
1297783
public void setUserInfo(String username, String infoName, String value) throws CmsException {

        CmsUser user = m_cms.readUser(username);
        user.setAdditionalInfo(infoName, value);
        m_cms.writeUser(user);
    }
518111
public void setRemoteProperty(String strProperty, String strValue) throws RemoteException
    {
        m_tableRemote.setRemoteProperty(strProperty, strValue);
    }
183084
private void updateUser(CmsUser user) {

        setUserPasswordStatus(user, m_forceResetPassword.getValue().booleanValue());
        user.setDescription(m_description.getValue());
        user.setManaged(!m_selfmanagement.getValue().booleanValue());
        user.setEnabled(m_enabled.getValue().booleanValue());
        m_userdata.submit(user, m_cms, new Runnable() {

            public void run() {
                //
            }
        }, true);
    }
1037135
public void setAddrs(InetAddress _remote, InetAddress _local) {
        this.addrRemote = _remote;
        this.addrLocal = _local;
        this.remoteHostName = null;
        this.remoteHostAddress = null;
        this.localHostName = null;
        this.localHostAddress = null;
    }