javax.jdo.spi.JDOPermission Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jdo-api Show documentation
Show all versions of jdo-api Show documentation
The Java Data Objects (JDO) API is a standard interface-based Java model abstraction of persistence, developed as Java Specification Request 243 under the auspices of the Java Community Process.
The newest version!
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package javax.jdo.spi;
/**
* The JDOPermission
class is for operations that are reserved for
* JDO implementations and should not be called by other code. A
* JDOPermission
is a named permission and has no
* actions. There are two names currently defined. Each named permission
* has a corresponding public static final field which contains an instance
* of the named permission.
*
* The following table
* provides a summary description of what each named permission allows,
* and discusses the risks of granting code the permission.
*
*
*
* Permission Target Name
* What the Permission Allows
* Risks of Allowing this Permission
*
*
* setStateManager
* This allows setting the StateManager
for an instance of
* PersistenceCapable
. The StateManager
* has unlimited access to get and set persistent and transactional fields of
* the PersistenceCapable
instance.
* This is dangerous in that information (possibly confidential)
* normally unavailable would be accessible to malicious code.
*
*
* getMetadata
* This allows getting metadata for any PersistenceCapable
* class that has registered with JDOImplHelper
.
* This is dangerous in that metadata information (possibly confidential)
* normally unavailable would be accessible to malicious code.
*
*
* manageMetadata
* This allows managing metadata for any PersistenceCapable
* class that has registered with JDOImplHelper
.
* This is dangerous in that metadata information (possibly confidential)
* normally unavailable would be manageable (modifiable) by malicious code.
*
*
*
* closePersistenceManagerFactory
* This allows closing a PersistenceManagerFactory
,
* thereby releasing resources.
* This is dangerous in that resources bound to the
* PersistenceManagerFactory
would be releaseable by
* malicious code.
*
*
*
* @see java.security.Permission
* @see java.security.BasicPermission
* @see javax.jdo.spi.JDOImplHelper
* @see javax.jdo.spi.PersistenceCapable
* @version 1.0.2
*/
public final class JDOPermission extends java.security.BasicPermission {
private static final long serialVersionUID = 3087132628681636890L;
/**
* Constructs a JDOPermission
with the specified name.
*
* @param name the name of the JDOPermission
*/
public JDOPermission(String name) {
super(name);
}
/**
* Constructs a JDOPermission
with the specified name and
* actions. The actions should be null
; they are ignored.
* This constructor exists for use by the Policy
object
* to instantiate new Permission
objects.
*
* @param name the name of the JDOPermission
* @param actions should be null
.
*/
public JDOPermission(String name, String actions) {
super(name, actions);
}
/** An instance of JDOPermission
to be used for
* getMetadata
permission checking.
*/
public final static JDOPermission GET_METADATA =
new JDOPermission("getMetadata"); // NOI18N
/** An instance of JDOPermission
to be used for
* manageMetadata
permission checking.
* @since 1.0.2
*/
public final static JDOPermission MANAGE_METADATA =
new JDOPermission("manageMetadata"); // NOI18N
/** An instance of JDOPermission
to be used for
* setStateManager
permission checking.
*/
public final static JDOPermission SET_STATE_MANAGER =
new JDOPermission("setStateManager"); // NOI18N
/** An instance of JDOPermission
to be used for
* closePersistenceManagerFactory
permission checking.
* @since 1.0.1
*/
public final static JDOPermission CLOSE_PERSISTENCE_MANAGER_FACTORY =
new JDOPermission("closePersistenceManagerFactory"); // NOI18N
}