|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IRemoteJSpaceAdmin
This interface contains all the administrative methods that GigaSpaces provides to control the JavaSpaces service.
Usage:
IJSpace space = (IJSpace) SpaceFinder.find(spaceUrl);
IRemoteJSpaceAdmin spaceAdmin = (IRemoteJSpaceAdmin)space.getAdmin();
The code examples on each method assumes the above usage.
Field Summary | |
---|---|
static int |
REPLICATION_STATUS_ACTIVE
The replication is active. |
static int |
REPLICATION_STATUS_DISABLED
The replication is disabled. |
static int |
REPLICATION_STATUS_DISCONNECTED
The replication is disconnected. |
Method Summary | |
---|---|
void |
changeReplicationState(String targetMemberName,
boolean disableReplication)
Temporarily disable/re-enable replication to remote. |
void |
dropClass(String className,
SpaceContext sc)
Drop all Class entries and all its templates from the space. |
BasicTypeInfo |
getClassTypeInfo(String className)
Get the basic class information from the space directory. |
ClusterPolicy |
getClusterPolicy()
Return the present ClusterPolicy objects. |
SpaceConfig |
getConfig()
Returns SpaceConfig of this space. |
String |
getName()
Returns the Space Name. |
Object[] |
getReplicationStatus()
returns the replication member-status relation of all the replication groups. |
SpaceRuntimeInfo |
getRuntimeInfo()
Returns SpaceRuntimeInfo . |
SpaceRuntimeInfo |
getRuntimeInfo(String className)
Returns SpaceRuntimeInfo for specific class name and its subclasses. |
int |
getState()
Returns the particular condition of this space. |
void |
ping()
Ping to space to see if alive. |
void |
restart()
Restarts the space. |
void |
setConfig(JSpaceAttributes config)
Set new configuration for this space. |
SpaceCopyStatus |
spaceCopy(IJSpace remoteSpace,
Object template,
boolean includeNotifyTemplates,
int chunkSize)
|
SpaceCopyStatus |
spaceCopy(String remoteUrl,
Object template,
boolean includeNotifyTemplates,
int chunkSize)
Given Url of a remote space, Copy all entries/notify templates from the space. |
void |
start()
Attempt to start this space. |
void |
stop()
Attempt to stop this space. |
Field Detail |
---|
static final int REPLICATION_STATUS_ACTIVE
static final int REPLICATION_STATUS_DISCONNECTED
static final int REPLICATION_STATUS_DISABLED
Method Detail |
---|
void restart() throws RemoteException
Usage:
try
{
spaceAdmin.restart();
}
catch( java.rmi.RemoteException ex )
{
System.err.println("Failed to restart space: " + ((IJSpace)space).getName());
System.err.println("Exception: " + ex);
}
RemoteException
- Failed to restart space.String getName() throws RemoteException
Usage:
spaceAdmin.getName()
RemoteException
- Failed to get nameSpaceRuntimeInfo getRuntimeInfo() throws RemoteException
SpaceRuntimeInfo
.
Usage:
SpaceRuntimeInfo runtime = spaceAdmin.getRuntimeInfo();
List classNames = runtime.m_ClassNames;
List numOfEntries = runtime.m_NumOFEntries;
RemoteException
- if a communication error occursSpaceRuntimeInfo getRuntimeInfo(String className) throws RemoteException
SpaceRuntimeInfo
for specific class name and its subclasses.
Usage:
String className = ExampleObject.class.getName();
SpaceRuntimeInfo runtime = spaceAdmin.getRuntimeInfo(className);
List classNames = runtime.m_ClassNames;
List numOfEntries = runtime.m_NumOFEntries;
RemoteException
- if a communication error occursSpaceConfig getConfig() throws RemoteException
SpaceConfig
of this space.
Usage:
SpaceConfig config = spaceAdmin.getConfig();
if (config != null)
boolean isClustered = config.m_isClustered;
RemoteException
- if a communication error occursvoid setConfig(JSpaceAttributes config) throws RemoteException
Usage:
String replicaClusterConfigFileName = configDirectory
+ File.separatorChar
+ replicaSpace
+ "-cluster-config.xml";
JSpaceAttributes spaceAttr = spaceAdmin.getConfig();
spaceAttr.m_isClustered = true;
spaceAttr.m_clusterConfigURL = replicaClusterConfigFileName;
if (spaceAttr.m_storageAdapterURL == null)
spaceAttr.m_storageAdapterClass = null;
spaceAdmin.setConfig(spaceAttr);
config
- - new configuration attributes to be used.
RemoteException
- if a communication error occursvoid ping() throws RemoteException
Usage:
try
{
spaceAdmin.ping();
}
catch (RemoteException re)
{
System.err.println("Space not accessible");
}
RemoteException
- if a communication error occursgetState()
void changeReplicationState(String targetMemberName, boolean disableReplication) throws RemoteException
Usage:
String memberName = container.getName() + ":" + space.getName();
spaceAdmin.changeReplicationState( memberName, false );
targetMemberName
- target replication cluster member to change replication to, "*" means all membersdisableReplication
- true=disable , false=enable
RemoteException
- if a communication error occursSpaceCopyStatus spaceCopy(String remoteUrl, Object template, boolean includeNotifyTemplates, int chunkSize) throws RemoteException
Usage:
SpaceCopyStatus copyStatus = spaceAdmin.spaceCopy( sourceSpaceURL, template, false );
System.out.println("Copy-Status: " + copyStatus );
remoteUrl
- url of remote space to copy fromtemplate
- Entry template or null.includeNotifyTemplates
- - if true ALL notify templates will be copied toochunkSize
- Chunk size (batch) for this copy operation.
RemoteException
- if a communication error occursSpaceCopyStatus spaceCopy(IJSpace remoteSpace, Object template, boolean includeNotifyTemplates, int chunkSize) throws RemoteException
RemoteException
Object[] getReplicationStatus() throws RemoteException
Usage:
Object[] replStatus = spaceAdmin.getReplicationStatus();
String[] peers = (String[])replStatus[0];
int[] status = (int[])replStatus[1];
RemoteException
- if a communication error occursBasicTypeInfo getClassTypeInfo(String className) throws RemoteException
Usage:
com.j_spaces.core.client.BasicTypeInfo classInfo
= spaceAdmin.getClassTypeInfo( className );
String[] fieldNames = classInfo.m_FieldsNames;
String[] fieldTypes = classInfo.m_FieldsTypes;
className
- - The name of the class to retrieve the information from.
RemoteException
- if a communication error occursClusterPolicy getClusterPolicy() throws RemoteException
RemoteException
- if a communication error occursvoid dropClass(String className, SpaceContext sc) throws RemoteException, DropClassException
Usage:
spaceAdmin.dropClass( className );
className
- name of class to delete.
DropClassException
- Failed to drop desired class.
RemoteException
- if a communication error occursvoid start() throws RemoteException, SpaceAlreadyStartedException
Usage:
spaceAdmin.start();
RemoteException
- - Failed to start space.
SpaceAlreadyStartedException
- - The space is already startedvoid stop() throws RemoteException, SpaceAlreadyStoppedException
Usage:
spaceAdmin.stop();
RemoteException
- - Failed to stop space.
SpaceAlreadyStoppedException
- - The space is already stoppedint getState() throws RemoteException
RemoteException
- if a communication error occursISpaceState
|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |