lraCompData = new CompositeDataSupport(listRegionAttributesCompData, itemValuesHM); } catch (OpenDataException e) { e.printStackTrace(); lraCompData = null;
@Override public TabularData viewRemoteClusterStatus() { wanInfo.clear(); String[] wan = JMXProperties.getInstance().getProperty(getKey("wanInfo"), "").split(" "); int cnt = 0; while (wan.length >= (cnt + 2)) { try { wanInfo.put(buildWanInfoType(new String(wan[cnt]), Boolean.parseBoolean(wan[cnt + 1]))); } catch (OpenDataException e) { e.printStackTrace(); } cnt += 2; } return (TabularData) wanInfo.clone(); }
}); } catch (OpenDataException e) { e.printStackTrace(); return null; ); } catch (OpenDataException ode) { ode.printStackTrace(); } catch (Exception e) { e.printStackTrace(); }); } catch (OpenDataException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); array[index] = new CompositeDataSupport(ct, row); } catch (OpenDataException ode) { ode.printStackTrace();
/** * Get the CompositeData instance that represents the current values for * the MessagingStatistics instance. * @return The messaging statistics in a CompositedData instance */ public CompositeData getMessagingStatistics() { CompositeData mscd = null; try { mscd = mMessagingStatistics.toCompositeData(); } catch ( javax.management.openmbean.OpenDataException odEx ) { odEx.printStackTrace(); } return mscd; }
private static CompositeType createServiceEventType(){ String description="This type encapsulates OSGi service events"; String[] itemNames=CompositeDataItemNames.SERVICE_EVENT; OpenType[] itemTypes=new OpenType[2]; String[] itemDescriptions=new String[2]; /*itemNames[0]="Service"; itemNames[1]="Type"; */ itemTypes[0]=SERVICE; itemTypes[1]=SimpleType.INTEGER; itemDescriptions[0]="The service associated with this event"; itemDescriptions[1]="The type of the event: {REGISTERED=1, MODIFIED=2 UNREGISTERING=3}"; try { return new CompositeType( "ServiceEvent", description, itemNames, itemDescriptions, itemTypes); } catch (OpenDataException e) { e.printStackTrace(); return null; } } private static CompositeType createFrameworkEventType(){
private static CompositeType createUserType() { //public CompositeType(String typeName, String description, String[] itemNames, String[] itemDescriptions, OpenType[] itemTypes) String description = "Mapping of org.osgi.service.useradmin.User for remote management purposes. User extends Role"; String[] itemNames = CompositeDataItemNames.USER; /*itemNames[0] = "Role"; itemNames[1] = "credentials";*/ String[] itemDescriptions = new String[2]; itemDescriptions[0] = "The role object that is extended by this user object"; itemDescriptions[1] = "The credentials for this user"; OpenType[] itemTypes = new OpenType[2]; itemTypes[0] = ROLE; itemTypes[1] = USERCREDENTIALS; try { return new CompositeType( "User", description, itemNames, itemDescriptions, itemTypes); } catch (OpenDataException e) { e.printStackTrace(); return null; } } private static CompositeType createRoleType() {
private static CompositeType createBundleEventType(){ String description="This type encapsulates OSGi bundle events"; String[] itemNames=CompositeDataItemNames.BUNDLE_EVENT; OpenType[] itemTypes=new OpenType[3]; String[] itemDescriptions=new String[3]; /* itemNames[0]="BundleId"; itemNames[1]="BundleLocation"; itemNames[2]="Type";*/ itemTypes[0]=SimpleType.INTEGER; itemTypes[1]=SimpleType.STRING; itemTypes[2]=SimpleType.INTEGER; itemDescriptions[0]="The ID of the bundle that generated this event"; itemDescriptions[1]="The location of the bundle that generated this event"; itemDescriptions[2]="The type of the event: {INSTALLED=1, STARTED=2, STOPPED=4, UPDATED=8, UNINSTALLED=16}"; try { return new CompositeType( "BundleEvent", description, itemNames, itemDescriptions, itemTypes); } catch (OpenDataException e) { e.printStackTrace(); return null; } } private static CompositeType createServiceEventType(){
private static CompositeType createUserCredentialsType() { //BUG possibly problems here with indexes which is which. review String description = "The credentials for a user"; String[] itemNames = CompositeDataItemNames.USER_CREDENTIALS; /*itemNames[0] = "KeysForStringValues"; itemNames[1] = "KeysForByteArrayValues"; itemNames[3] = "ByteArrayValues"; itemNames[2] = "StringValues"; */ String[] itemDescriptions = new String[4]; itemDescriptions[0] = "A string array containing the keys for the credentials which are Strings"; itemDescriptions[1] = "A string array containing the keys for the credentials which are byte[]"; itemDescriptions[2] = "A string array containing the values of the credentials which are Strings"; itemDescriptions[3] = "A 2D-array containing the values of the credentials which are byte[]. byte[i] is the i-nth Byte[], whose key is at KeysForByteArrayValues[i]"; try { return new CompositeType( "UserCredentials", description, itemNames, itemDescriptions, OSGiTypes.DICTIONARYITEMTYPES); } catch (OpenDataException e) { e.printStackTrace(); return null; } }
private static CompositeType createUserAdminEventType(){ String description="This type encapsulates OSGi user admin events"; String[] itemNames=CompositeDataItemNames.USER_EVENT; OpenType[] itemTypes=new OpenType[3]; String[] itemDescriptions=new String[3]; /*itemNames[0]="Type"; itemNames[1]="Role"; itemNames[2]="Service"; */ itemTypes[0]=SimpleType.INTEGER; itemTypes[1]=ROLE; itemTypes[2]=SERVICE; itemDescriptions[0]="The type of the event: {ROLE_CREATED= 1, ROLE_CHANGED=2, ROLE_REMOVED=4}"; itemDescriptions[1]="The role associated with this event"; itemDescriptions[2]="The UserAdmin service associated with this event. In some gateways, there might be more than one service available."; try { return new CompositeType( "UserAdminEvent", description, itemNames, itemDescriptions, itemTypes); } catch (OpenDataException e) { e.printStackTrace(); return null; } } private static CompositeType createServiceType() {
private static CompositeType createRolePropertiesType() { String description = "The properties dictionary mapping of a Role. It has four fields: KeysForStringValues, KeysForByteArrayValues, StringValues, ByteArrayValues"; String[] RolePropertiesItemNames = CompositeDataItemNames.ROLE_PROPERTIES; /*RolePropertiesItemNames[0] = "KeysForStringValues"; RolePropertiesItemNames[1] = "KeysForByteArrayValues"; RolePropertiesItemNames[3] = "ByteArrayValues"; RolePropertiesItemNames[2] = "StringValues";*/ String[] itemDescriptions = new String[4]; itemDescriptions[0] = "A string array containing the keys for the properties which are Strings"; itemDescriptions[1] = "A string array containing the keys for the properties which are byte[]"; itemDescriptions[2] = "A string array containing the values of the properties which are Strings"; itemDescriptions[3] = "A 2D-array containing the values of the properties which are byte[]. byte[i] is the i-nth Byte[], whose key is at KeysForByteArrayValues[i]"; try { return new CompositeType( "RoleProperties", description, RolePropertiesItemNames, itemDescriptions, DICTIONARYITEMTYPES); } catch (OpenDataException e) { e.printStackTrace(); return null; } }
itemTypes); } catch (OpenDataException e) { e.printStackTrace(); return null;
itemTypes); } catch (OpenDataException e) { e.printStackTrace(); return null;
itemTypes); } catch (OpenDataException e) { e.printStackTrace(); return null;
private static CompositeType createExceptionType() { String description = "The exception mapping for logging purposes"; String[] itemNames = CompositeDataItemNames.EXCEPTION; /*itemNames[0] = "Message"; itemNames[1]="StackTrace";*/ String[] itemDescriptions = new String[2]; itemDescriptions[0] = "The exception's message"; itemDescriptions[1]="The exception's stack trace"; OpenType[] itemTypes = new OpenType[2]; itemTypes[0] = SimpleType.STRING; try { itemTypes[1] = new ArrayType(1, STACKTRACE_ELEMENT); return new CompositeType( "Exception", description, itemNames, itemDescriptions, itemTypes); } catch (OpenDataException e) { e.printStackTrace(); return null; } } private static CompositeType createRolePropertiesType() {
private static CompositeType createAuthorizationType() { String description = "An authorization object defines which roles has a user got"; String[] itemNames = CompositeDataItemNames.AUTHORIZATION; /*itemNames[0] = "UserName"; itemNames[1] = "RoleNames";*/ String[] itemDescriptions = new String[2]; itemDescriptions[0] = "The user name for this authorization object"; itemDescriptions[1] = "The names of the roles encapsulated by this auth object"; OpenType[] itemTypes = new OpenType[2]; itemTypes[0] = SimpleType.STRING; try { itemTypes[1] = new ArrayType(1, SimpleType.STRING); return new CompositeType( "Authorization", description, itemNames, itemDescriptions, itemTypes); } catch (OpenDataException e) { e.printStackTrace(); return null; } } private static CompositeType createLogEntryType() {
itemTypes); } catch (OpenDataException e) { e.printStackTrace(); return null;
private static CompositeType createServiceType() { String description = "The mapping of the service information for log entries"; String[] ServiceItemNames = CompositeDataItemNames.SERVICE; /*ServiceItemNames[0] = "BundleId"; ServiceItemNames[1] = "BundleLocation"; ServiceItemNames[2] = "objectClass";*/ String[] itemDescriptions = new String[3]; itemDescriptions[0] = "The id of the bundle which registered the service"; itemDescriptions[1] ="The location of the bundle that registered the service"; itemDescriptions[2] = "An string array containing the interfaces under which the service has been registered"; OpenType[] itemTypes = new OpenType[3]; itemTypes[0] = SimpleType.INTEGER; itemTypes[1] =SimpleType.STRING; try { itemTypes[2] = new ArrayType(1, SimpleType.STRING); return new CompositeType( "Service", description, ServiceItemNames, itemDescriptions, itemTypes); } catch (OpenDataException e) { e.printStackTrace(); return null; } } private static CompositeType createStackTraceElementType() {
private static CompositeType createGroupType() { String description = "Mapping of org.osgi.service.useradmin.Group for remote management purposes. Group extends User which in turn extends Role"; String[] itemNames = CompositeDataItemNames.GROUP; /*itemNames[0] = "User"; itemNames[1] = "members"; itemNames[2] = "requiredMembers"; */ String[] itemDescriptions = new String[3]; itemDescriptions[0] = "The user object that is extended by this group object"; itemDescriptions[1] = "The members of this group"; itemDescriptions[2] = "The required members for this group"; OpenType[] itemTypes = new OpenType[3]; itemTypes[0] = USER; try { itemTypes[1] = new ArrayType(1, SimpleType.STRING); itemTypes[2] = new ArrayType(1, SimpleType.STRING); return new CompositeType( "Group", description, itemNames, itemDescriptions, itemTypes); } catch (OpenDataException e) { e.printStackTrace(); return null; } } private static CompositeType createAuthorizationType() {