Limit access on returned Collection

Hello, is it possible to write a method to return a collection and don't allow the caller to add or remove objects from the collection, but allow the caller modify the objects in the collection.

Hello, is it possible to write a method to return a
collection and don't allow the caller to add or remove
objects from the collection, but allow the caller
modify the objects in the collection.Well there is nothing to stop someone from modifying the object in a Collection other than through that Collection itself.
Do you mean you want to allow people to replace immutable objects like Strings but not add or remove them?
The only Collections this would seem to make any sense for are Lists. YOu ca nso this pretty easily. extend AbstractList and implement the get(index) and size methods. Then implement the set(index. object) method so that it throws an exception if the index >= size.
Oh here it is:
UpdateableList extends AbstractList {
   List list;
   public UpdateableList(List list) {
      if (list == null)  throw new IllegalArgumentException();
      this.list = list;
   public Object get(int index) {
      return list.get(index);
   public int size() {
      return list.size();
   public Object set(int index, Object object) {
      if (index >= size) throw new IndexOutOfBoundsException();
      return list.set(index, object);
}Note, I'm not sure but allowing the set method may open up the add other methods, so you might need to throw UnsupportedOperationException in those methods.

Similar Messages

  • Limit user Access to Return Data in Report

    Have reporst that I need to limit what is returned. The person running the report should only see the data that they own. Is this possible. Can I set an attribute based on the person who has signed on to Discoverer and use that in the select to limit the data returned.
    Thanks,
    Dan

    Yes, it's possible!
    You can use the VPD (Virtuall Private Database) feature of the database.
    Check out the following stuff:
    http://www.oracle.com/oramag/oracle/99-Jul/index.html?49sec.html
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adgsec02.htm
    http://www.oracle-base.com/Articles/8i/VirtualPrivateDatabases(VPD).asp

  • Limit access to Apex login page

    Hi,
    We are deploying an application to our users. I need to limit access to Apex login page f?p=4550 to some predefined Ip adresses. Any ideas on this?
    Best regards,
    Onur.

    How exactly the APEX engine forces a '404' to be returned, I am not entirely sure. Perhaps it sends back the Response with the Header Status set to 404 ?Yes, with this process on the login page.
    begin
      if not #OWNER#.wwv_flow_security.ip_check then
          #OWNER#.wwv_flow.g_unrecoverable_error := true;
          sys.owa_util.status_line(404, 'Page Not Found');
          sys.owa_util.http_header_close;
      end if;
    end;Scott

  • User has contribute access but he is not able to access the site collection...

    User has contribute access but he is not able to access the site collection...

    What error does he get.
    Can you share fiddler trace(check if any 404 error)
    what error do we see in ULS Logs
    Create disableloopback
    registry on server
    http://support.microsoft.com/kb/926642/en-us

  • WRT54G: How do I limit access to specific ports, only to local IP's

    Using a WRT54G with Windows XP, and I've setup a web server that I'm still testing. Until I understand the security better, I want to limit access from outside IP's to the port that it's running on, but NOT limit access from the outside to services running on other ports. Is there a way to block a range of IP addresses (or conversely, only permit access for a limited range of IP addresses) to a specific port? So for example (assuming server's on Port 99, and IP address to the outside world is 99.99.99.99: Port 99: Blocked IP Range: 0.0.0.0-99.99.99.98, and 99.99.99.100-255.255.255.255 - OR Port 99: Allowed IP Range: 99.99.99.99 Alternatively, I would be interested to permit access to the web server port, only for certain MAC addresses. Is this pretty secure, and if so, how can this be done? I've poked around the router settings and spent a good deal of time researching this; any help would be greatly appreciated...

    Why do you want to block IP addresses:  "IP Range: 0.0.0.0-99.99.99.98, and 99.99.99.100-255.255.255.255" ?   This is everybody on the web, except your router!    If you really want to block all these people, just unplug your router from your Internet connection.  That is a block that cannot be hacked!
    Normally a server is assigned a fixed LAN IP address.  This address must be outside the DHCP server range of your router, and it cannot end in 0, 1, or 255.
    Next you forward a port (for example, 99) to the server's fixed LAN IP address.
    Data arriving at the Internet port of your WRT54G for port 99 will then be forwarded to your server.  If you have other Internet services (i.e. server B) running on port 1297, then data that arrives at the Internet port of your WRT54G for port 1297 will be directed to server B.   Assuming that you only have port 99 and port 1297 open, then any other unrequested data (for any other port) that arrives at the Internet port of your WRT54G will simply be ignored (and thereby blocked).    If you connect another computer to a LAN port of the WRT54G, connect to the Internet, and request data, then when that data arrives at the Internet port of the WRT54G, it will be allowed to pass, and it will be routed to your computer.
    In summary, by default, all router ports are closed.  The only way to get data through the router is either to open a port (using port forwarding, or alternatively, the UPnP function), or for someone (or some program) on the LAN to request data from the web.
    The router cannot limit the use of a port by MAC address.    When you open a port on your router, you are opening your server to invasion from anyone on the Internet.  So, your server must be setup to protect itself.   Rather than limiting server use by MAC address (which can be faked), your server should be setup to require a user name and password. 

  • 2nd generation time capsule: how to limit access to wireless network at night?

    I am using a 2nd generation time capsule and need to limit access to my wireless network at night, is there a setting to do this?  I don't want to physically have to shut down my time capsule/router every night but I need a way to turn off the wireless network at night or during specific hours.  Also open to suggestions on how to accomplish this if Time Capsule does not allow it.    This question is for a 2nd generation 500GB, Model A1302 Time Capsule.  Thank you.

    Unless you physically attach an electronic timer to the Time Capsule, there is no way to tell the Time Capsule when to turn on and off.
    Using the Timed Access settings in AirPort Utility, it is possible to define the hours each day that wireless devices will be allowed to  connect to the network.
    For example, you might set the Time Capsule to not allow wireless access between Midnight and 8 AM each day. Devices would be able to connect at other times.
    But, Timed Access will not physically power the Time Capsule "on" and "off".

  • How do I limit access of a computer that is plugged directly into the router?

    I have an AirPort Extreme, Version 7.6.1  I need to limit access of a computer that's plugged by usb directly into the router.  I have the MAC address for this computer and have had restrictions on it the in the past, but it was connected by WiFi then.  How do I do this?  Do I limit access to the Ethernet ID?  I don't want to lock myself out trying to figure it out; I did that last night.  Can someone advise please.

    You could use OpenDNS's parental controls:
    http://www.opendns.com/home-solutions/parental-controls
    It can restrict access according to your specifications for everyone on your network.
    It's free.

  • I upgraded to PhotoShop CC 2014 and can no longer access my NIK Collection.  It worked fine in PhotoShop CC?  What can I do?

    I upgraded to PhotoShop CC 2014 and can no longer access my NIK Collection.  It worked fine in PhotoShop CC?  What can I do?

    Contact Nik/Google for updated plugins that work in the new version of Photoshop.

  • Unable to access my site collection after publishing "MS Word SharepointWiki Plugin" to it

    I am working on an publishing site collection of type "EnterpriseWiki" . and to be able to convert MS word documents to wiki pages i downloaded the "MS Word SharepointWiki Plugin" from https://sharepointwikiplugin.codeplex.com/SourceControl/latest.
    then i open the downlaoded file using Visual Studio, then i right click on the solution inside the visual studio, and i chose publish. then i specify the URL for my site collection. and the publish process worked well. but when i tried to access the site collection
    i got the following error :-
    Http 403 Forbidden.
    so can anyone advice on this problem please ?

    Since there are no actual published releases of the code I suspect its still a work in progress.  I suspect you'll need to take a look at the actual code to figure out why it doesn't work.
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.
    so for now how i can make my site collection to work again ? i have publish the solution to my site collection using VS 2013, so is there a way to unpublish this ?

  • Oracle Form Personalization - Limit access to HR Lookup Table

    Need to pose this to the experts. I need to see if through a form personalization i can restrict access to certain lookup tables that a responsibility has access to. So responsibility 'XXHR' can only see and update lookup tables 'XXHR_A' and lookup table 'XXHR_B' and not be able to see or update any other table.
    Thanks in advance for your support
    Steve

    Duplicate post.
    Oracle Form Personalization - Limit access to HR Lookup Table
    Oracle Form Personalization - Limit access to HR Lookup Table

  • Unable to access data returned by EJB

    Hi,
    One of my EJB method(getHeaderInfo) returns string array (String[]). In the WSDL, I have following entries -
    <complexType name="GetHeaderResponseType">
    <sequence>
    <any/>
    </sequence>
    </complexType>
    <message name="GetResponseMessage">
    <part name="header" type="tns:GetHeaderResponseType"/>
    </message>
    <portType>
    <operation name="getHeaderInfo">
    <input name="GetHeaderInfoRequest" message="tns:GetHeaderRequestMessage"/>
    <output name="GetHeaderInfoResponse" message="tns:GetHeaderResponseMessage"/>
    <fault name="GetHeaderInfoException" message="tns:ExceptionMessage"/>
    </operation>
    </portType>
    <binding name="EJBBinding" type="tns:Data">
    <ejb:binding/>
    <format:typeMapping encoding="Java" style="Java">
    <format:typeMap typeName="xsd:string" formatType="java.lang.String" />
    <format:typeMap typeName="xsd:boolean" formatType="boolean" />
    <format:typeMap typeName="tns:ExceptionType" formatType="java.lang.Exception"/>
    <format:typeMap typeName="tns:GetHeaderResponseType" formatType="java.lang.String[]"/>
    </format:typeMapping>
    <operation name="getHeaderInfo">
    <ejb:operation
    methodName="getHeaderInfo"
    parameterOrder="filepath filename" interface="remote" returnPart="header"/>
    <input name="GetHeaderInfoRequest"/>
    <output name="GetHeaderInfoResponse"/>
    <fault name="GetHeaderInfoException"/>
    </operation>
    </binding>
    When I execute the process I get following data in the output variable -
    <header >
    <header xmlns = "http://callhome.pillardata.com/" >
    <string xmlns = "http://www.w3.org/2001/XMLSchema" >
    1 </string>
    <string xmlns = "http://www.w3.org/2001/XMLSchema" >
    BrickFlashDataRecord </string>
    <string xmlns = "http://www.w3.org/2001/XMLSchema" >
    IDcbefc68f </string>
    <string xmlns = "http://www.w3.org/2001/XMLSchema" >
    A001439BGX </string>
    <string xmlns = "http://www.w3.org/2001/XMLSchema" >
    2005-12-14T18:00:20-08:00 </string>
    </header>
    </header>
    However I am not able to access data using XPath. Please suggest the proper way to write the WSLD and how to access the returned data in BPEL. Please let me know if further information is required.
    Thanks,

    Hi Justine,
    I think you will have to look at the access restrictions on the Universe Folder and the Report itself, in the CMC. It would appear that your security rights did not migrate successfully.
    Regards
    Alan

  • How to Access the Return Value of a Function

    Hi,
    How do I access the return value when calling an Oracle function from .NET using Oracle.DataAccess.Client? The function returns an integer of 0, 1 or 99.
    Dim db_command_oracle As New OracleCommand()
    db_command_oracle.Connection = db_connection_oracle
    db_command_oracle.CommandType = CommandType.StoredProcedure
    db_command_oracle.CommandText = "swsarsi.import_appointments"
    Dim ret_value As New OracleParameter()
    ret_value.OracleDbType = OracleDbType.Int32
    ret_value.Direction = ParameterDirection.ReturnValue
    ret_value.Size = 2
    ret_value.OracleDbType = OracleDbType.Int32
    db_command_oracle.Parameters.Add(ret_value)
    Dim IN_student_id As New OracleParameter()
    IN_student_id.OracleDbType = OracleDbType.Varchar2
    IN_student_id.Direction = ParameterDirection.Input
    IN_student_id.Size = 10
    IN_student_id.Value = student_id
    db_command_oracle.Parameters.Add(IN_student_id)
    db_command_oracle.ExecuteNonQuery()
    messagebox.show(ret_value) ?????

    Your ODP.NET code looks correct. What error are you seeing?
    One thing that will definitely generate an error is that .NET message boxes require that strings be displayed. ret_value is a parameter object. You need to access its value and convert it to a string. At a minimum, you need to change that.

  • How to return Collection from from entity bean to servlet?

    hi
    is it possible to return Collection from entity bean (Which is returns form CMR field ) to servlet ?
    thanks

    SERVLET
    public class test extends HttpServlet {
       @EJB
       private LocalBean lookupBean;
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
      for(Item i : lookupBean.getMyCollection() )
              out.println(i.getItemName());
            out.close();
    }BEAN INTERFACE
    public interface BeanLocal {
        Collection<Item> getMyCollection();  
    }BEAN IMPLEMENTATION
    @Stateless()
    public class Bean implements BeanLocal {
        @PersistenceContext()  
        private EntityManager em;      
         public Collection<Item> getMyCollection() {
            return em.createQuery("SELECT i from ITEM i").getResultList();
        }    and if you create an instance of your servlet you'll have to reinitialize LocalBean
    @EJB(name="myejbref", beanInterface=BeanLocal.class)
    private BeanLocal lookupBean;
    private BeanLocal getLookupBean() {
    if(lookupBean == null) {
    try {
    InitialContext ic = new InitialContext();
    lookupBean = (BeanLocal) ic.lookup("java:comp/env/myejbref");
    catch(Exception e){
    System.out.println(e.getMessage());
    return lookupBean;
    }

  • Check User Can Access the site collection Are Not?

    Hi All 
    I have some requirement to check user can access site are not through powershell?
    Recently we done migration from 2010 to 2013 SP after that i got some problem some users can not access site  but this user have permission in sp 2010 site .
    Regarding this i need to check specific user can loing or Access  the site collection are not. using powershell
    Some one said impersonate user we can check user can open the web are not but i don't know this impersonate.
    Please help me guys.... 

    Hi,
    You can check the permission for specific user with powershell. Here is the link. Hope this will help.

  • Limit access times?

    Is there a way either through prefernces or parent controls to limit the times a computer can be used or surf the net?
    G4 400 AGP graphics upgraded to 1GHZ & Radeon 8500   Mac OS X (10.4.8)   250 Gig FW 800 back up drive

    James Borzak.
    I don't think that Preferences or Parental Controls in OS X 10.4.x offer the ability to limit access times.
    There is good information at this link about Parental Controls as well as a listing of third - party software solutions.
    Internet safety for children
    In addition, here is a link to VersionTracker for your review.
    Parental Control
    You might check with your ISP to see if they have anything that would allow you to set time restrictions.
    Sincerely,
    No Alibi.
     Backup what you can't afford to lose.   Mac OS X (10.4.8)  

Maybe you are looking for

  • File sender adapter: trigger mail if file is not there

    Hi, I have an scenario where I have a file sender adapter, and I need to look for a file in a specific folder from a specific FTP site. If the file is not present there, I need to trigger an alert to let some people know that the file was not found.

  • Windows 8 Add Features to Windows 8 Pro

    Hi, I have Windows 8 64-bit that was preinstalled on my laptop, now I want to upgrade to Windows 8 Pro 64-bit, I already have the license from my dreamspark account. My questions are, upgrading from Windows 8 to Windows 8 Pro, from the "add features"

  • How to upload pdf in cloud from my ipad 2?????

     

  • Non-native printer driver would not load

    Hi, I have a PowerPC G4 and two printers, an Epson Photo R220 and an Epson C60. The OS is 10.4.8. Several days ago I reset my printing (using the printer setup utility) and then tried to reload the Epson drivers. The drivers from Epson would not load

  • About phones

    What is the restriction code for nokia 2730classic-1