class RemoteOperations implements SessionOperations {

    public void setProperty(Session session, String name, String value) throws SessionException {
        if (debug.messageEnabled()) {
            debug.message(MessageFormat.format(
                    "Remote setProperty {0} {1}={2}",
                    session,
                    name,
                    value));
        }

        SessionID sessionID = session.getID();
        SessionRequest sreq = new SessionRequest(
                SessionRequest.SetProperty, sessionID.toString(), false);
        sreq.setPropertyName(name);
        sreq.setPropertyValue(value);
        if (SystemProperties.isServerMode() && InternalSession.isProtectedProperty(name) ) {
            try {
                SSOToken admSSOToken = SessionUtils.getAdminToken();
                sreq.setRequester(RestrictedTokenContext.marshal(admSSOToken));
            } catch (SSOException e) {
                throw new SessionException(e);
            } catch (Exception e) {
                throw new SessionException(e);
            }

            if (debug.messageEnabled()) {
                debug.message("Session.setProperty: "
                        + "added admSSOToken in sreq to set "
                        + "externalProtectedProperty in remote server");
            }
        }
        requests.sendRequestWithRetry(session.getSessionServiceURL(), sreq, session);
    }

    @Inject public  RemoteOperations(@Named(SessionConstants.SESSION_DEBUG) Debug debug, Requests requests);

}