com.trendmicro.grid.acl.l0
Class PublicCategoryRestService

java.lang.Object
  extended by com.trendmicro.grid.acl.l0.PublicCategoryRestService
All Implemented Interfaces:
Level0RestService, RestService, Service

@Service
public class PublicCategoryRestService
extends Object
implements Level0RestService

Implements a REST styled interface on top of the SOAP api using JAX-RS

Version:
1.0
Author:
juergen_kellerer, 2010-05-31

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.trendmicro.grid.acl.l0.Level0RestService
Level0RestService.RestUtil
 
Constructor Summary
PublicCategoryRestService()
           
 
Method Summary
 CategoryView getCategoryView(String locale, String viewName)
           
 NameList getCategoryViewNames(String locale, String targetIdentifier)
          Returns the names of available category views,
 CategoryList getPlainCategories(String locale)
          Returns all plain categories (without any view or child relationship).
 Category getPlainCategory(String locale, String categoryName)
          Returns the plain category information (without any view or child relationship).
 NameList getReferencingCategoryNamesOnFile(String sha1OrMd5Hash)
          Returns the names of the categories that the given file belongs to.
 NameList getReferencingCategoryNamesOnPackageById(String sha1OrMd5Hash)
          Returns the names of the categories that the given package file belongs to.
 NameList getReferencingCategoryNamesOnPackageByName(String packageName)
          Returns the names of the categories that the given package file belongs to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PublicCategoryRestService

public PublicCategoryRestService()
Method Detail

getCategoryViewNames

public NameList getCategoryViewNames(String locale,
                                     String targetIdentifier)
                              throws AuthenticationException
Returns the names of available category views,

Parameters:
locale - The locale (language & country) of the requester (views are regional!).
targetIdentifier - Optional identifier specifying the requesting target application type. Is set to "default" if left empty or if it is not existing.
Returns:
A list of available viewnames.
Throws:
AuthenticationException - In case of this service requires authentication and the current user session is not authenticated or doesn't have the right to access the service.
Required roles:
ROLE_RUN_CATEGORIZATION_QUERIES

getCategoryView

public CategoryView getCategoryView(String locale,
                                    String viewName)
                             throws AuthenticationException
Parameters:
locale - The locale (language & country) of the requester.
viewName - The name of the view to return.
Returns:
The cateogry view for the given name or 'null' if not existing.
Throws:
AuthenticationException - In case of this service requires authentication and the current user session is not authenticated or doesn't have the right to access the service.
Required roles:
ROLE_RUN_CATEGORIZATION_QUERIES

getPlainCategory

public Category getPlainCategory(String locale,
                                 String categoryName)
                          throws AuthenticationException
Returns the plain category information (without any view or child relationship).

Parameters:
locale - The locale (language & country) of the requester.
categoryName - The name of the category to return.
Returns:
The plain category (without any view or child relationship).
Throws:
AuthenticationException - In case of this service requires authentication and the current user session is not authenticated or doesn't have the right to access the service.
Required roles:
ROLE_RUN_CATEGORIZATION_QUERIES

getPlainCategories

public CategoryList getPlainCategories(String locale)
                                throws AuthenticationException
Returns all plain categories (without any view or child relationship).

Parameters:
locale - The locale (language & country) of the requester.
Returns:
All plain categories (without any view or child relationship).
Throws:
AuthenticationException - In case of this service requires authentication and the current user session is not authenticated or doesn't have the right to access the service.
Required roles:
ROLE_RUN_CATEGORIZATION_QUERIES

getReferencingCategoryNamesOnFile

public NameList getReferencingCategoryNamesOnFile(String sha1OrMd5Hash)
                                           throws AuthenticationException
Returns the names of the categories that the given file belongs to.

Parameters:
sha1OrMd5Hash - the SHA1 or MD5 hash to test against categorization.
Returns:
the category names that reference this identifier.
Throws:
AuthenticationException - In case of this service requires authentication and the current user session is not authenticated or doesn't have the right to access the service.
Required roles:
ROLE_RUN_CATEGORIZATION_QUERIES, ROLE_RUN_COMPLEX_QUERIES

getReferencingCategoryNamesOnPackageById

public NameList getReferencingCategoryNamesOnPackageById(String sha1OrMd5Hash)
                                                  throws AuthenticationException
Returns the names of the categories that the given package file belongs to.

Parameters:
sha1OrMd5Hash - the SHA1 or MD5 hash to test against categorization.
Returns:
the category names that reference this identifier.
Throws:
AuthenticationException - In case of this service requires authentication and the current user session is not authenticated or doesn't have the right to access the service.
Required roles:
ROLE_RUN_CATEGORIZATION_QUERIES, ROLE_RUN_COMPLEX_QUERIES

getReferencingCategoryNamesOnPackageByName

public NameList getReferencingCategoryNamesOnPackageByName(String packageName)
                                                    throws AuthenticationException
Returns the names of the categories that the given package file belongs to.

Parameters:
packageName - the name of the package to test against categorization.
Returns:
the category names that reference this identifier.
Throws:
AuthenticationException - In case of this service requires authentication and the current user session is not authenticated or doesn't have the right to access the service.
Required roles:
ROLE_RUN_CATEGORIZATION_QUERIES, ROLE_RUN_COMPLEX_QUERIES