com.trendmicro.grid.acl.l0
Class PublicFileRestService

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

@Service
public class PublicFileRestService
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-04-30

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.trendmicro.grid.acl.l0.Level0RestService
Level0RestService.RestUtil
 
Constructor Summary
PublicFileRestService()
           
 
Method Summary
 FileDetails getFileDetails(String sha1OrMd5Hash)
          Returns the file information (containing info and attached metadata) on the specified file.
 FileDetails getFileDetails(String sha1Hash, String md5Hash)
          Returns the file details (containing info and attached metadata) on the specified file.
 FileInformation getFileInformation(String sha1OrMd5Hash)
          Returns the file information (containing last modified and tags) on the specified file.
 FileInformation getFileInformation(String sha1Hash, String md5Hash)
          Returns the file information (containing last modified and tags) on the specified file.
 String isFileKnownGood(String sha1OrMd5Hash)
          Allows to query the GRID whether a file is known to be good.
 String isFileKnownGood(String sha1Hash, String md5Hash)
          Allows to query the GRID whether a file is known to be good.
 String isFilePureWhite(String sha1OrMd5Hash)
          Allows to query the GRID whether a file is known to be good and not included in the high risk category.
 String isFilePureWhite(String sha1Hash, String md5Hash)
          Allows to query the GRID whether a file is known to be good and not included in the high risk category.
 String isFileTaggedWith(String sha1OrMd5Hash, List<String> tags)
          Allows to query the GRID whether a file is tagged with a set of tags.
 String isFileTaggedWith(String sha1Hash, String md5Hash, List<String> tags)
          Allows to query the GRID whether a file is tagged with a set of tags.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PublicFileRestService

public PublicFileRestService()
Method Detail

isFileKnownGood

public String isFileKnownGood(String sha1OrMd5Hash)
                       throws AuthenticationException
Allows to query the GRID whether a file is known to be good.

Parameters:
sha1OrMd5Hash - The SHA1 or MD5 hash (as hexadecimal string) of the file to query.
Returns:
'true' if the file is good, 'false' if not, 'null' (HTTP 204 No Content) if it's unknown.
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_HASH_QUERIES

isFileKnownGood

public String isFileKnownGood(String sha1Hash,
                              String md5Hash)
                       throws AuthenticationException
Allows to query the GRID whether a file is known to be good.

Parameters:
sha1Hash - The SHA1 hash (as hexadecimal string) of the file to query.
md5Hash - The MD5 hash (as hexadecimal string) of the file to query.
Returns:
'true' if the file is good, 'false' if not, 'null' (HTTP 204 No Content) if it's unknown.
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_HASH_QUERIES

isFilePureWhite

public String isFilePureWhite(String sha1OrMd5Hash)
                       throws AuthenticationException
Allows to query the GRID whether a file is known to be good and not included in the high risk category.

Parameters:
sha1OrMd5Hash - The SHA1 or MD5 hash (as hexadecimal string) of the file to query.
Returns:
'true' if the file is good, 'false' if not, 'null' (HTTP 204 No Content) if it's unknown.
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_HASH_QUERIES

isFilePureWhite

public String isFilePureWhite(String sha1Hash,
                              String md5Hash)
                       throws AuthenticationException
Allows to query the GRID whether a file is known to be good and not included in the high risk category.

Parameters:
sha1Hash - The SHA1 hash (as hexadecimal string) of the file to query.
md5Hash - The MD5 hash (as hexadecimal string) of the file to query.
Returns:
'true' if the file is good, 'false' if not, 'null' (HTTP 204 No Content) if it's unknown.
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_HASH_QUERIES

isFileTaggedWith

public String isFileTaggedWith(String sha1OrMd5Hash,
                               List<String> tags)
                        throws AuthenticationException
Allows to query the GRID whether a file is tagged with a set of tags.

Parameters:
sha1OrMd5Hash - The SHA1 or MD5 hash (as hexadecimal string) of the file to query.
Returns:
'true' if the file is tagged with all given tags, 'false' if not, 'null' (HTTP 204 No Content) if it's unkown.
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_HASH_QUERIES

isFileTaggedWith

public String isFileTaggedWith(String sha1Hash,
                               String md5Hash,
                               List<String> tags)
                        throws AuthenticationException
Allows to query the GRID whether a file is tagged with a set of tags.

Parameters:
sha1Hash - The SHA1 hash (as hexadecimal string) of the file to query.
md5Hash - The MD5 hash (as hexadecimal string) of the file to query.
Returns:
'true' if the file is tagged with all given tags, 'false' if not, 'null' (HTTP 204 No Content) if it's unkown.
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_HASH_QUERIES

getFileInformation

public FileInformation getFileInformation(String sha1OrMd5Hash)
                                   throws AuthenticationException
Returns the file information (containing last modified and tags) on the specified file.

Parameters:
sha1OrMd5Hash - The SHA1 or MD5 hash (as hexadecimal string) of the file to query.
Returns:
'true' if the file is tagged with all given tags, 'false' if not, 'null' (HTTP 204 No Content) if it's unkown.
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_HASH_QUERIES

getFileInformation

public FileInformation getFileInformation(String sha1Hash,
                                          String md5Hash)
                                   throws AuthenticationException
Returns the file information (containing last modified and tags) on the specified file.

Parameters:
sha1Hash - The SHA1 hash (as hexadecimal string) of the file to query.
md5Hash - The MD5 hash (as hexadecimal string) of the file to query.
Returns:
'true' if the file is tagged with all given tags, 'false' if not, 'null' (HTTP 204 No Content) if it's unkown.
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_HASH_QUERIES

getFileDetails

public FileDetails getFileDetails(String sha1OrMd5Hash)
                           throws AuthenticationException
Returns the file information (containing info and attached metadata) on the specified file.

Parameters:
sha1OrMd5Hash - The SHA1 or MD5 hash (as hexadecimal string) of the file to query.
Returns:
'true' if the file is tagged with all given tags, 'false' if not, 'null' (HTTP 204 No Content) if it's unkown.
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_HASH_QUERIES, ROLE_ACCESS_DETAILS

getFileDetails

public FileDetails getFileDetails(String sha1Hash,
                                  String md5Hash)
                           throws AuthenticationException
Returns the file details (containing info and attached metadata) on the specified file.

Parameters:
sha1Hash - The SHA1 hash (as hexadecimal string) of the file to query.
md5Hash - The MD5 hash (as hexadecimal string) of the file to query.
Returns:
'true' if the file is tagged with all given tags, 'false' if not, 'null' (HTTP 204 No Content) if it's unkown.
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_HASH_QUERIES, ROLE_ACCESS_DETAILS