createLMCustomerFull

Sets up the essential information for a new customer, in one call.

Parameters:

Field
Type
Required Description
sessionid String yes The sessionid returned by loginLMLicensee()
licensee String yes The company code (not the company name) for the Licensee.
customerData CustomerSetupInfo yes A structure defining the top-level information for the new customer.
poolData PoolSetupInfoFull yes A structure defining the customer's new pool.
moveLicensesData MoveLicenseRequest no The number of licenses to move into the new pool from another pool.

CustomerSetupInfo

Field
Type
Description
code String The company code for the customer. If this is left blank then a code will be generated for you.
libraryData Array of String A list of library codes to be assigned to the customer initially.
name String The English name of the customer, for display purposes.
parentCustomer String The company code for the customer of which this will become a sub-customer.
responsibleParties Array of String A list of email addresses for "responsible parties" for the new customer. (optional)
variableData Array of VarValueInfo A list of initial customer-level variable values to set.

PoolSetupInfoFull

Field
Type
Description
name String The name of the new pool.
noMoves Boolean Whether admins will be blocked from moving licenses into or out of this pool.
products Array of PoolProductInfo A list of products to be assigned to the pool.
queueData QueueInfo Information about a license queue to be created for the pool (optional).
restrictions RestrictionInfo A list of email addresses and domains allowed or blocked from using the pool.

MoveLicenseRequest

Field
Type
Description
comment String Explanation for the license move. Optional - if omitted, will be set to "New customer setup".
customerFrom String The company code (not the company name) of the customer from which to take the licenses.
customerTo String The company code (not the company name) of the customer to moe the licenses to. Ignored in the createLMCustomerFull() call.
expireDate Long The expiration date of the licenses to pull from customerFrom. The date is given as the number of milliseconds since January 1, 1970 (a standard Java time value). If this is 0 or null, then highest expiration date under customerFrom will be used, then the next highest, and so on.
numLicenses Integer The number of licenses to move.
poolFrom String The name of the pool from which to take the licenses. If the pool does not have a name, then passing "Pool ##" where ## is the pool number will also work.
poolTo String The name of the pool to move the licenses to. If the pool does not have a name, then passing "Pool ##" where ## is the pool number will also work. Ignored in the createLMCustomerFull() call.

VarValueInfo

Field
Type
Description
name String The name of the variable to set.
value String The value to set, if this is a non-list variable.
valueList Array of String The values to set, if this is a list variable.

PoolProductInfo

(Note: The only required field in this structure is code.)

Field
Type
Description
checkoutCount Integer The maximum number of check-out licenses that may be in use for this product at one time. Set to 0 for no restriction. Defaults to 0.
checkoutLength Integer The maximum number of days that a check-out licenses may be gotten for this product. Set to 0 for no restriction. Set to -1 to block check-out licenses from being used. Defaults to 0.
code String The product code (not the product name) for the product.
libraryData Array of String A list of library codes to be assigned to the customer initially for this product.
licenseLimit Integer The maximum number of licenses (of any kind) that may be in use for this product at one time. Set to 0 for no restriction. Defaults to 0.
validUntil Long An optional "early" expiration date for the licenses in the pool, which can be sooner than the licenses' actual expiration. The date is given as the number of milliseconds since January 1, 1970 (a standard Java time value).
variableData Array of VarValueInfo A list of initial customer/product-level variable values to set.

QueueInfo

Field
Type
Description
queueReserveHours Integer After a license slot becomes available, the number of hours for which to reserve that slot for the next person in the queue. Defaults to 1.
queueSize Integer The maximum size the queue can become. Set to 0 for no restriction. Defaults to 0.
queueType QueueType The queue type.

RestrictionInfo

Field
Type
Description
domainData Array of AccessRestriction Domain-level access restrictions
emailData Array of AccessRestriction Email-level access restrictions

AccessRestriction

Field
Type
Description
accessName String The email address or domain for which the restriction applies.
accessType AccessRestrictionType The type of restriction (include or exclude).


Return values: A StringData structure:

Field
Type
Description
fault FaultData If an error has occurred on the server, this will contain information about the error. This field will be null if no error occurred.
data String The company code for the new customer. Useful if the company code was generated by the server.

Example:

NitroAdminAccessServiceLocator service = new NitroAdminAccessServiceLocator();
NitroAdminAccess server = service.getNitroAdminAccess();

VarValueInfo val1 = new VarValueInfo();
val1.setName("VAR1");
val1.setValue("Y");

VarValueInfo val2 = new VarValueInfo();
val2.setName("LIST1");
val2.setValueList(new String[] {"ITEM1", "ITEM2", "ITEM3"});

CustomerSetupInfo ci = new CustomerSetupInfo();
ci.setLibraryData(new String[] {"as09gjal23g9fsx.ei2e"});
ci.setName("Customer 1");
ci.setParentCustomer("testcust");
ci.setResponsibleParties(new String[] {"john@smith.com"});
ci.setVariableData(new VarValueInfo[] {val1});

PoolProductInfo p1 = new PoolProductInfo();
p1.setCheckoutCount(5);
p1.setCheckoutLength(14);
p1.setCode("test");
p1.setLibraryData(new String[] {"8asdjfl03jasdg3asjd9"});
p1.setLicenseLimit(10);
p1.setValidUntil(1254369600000L); // 10/01/2009
p1.setVariableData(new VarValueInfo[] {val2});

PoolProductInfo[] ppi = new PoolProductInfo[] {p1};

PoolSetupInfoFull pi = new PoolSetupInfoFull();
pi.setName("my first pool");
pi.setNoMoves(Boolean.FALSE);
pi.setQueueData(new QueueInfo(2, 5, QueueType.fromString(NLMConstants.QUEUE_AUTO)));
pi.setProducts(ppi);

pi.setRestrictions(
        new RestrictionInfo(
                new AccessRestriction[] {new AccessRestriction("noo.com", AccessRestrictionType.I)},
                new AccessRestriction[] {new AccessRestriction("frank@noo.com", AccessRestrictionType.E), new AccessRestriction("ethel@noo.com", AccessRestrictionType.E)}
                ));

MoveLicenseRequest mlr = new MoveLicenseRequest();
mlr.setCustomerFrom("testcust");
mlr.setPoolFrom("pool 135");
mlr.setNumLicenses(2);

StringData ret = server.createLMCustomerFull(sessionid, "smith", ci, pi, mlr);
if (ret.getFault()!=null) {
	System.err.println("Error: " + ret.getFault().getFaultString());
	return;
}
System.out.println("New company's code: " + ret.getData());
Comments