本文整理汇总了Java中org.kuali.rice.krad.bo.SessionDocument类的典型用法代码示例。如果您正苦于以下问题:Java SessionDocument类的具体用法?Java SessionDocument怎么用?Java SessionDocument使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SessionDocument类属于org.kuali.rice.krad.bo包,在下文中一共展示了SessionDocument类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: retrieveDocumentForm
import org.kuali.rice.krad.bo.SessionDocument; //导入依赖的package包/类
@Deprecated
protected Object retrieveDocumentForm(UserSession userSession, String sessionId, String documentNumber,
String ipAddress) throws Exception {
HashMap<String, String> primaryKeys = new HashMap<String, String>(4);
primaryKeys.put(SESSION_ID, sessionId);
if (documentNumber != null) {
primaryKeys.put(DOCUMENT_NUMBER, documentNumber);
}
primaryKeys.put(PRINCIPAL_ID, userSession.getPrincipalId());
primaryKeys.put(IP_ADDRESS, ipAddress);
SessionDocument sessionDoc = legacyDataAdapter.findByPrimaryKey(SessionDocument.class, primaryKeys);
if (sessionDoc != null) {
byte[] formAsBytes = sessionDoc.getSerializedDocumentForm();
if (sessionDoc.isEncrypted()) {
formAsBytes = getEncryptionService().decryptBytes(formAsBytes);
}
ByteArrayInputStream baip = new ByteArrayInputStream(formAsBytes);
ObjectInputStream ois = new ObjectInputStream(baip);
return ois.readObject();
}
return null;
}
示例2: purgeDocumentForm
import org.kuali.rice.krad.bo.SessionDocument; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.service.SessionDocumentService#purgeDocumentForm(String, String,
* org.kuali.rice.krad.UserSession, String)
*
* @deprecated (Deprecated and removed from use in KRAD (KULRICE-9149)
*/
@Override
@Deprecated
public void purgeDocumentForm(String documentNumber, String docFormKey, UserSession userSession, String ipAddress) {
synchronized (userSession) {
LOG.debug("purge document form from session");
userSession.removeObject(docFormKey);
try {
LOG.debug("purge document form from database");
HashMap<String, String> primaryKeys = new HashMap<String, String>(4);
primaryKeys.put(SESSION_ID, userSession.getKualiSessionId());
primaryKeys.put(DOCUMENT_NUMBER, documentNumber);
primaryKeys.put(PRINCIPAL_ID, userSession.getPrincipalId());
primaryKeys.put(IP_ADDRESS, ipAddress);
legacyDataAdapter.deleteMatching(SessionDocument.class, primaryKeys);
} catch (Exception e) {
LOG.error("purgeDocumentForm failed for SessId/DocNum/PrinId/IP:" + userSession.getKualiSessionId() +
"/" + documentNumber + "/" + userSession.getPrincipalId() + "/" + ipAddress, e);
}
}
}
示例3: retrieveDocumentForm
import org.kuali.rice.krad.bo.SessionDocument; //导入依赖的package包/类
@Deprecated
protected Object retrieveDocumentForm(UserSession userSession, String sessionId, String documentNumber,
String ipAddress) throws Exception {
HashMap<String, String> primaryKeys = new HashMap<String, String>(4);
primaryKeys.put(SESSION_ID, sessionId);
if (documentNumber != null) {
primaryKeys.put(DOCUMENT_NUMBER, documentNumber);
}
primaryKeys.put(PRINCIPAL_ID, userSession.getPrincipalId());
primaryKeys.put(IP_ADDRESS, ipAddress);
SessionDocument sessionDoc = getBusinessObjectService().findByPrimaryKey(SessionDocument.class, primaryKeys);
if (sessionDoc != null) {
byte[] formAsBytes = sessionDoc.getSerializedDocumentForm();
if (sessionDoc.isEncrypted()) {
formAsBytes = getEncryptionService().decryptBytes(formAsBytes);
}
ByteArrayInputStream baip = new ByteArrayInputStream(formAsBytes);
ObjectInputStream ois = new ObjectInputStream(baip);
return ois.readObject();
}
return null;
}
示例4: purgeDocumentForm
import org.kuali.rice.krad.bo.SessionDocument; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.service.SessionDocumentService#purgeDocumentForm(String, String,
* org.kuali.rice.krad.UserSession, String)
*
* @deprecated (Deprecated and removed from use in KRAD (KULRICE-9149)
*/
@Override
@Deprecated
public void purgeDocumentForm(String documentNumber, String docFormKey, UserSession userSession, String ipAddress) {
synchronized (userSession) {
LOG.debug("purge document form from session");
userSession.removeObject(docFormKey);
try {
LOG.debug("purge document form from database");
HashMap<String, String> primaryKeys = new HashMap<String, String>(4);
primaryKeys.put(SESSION_ID, userSession.getKualiSessionId());
primaryKeys.put(DOCUMENT_NUMBER, documentNumber);
primaryKeys.put(PRINCIPAL_ID, userSession.getPrincipalId());
primaryKeys.put(IP_ADDRESS, ipAddress);
getBusinessObjectService().deleteMatching(SessionDocument.class, primaryKeys);
} catch (Exception e) {
LOG.error("purgeDocumentForm failed for SessId/DocNum/PrinId/IP:" + userSession.getKualiSessionId() +
"/" + documentNumber + "/" + userSession.getPrincipalId() + "/" + ipAddress, e);
}
}
}
示例5: retrieveDocumentForm
import org.kuali.rice.krad.bo.SessionDocument; //导入依赖的package包/类
protected Object retrieveDocumentForm(UserSession userSession, String sessionId, String documentNumber,
String ipAddress) throws Exception {
HashMap<String, String> primaryKeys = new HashMap<String, String>(4);
primaryKeys.put(SESSION_ID, sessionId);
if (documentNumber != null) {
primaryKeys.put(DOCUMENT_NUMBER, documentNumber);
}
primaryKeys.put(PRINCIPAL_ID, userSession.getPrincipalId());
primaryKeys.put(IP_ADDRESS, ipAddress);
SessionDocument sessionDoc = getBusinessObjectService().findByPrimaryKey(SessionDocument.class, primaryKeys);
if (sessionDoc != null) {
byte[] formAsBytes = sessionDoc.getSerializedDocumentForm();
if (sessionDoc.isEncrypted()) {
formAsBytes = getEncryptionService().decryptBytes(formAsBytes);
}
ByteArrayInputStream baip = new ByteArrayInputStream(formAsBytes);
ObjectInputStream ois = new ObjectInputStream(baip);
return ois.readObject();
}
return null;
}
示例6: purgeDocumentForm
import org.kuali.rice.krad.bo.SessionDocument; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.service.SessionDocumentService#purgeDocumentForm(String
* documentNumber, String docFormKey, UserSession userSession)
*/
@Override
public void purgeDocumentForm(String documentNumber, String docFormKey, UserSession userSession, String ipAddress) {
synchronized (userSession) {
LOG.debug("purge document form from session");
userSession.removeObject(docFormKey);
try {
LOG.debug("purge document form from database");
HashMap<String, String> primaryKeys = new HashMap<String, String>(4);
primaryKeys.put(SESSION_ID, userSession.getKualiSessionId());
primaryKeys.put(DOCUMENT_NUMBER, documentNumber);
primaryKeys.put(PRINCIPAL_ID, userSession.getPrincipalId());
primaryKeys.put(IP_ADDRESS, ipAddress);
getBusinessObjectService().deleteMatching(SessionDocument.class, primaryKeys);
} catch (Exception e) {
LOG.error("purgeDocumentForm failed for SessId/DocNum/PrinId/IP:" + userSession.getKualiSessionId() +
"/" + documentNumber + "/" + userSession.getPrincipalId() + "/" + ipAddress, e);
}
}
}
示例7: purgeAllSessionDocuments
import org.kuali.rice.krad.bo.SessionDocument; //导入依赖的package包/类
public void purgeAllSessionDocuments(Timestamp expirationDate)throws DataAccessException {
Criteria criteria = new Criteria();
criteria.addLessThan(KRADPropertyConstants.LAST_UPDATED_DATE, expirationDate);
getPersistenceBrokerTemplate().deleteByQuery(QueryFactory.newQuery(SessionDocument.class, criteria));
//getPersistenceBrokerTemplate().clearCache();
}
示例8: purgeAllSessionDocuments
import org.kuali.rice.krad.bo.SessionDocument; //导入依赖的package包/类
public void purgeAllSessionDocuments(Timestamp expirationDate) {
getDao(SessionDocument.class).purgeAllSessionDocuments(expirationDate);
}
示例9: purgeAllSessionDocuments
import org.kuali.rice.krad.bo.SessionDocument; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.dao.SessionDocumentDao#purgeAllSessionDocuments(java.sql.Timestamp)
*/
public void purgeAllSessionDocuments(Timestamp expirationDate) {
Criteria criteria = new Criteria(SessionDocument.class.getName());
criteria.lt(KRADPropertyConstants.LAST_UPDATED_DATE, expirationDate);
new QueryByCriteria(entityManager, criteria, QueryByCriteriaType.DELETE).toQuery().executeUpdate();
}