mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Properly wrapped AttributeService for remoting.
Wired remote AttributeService into virtualization server. Added AVMLockingService to ServiceRegistry. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5570 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2007 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 recieved 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.attributes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.service.cmr.attributes.AttrQuery;
|
||||
import org.alfresco.service.cmr.attributes.AttributeService;
|
||||
import org.alfresco.service.cmr.remote.AttributeServiceTransport;
|
||||
import org.alfresco.service.cmr.security.AuthenticationService;
|
||||
import org.alfresco.util.Pair;
|
||||
|
||||
/**
|
||||
* Server side implementation of transport for AttributeService.
|
||||
* @author britt
|
||||
*/
|
||||
public class AttributeServiceTransportService implements
|
||||
AttributeServiceTransport
|
||||
{
|
||||
private AttributeService fService;
|
||||
|
||||
private AuthenticationService fAuthService;
|
||||
|
||||
public AttributeServiceTransportService()
|
||||
{
|
||||
}
|
||||
|
||||
public void setAttributeService(AttributeService service)
|
||||
{
|
||||
fService = service;
|
||||
}
|
||||
|
||||
public void setAuthenticationService(AuthenticationService service)
|
||||
{
|
||||
fAuthService = service;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#addAttribute(java.lang.String, java.lang.String, org.alfresco.repo.attributes.Attribute)
|
||||
*/
|
||||
public void addAttribute(String ticket, String path, Attribute value)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
fService.addAttribute(path, value);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#addAttribute(java.lang.String, java.util.List, org.alfresco.repo.attributes.Attribute)
|
||||
*/
|
||||
public void addAttribute(String ticket, List<String> keys, Attribute value)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
fService.addAttribute(keys, value);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#getAttribute(java.lang.String, java.lang.String)
|
||||
*/
|
||||
public Attribute getAttribute(String ticket, String path)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
return fService.getAttribute(path);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#getAttribute(java.lang.String, java.util.List)
|
||||
*/
|
||||
public Attribute getAttribute(String ticket, List<String> keys)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
return fService.getAttribute(keys);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#getKeys(java.lang.String, java.lang.String)
|
||||
*/
|
||||
public List<String> getKeys(String ticket, String path)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
return fService.getKeys(path);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#getKeys(java.lang.String, java.util.List)
|
||||
*/
|
||||
public List<String> getKeys(String ticket, List<String> keys)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
return fService.getKeys(keys);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#query(java.lang.String, java.lang.String, org.alfresco.service.cmr.attributes.AttrQuery)
|
||||
*/
|
||||
public List<Pair<String, Attribute>> query(String ticket, String path,
|
||||
AttrQuery query)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
return fService.query(path, query);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#query(java.lang.String, java.util.List, org.alfresco.service.cmr.attributes.AttrQuery)
|
||||
*/
|
||||
public List<Pair<String, Attribute>> query(String ticket,
|
||||
List<String> keys, AttrQuery query)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
return fService.query(keys, query);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#removeAttribute(java.lang.String, java.lang.String, java.lang.String)
|
||||
*/
|
||||
public void removeAttribute(String ticket, String path, String name)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
fService.removeAttribute(path, name);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#removeAttribute(java.lang.String, java.util.List, java.lang.String)
|
||||
*/
|
||||
public void removeAttribute(String ticket, List<String> keys, String name)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
fService.removeAttribute(keys, name);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#removeAttribute(java.lang.String, java.lang.String, int)
|
||||
*/
|
||||
public void removeAttribute(String ticket, String path, int index)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
fService.removeAttribute(path, index);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#removeAttribute(java.lang.String, java.util.List, int)
|
||||
*/
|
||||
public void removeAttribute(String ticket, List<String> keys, int index)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
fService.removeAttribute(keys, index);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#setAttribute(java.lang.String, java.lang.String, java.lang.String, org.alfresco.repo.attributes.Attribute)
|
||||
*/
|
||||
public void setAttribute(String ticket, String path, String name,
|
||||
Attribute value)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
fService.setAttribute(path, name, value);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#setAttribute(java.lang.String, java.util.List, java.lang.String, org.alfresco.repo.attributes.Attribute)
|
||||
*/
|
||||
public void setAttribute(String ticket, List<String> keys, String name,
|
||||
Attribute value)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
fService.setAttribute(keys, name, value);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#setAttribute(java.lang.String, java.lang.String, int, org.alfresco.repo.attributes.Attribute)
|
||||
*/
|
||||
public void setAttribute(String ticket, String path, int index,
|
||||
Attribute value)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
fService.setAttribute(path, index, value);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.attributes.AttributeServiceTransport#setAttribute(java.lang.String, java.util.List, int, org.alfresco.repo.attributes.Attribute)
|
||||
*/
|
||||
public void setAttribute(String ticket, List<String> keys, int index,
|
||||
Attribute value)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
fService.setAttribute(keys, index, value);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user