Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9180927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:10:06+00:00 2026-06-17T18:10:06+00:00

I am working on a set of services, and a client JAR file which

  • 0

I am working on a set of services, and a client JAR file which is intended to be the sole means of calling these services. The client JAR will be used by multiple applications (all internal). However, we would like some services to be allowed for some client applications and not others.

I’m playing around with different approaches for meeting this goal, but one approach is to give each application a “context” value to pass at run-time. This value would represent the list of services allowed to that client application, and a service would be able to quickly calculate whether or not it is on that list.

Each service would have its own ID value, probably hard-coded into the Java class as a static final variable. For each client application, I would put together a list of allowed services, probably using a Groovy script or very basic web app. A bit of Reflection-based code would collect all of those ID values, and generate a hash representing them all.

I would give this “context” hash to client application owners along with the client JAR, and they would pass it back at run-time when calling a service. The service would use the same (or a related) hashing algorithm, to quickly check whether or not its ID is contained within the hash. If so, the service proceeds. If not, it throws an exception. This approach obviously would not protect against deliberate abuse, but these are all internal services and we only need to block negligent misuse.

I’m not sure which hashing algorithm to use (or if “hashing” is even the right word for it). I could just collect all of the allowed ID’s as a String, and later check to see whether a given ID is contained within that string. However, the “context” value would then be huge and unwieldy. I’m sure that there are standard mathematical approaches for hashing a list of values, and later checking whether a given raw value is in that list. Probably some that are already neatly packaged and exposed in the Java world. Any suggestions are appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:10:07+00:00Added an answer on June 17, 2026 at 6:10 pm

    I think what you are looking at is passing a compressed flat file/XML to the service. The service will read the file contents (after decompressing) into a HashSet and check if its id is present in the HashSet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a console application which will be scheduled and run at set
My Eclipse crashed, and a working set which I'd just spent an hour setting
I had a problem with set not working in a batch file; it took
I have a set of RESTful web services. These services are protected on a
I'm implementing a set of RESTful services for some developments and one of these
I'm working on a web service client which need to communicate with a server
I've been working on a set of RESTful HTTP services implemented using Restlet in
I'm currently working on some web services for a client of ours. Before we
How do I calculate the private working set of memory using C#? I'm interested
I've got my php working to set a cookie storing the http_referer the visitor

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.