Files
.externalToolBuilders
config
source
cpp
java
org
alfresco
example
filesys
jcr
linkvalidation
model
repo
action
admin
attributes
hibernate
AtrributeMethodNotImplemented.java
AttrQueryHelperImpl.java
AttrQueryTest.java
Attribute.java
AttributeConverter.java
AttributeDAO.java
AttributeImpl.java
AttributeMethodNotImplemented.java
AttributeServiceImpl.java
AttributeServiceTest.java
AttributeServiceTransportService.java
AttributeUnsupportedQueryType.java
AttributeValue.java
BooleanAttribute.java
BooleanAttributeImpl.java
BooleanAttributeValue.java
ByteAttribute.java
ByteAttributeImpl.java
ByteAttributeValue.java
DoubleAttribute.java
DoubleAttributeImpl.java
DoubleAttributeValue.java
FloatAttribute.java
FloatAttributeImpl.java
FloatAttributeValue.java
GlobalAttributeEntry.java
GlobalAttributeEntryDAO.java
GlobalAttributeEntryImpl.java
IntAttribute.java
IntAttributeImpl.java
IntAttributeValue.java
ListAttribute.java
ListAttributeImpl.java
ListAttributeValue.java
ListEntry.java
ListEntryDAO.java
ListEntryImpl.java
ListEntryKey.java
LongAttribute.java
LongAttributeImpl.java
LongAttributeValue.java
MapAttribute.java
MapAttributeImpl.java
MapAttributeValue.java
MapEntry.java
MapEntryDAO.java
MapEntryImpl.java
MapEntryKey.java
SerializableAttribute.java
SerializableAttributeImpl.java
SerializableAttributeValue.java
ShortAttribute.java
ShortAttributeImpl.java
ShortAttributeValue.java
StringAttribute.java
StringAttributeImpl.java
StringAttributeValue.java
audit
avm
cache
clt
coci
configuration
content
copy
deploy
descriptor
dictionary
domain
exporter
forum
importer
jscript
lock
model
module
node
ownable
policy
processor
remote
rule
search
security
service
template
transaction
version
workflow
sandbox
service
tools
util
apache
queryRegister.dtd
meta-inf
test-resources
web
.classpath
.project
build.xml
alfresco-community-repo/source/java/org/alfresco/repo/attributes/AttributeServiceTransportService.java
Britt Park 0ea69ac954 Another pair of convenience methods for AttributeService:
removeEntries, which removes map entries by query.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5806 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2007-05-29 19:17:04 +00:00

302 lines
11 KiB
Java

/*
* 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 java.util.Map;
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);
}
/* (non-Javadoc)
* @see org.alfresco.service.cmr.remote.AttributeServiceTransport#exists(java.lang.String, java.util.List)
*/
public boolean exists(String ticket, List<String> keys)
{
fAuthService.validate(ticket);
return fService.exists(keys);
}
/* (non-Javadoc)
* @see org.alfresco.service.cmr.remote.AttributeServiceTransport#exists(java.lang.String, java.lang.String)
*/
public boolean exists(String ticket, String path)
{
fAuthService.validate(ticket);
return fService.exists(path);
}
/* (non-Javadoc)
* @see org.alfresco.service.cmr.remote.AttributeServiceTransport#getCount(java.lang.String, java.util.List)
*/
public int getCount(String ticket, List<String> keys)
{
fAuthService.validate(ticket);
return fService.getCount(keys);
}
/* (non-Javadoc)
* @see org.alfresco.service.cmr.remote.AttributeServiceTransport#getCount(java.lang.String, java.lang.String)
*/
public int getCount(String ticket, String path)
{
fAuthService.validate(ticket);
return fService.getCount(path);
}
/* (non-Javadoc)
* @see org.alfresco.service.cmr.remote.AttributeServiceTransport#addAttributes(java.lang.String, java.util.List, java.util.List)
*/
public void addAttributes(String ticket, List<String> keys, List<Attribute> values)
{
fAuthService.validate(ticket);
fService.addAttributes(keys, values);
}
/* (non-Javadoc)
* @see org.alfresco.service.cmr.remote.AttributeServiceTransport#addAttributes(java.lang.String, java.lang.String, java.util.List)
*/
public void addAttributes(String ticket, String path, List<Attribute> values)
{
fAuthService.validate(ticket);
fService.addAttributes(path, values);
}
/* (non-Javadoc)
* @see org.alfresco.service.cmr.remote.AttributeServiceTransport#setAttributes(java.lang.String, java.util.List, java.util.Map)
*/
public void setAttributes(String ticket, List<String> keys, Map<String, Attribute> entries)
{
fAuthService.validate(ticket);
fService.setAttributes(keys, entries);
}
/* (non-Javadoc)
* @see org.alfresco.service.cmr.remote.AttributeServiceTransport#setAttributes(java.lang.String, java.lang.String, java.util.Map)
*/
public void setAttributes(String ticket, String path, Map<String, Attribute> entries)
{
fAuthService.validate(ticket);
fService.setAttributes(path, entries);
}
/* (non-Javadoc)
* @see org.alfresco.service.cmr.remote.AttributeServiceTransport#removeEntries(java.lang.String, java.util.List, org.alfresco.service.cmr.attributes.AttrQuery)
*/
public void removeEntries(String ticket, List<String> keys, AttrQuery query)
{
fAuthService.validate(ticket);
fService.removeEntries(keys, query);
}
/* (non-Javadoc)
* @see org.alfresco.service.cmr.remote.AttributeServiceTransport#removeEntries(java.lang.String, java.lang.String, org.alfresco.service.cmr.attributes.AttrQuery)
*/
public void removeEntries(String ticket, String path, AttrQuery query)
{
fAuthService.validate(ticket);
fService.removeEntries(path, query);
}
}